covFun: (Co)variance parameter transformations.

Description Usage Arguments Details Value Author(s) Examples

Description

Converts lists of (co)variance parameters either between list and vector format or between the theta and nu scales.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

Arguments

x, theta, nu

A list of matrices containing the (co)variance parameters of the model.

Gcon, Rcon

A list of starting (co)variance constraints for the G-structure (random effects terms) or R-structure (residual).

Gstart, Rstart

A list of starting (co)variance values for the G-structure (random effects terms) or R-structure (residual).

name

An (optional) character vector containing the (co)variance component names.

vech

A vector of (co)variance parameters.

skeleton

An example structure to map vech onto.

thetaG, thetaR

A vector indexing the G-structure or R-structure components, respectively.

sigma2e

A numeric estimate of the factored out residual variance from the mixed model equations (i.e., the ‘lambda’ scale) σ^{2}_{e}.

object

An object of class ‘gremlin’.

Details

Value

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:

thetaG

A vector indexing the G-structure components.

thetaR

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.

Author(s)

matthewwolak@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  # 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)

gremlin documentation built on July 1, 2020, 10:22 p.m.