Description Usage Arguments Value Author(s) References See Also Examples
Check the adequation of the second derivatives (hessian) for computation
of variance and covariance. Use inside the function
m4plEstimateMore
to assure that computations can be applied to
this second derivative. Problems encountered can be of not positive definitetess,
singular matrix, diagonal not complitely positive. In these cases inversion
of the matrix is not posssible or variances cannot be computed from the
inverse of the diagonal.
1 |
x |
matrix: second derivative (hessian). |
isNumbers |
logical: check if the elements of the x matrix are all numerics. |
correctClass |
logical: check if the the x matrix is of class |
squareMatrix |
logical: check if the the x matrix is square. |
diagPositive |
logical: check if the elements of the x matrix are all positive and > 0. |
positiveDefinite |
logical: check if the the x matrix is positiveDefinite. |
nonSingular |
logical: check if the the x matrix is nonSingular. |
Gilles Raiche, Universite du Quebec a Montreal (UQAM),
Departement d'education et pedagogie
Raiche.Gilles@uqam.ca, http://www.er.uqam.ca/nobel/r17165/
Seber, G. E. A. F. (2008). A matrix handbook for statisticians. New York, New Jersey: Wiley.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Complete adequation of the matrix
## ..........................................................
x <- matrix(c(4.867054, 16.66902, 16.669023, 107.36390), ncol=2)
checkAdequation(x)
all(checkAdequation(x))
eigen(x)$values
det(x)
diag(x)
## ..........................................................
## Not positiveDefinite matrix
## ..........................................................
x <- matrix(1:4, ncol=2)
checkAdequation(x)
all(checkAdequation(x))
eigen(x)$values
det(x)
diag(x)
## ..........................................................
## More problems
## ..........................................................
x <- matrix(c("Inf",2,5,10), ncol=2)
checkAdequation(x)
all(checkAdequation(x))
det(x)
diag(x)
# eigen(x)$values
x <- matrix(c("NaN",2,5,10), ncol=2)
checkAdequation(x)
all(checkAdequation(x))
det(x)
diag(x)
# eigen(x)$values
## ..........................................................
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.