secondOrderTest: Second-order test of convergence

View source: R/utils.R

secondOrderTestR Documentation

Second-order test of convergence

Description

Test whether terminated estimation criteria for a given model passes the second order test by checking the positive definiteness of the resulting Hessian matrix. This function, which accepts the symmetric Hessian/information matrix as the input, returns TRUE if the matrix is positive definite and FALSE otherwise.

Usage

secondOrderTest(mat, ..., method = "eigen")

Arguments

mat

symmetric matrix to test for positive definiteness (typically the Hessian at the highest point of model estimator, such as MLE or MAP)

...

arguments passed to either eigen, chol, or 'det' for the positiveness of the eigen values, positiveness of leading minors via the Cholesky decomposition, or evaluation of whether the determinant is greater than 0

method

method to use to test positive definiteness. Default is 'eigen'

Value

a matrix with all possible combinations

Author(s)

Phil Chalmers rphilip.chalmers@gmail.com

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v048.i06")}

Examples


## Not run: 

# PD matrix
mod <- mirt(Science, 1, SE=TRUE)
info <- solve(vcov(mod))   ## observed information
secondOrderTest(info)
secondOrderTest(info, method = 'chol')
secondOrderTest(info, method = 'det')

# non-PD matrix
mat <- matrix(c(1,0,0,0,1,1,0,1,1), ncol=3)
mat
secondOrderTest(mat)
secondOrderTest(mat, method = 'chol')
secondOrderTest(mat, method = 'det')


## End(Not run)

mirt documentation built on Sept. 11, 2024, 7:14 p.m.