
Last chance! 50% off unlimited learning
Sale ends in
Converts lists of (co)variance parameters either between list
and
vector
format or between the theta and nu scales.
stTrans(x)conTrans(Gcon, Rcon)
start2theta(Gstart, Rstart, name = NULL)
matlist2vech(theta)
vech2matlist(vech, skeleton)
theta2nu_trans(theta)
nu2theta_trans(nu)
theta2nu_lambda(theta, thetaG, thetaR)
nu2theta_lambda(nu, sigma2e, thetaG, thetaR)
nuVar2thetaVar_lambda(object)
nuAI2thetaAIinv_lambda(object)
nu2theta_noTrans(nu, thetaG, thetaR)
A list
of matrices containing the (co)variance
parameters of the model.
A list
of starting (co)variance constraints for the
G-structure (random effects terms) or R-structure (residual).
A list
of starting (co)variance values for the
G-structure (random effects terms) or R-structure (residual).
An (optional) character vector
containing the (co)variance
component names.
A vector
of (co)variance parameters.
An example structure to map vech
onto.
A vector
indexing the G-structure or R-structure
components, respectively.
A numeric
estimate of the factored out residual
variance from the mixed model equations (i.e., the ‘lambda’ scale)
An object of class
‘gremlin’.
Functions are specified to mostly return either a list
of
matrices (structure as defined by the “skel” attribute or in
the skeleton
object) or a vector
containing the (co)variance
parameters of the model. Additional list elements returned can be:
A vector
indexing the G-structure components.
A vector
indexing the R-structure components.
Alternatively, nuVar2thetaVar_lambda
and nuAI2thetaAIinv_lambda
return a vector
and matrix
, respectively, holding the sampling
(co)variances of the model (co)variance parameters both on the theta
scale. These are elements of the inverse Average Information matrix.
stTrans
Transform start parameters into lower triangle
matrices of class dsCMatrix
.
conTrans
Transformation of starting constraints to correct
format.
start2theta
Converts lists of starting values for (co)variance
parameters to a theta object used to structure the (co)variance components
within gremlin.
matlist2vech
Converts a list
of (co)variance parameter
matrices to a vector with a “skel” attribute.
vech2matlist
Converts a vector of (co)variance parameters to
a list of covariance matrices.
theta2nu_trans
Transforms theta to nu scale by taking the
Cholesky factor of each covariance matrix and then replacing the diagonals
with their (natural) logarithms. Done to ensure matrices are positive
definite.
nu2theta_trans
Back transformation from
theta2nu_trans
: exponentiates the diagonal elements of each matrix
then calculates the cross-product.
theta2nu_lambda
Transformation that factors out a residual
variance so that nu
contains the ‘lambda’ parameterization:
ratios of variance parameters with the residual variance.
nu2theta_lambda
Back transformation from
theta2nu_lambda
.
nuVar2thetaVar_lambda
Transformation of Sampling Variances
from lambda
Scale for theta
.
nuAI2thetaAIinv_lambda
Transform AI matrix from lambda
Scale to AI-inverse of theta
.
nu2theta_noTrans
Structures theta
when not
transformed.
# NOT RUN {
# User-specified starting parameters
thetaOut <- start2theta(Gstart = list(matrix(1), matrix(2)),
Rstart = matrix(3))
## convert to a vector and then back into a matrix list
thetav <- matlist2vech(thetaOut$theta)
theta <- vech2matlist(thetav, attr(thetav, "skel"))
identical(thetaOut$theta, theta) #<-- should be TRUE
# lambda parameterization transformation
nu <- theta2nu_lambda(theta, thetaOut$thetaG, thetaOut$thetaR)
# back-transform from (lambda scale) nu to theta
## For example, when the sigma2e estimate=0.5
theta2 <- nu2theta_lambda(nu, sigma2e = 0.5, thetaOut$thetaG, thetaOut$thetaR)
# }
Run the code above in your browser using DataLab