Get Omega^-1 and derivatives
Arguments
- invObjOrMatrix
Object for inverse-type calculations. If this is a matrix, setup the object for inversion
rxSymInvCholCreate()with the default arguments and return a reactive s3 object. Otherwise, use the inversion object to calculate the requested derivative/inverse.- theta
Thetas to be used for calculation. If missing (
NULL), a special s3 class is created and returned to accessOmega^1objects as needed and cache them based on the theta that is used.- type
The type of object. Currently the following types are supported:
cholOmegaInvgives the Cholesky decomposition of the Omega Inverse matrix.omegaInvgives the Omega Inverse matrix.d(omegaInv)gives thed(Omega^-1)with respect to the theta parameter specified inthetaNumber.d(D)gives thed(diagonal(Omega^-1))with respect to the theta parameter specified in thethetaNumberparameter
- thetaNumber
For types
d(omegaInv)andd(D), the theta number that the derivative is taken against. This must be positive from 1 to the number of thetas defining the Omega matrix.
Value
Matrix based on parameters or environment with all the
matrixes calculated in variables omega, omegaInv, dOmega,
dOmegaInv.
See also
Other Utilities:
rxDerived(),
rxGetDefaultSerialize(),
rxHtml(),
rxInv(),
rxIsCurrent(),
rxLock(),
rxNumLoaded(),
rxOmegaVarCovDeriv(),
rxSuppressMsg(),
rxTempDir()
Examples
omega <- lotri::lotri(a + b ~ c(1, 0.5, 1))
x <- rxSymInvCholCreate(omega, create.env = FALSE)
rxSymInvChol(x, x$ini, "omegaInv")
#> [,1] [,2]
#> [1,] 1.3333333 -0.6666667
#> [2,] -0.6666667 1.3333333
# derivative of Omega^-1 with respect to the first theta
rxSymInvChol(x, x$ini, "d(omegaInv)", 1L)
#> [,1] [,2]
#> [1,] 4.963226 -1.240806
#> [2,] -1.240806 0.000000
