Main Page | Directories | File List | Globals

lmer.h File Reference

#include "Mutils.h"
#include "triplet_to_col.h"
#include "dgBCMatrix.h"
#include "bCrosstab.h"
#include <R_ext/Lapack.h>
#include <R_ext/Constants.h>

Go to the source code of this file.

Functions

SEXP lmer_validate (SEXP x)
SEXP lmer_update_mm (SEXP x, SEXP mmats)
SEXP lmer_create (SEXP flist, SEXP mmats)
SEXP lmer_inflate (SEXP x)
SEXP lmer_initial (SEXP x)
SEXP lmer_factor (SEXP x)
SEXP lmer_invert (SEXP x)
SEXP lmer_sigma (SEXP x, SEXP REML)
SEXP lmer_coef (SEXP x, SEXP Unc)
SEXP lmer_coefGets (SEXP x, SEXP coef, SEXP Unc)
SEXP lmer_fixef (SEXP x)
SEXP lmer_ranef (SEXP x)
SEXP lmer_ECMEsteps (SEXP x, SEXP nsteps, SEXP REMLp, SEXP Verbp)
SEXP lmer_gradient (SEXP x, SEXP REMLp, SEXP Uncp)
SEXP lmer_variances (SEXP x)
SEXP lmer_Crosstab (SEXP flist)
SEXP lmer_firstDer (SEXP x, SEXP val)


Function Documentation

SEXP lmer_coef SEXP  x,
SEXP  Unc
 

Extract the upper triangles of the Omega matrices. These aren't "coefficients" but the extractor is called coef for historical reasons. Within each group these values are in the order of the diagonal entries first then the strict upper triangle in row order.

Parameters:
x pointer to an lme object
Unc pointer to a logical scalar indicating if the parameters are in the unconstrained form.
Returns:
numeric vector of the values in the upper triangles of the Omega matrices

SEXP lmer_coefGets SEXP  x,
SEXP  coef,
SEXP  Unc
 

Assign the upper triangles of the Omega matrices. (Called coef for historical reasons.)

Parameters:
x pointer to an lme object
coef pointer to an numeric vector of appropriate length
Unc pointer to a logical scalar indicating if the parameters are in the unconstrained form.
Returns:
R_NilValue

SEXP lmer_create SEXP  flist,
SEXP  mmats
 

Create an lmer object from a list of grouping factors and a list of model matrices. There is one more model matrix than grouping factor. The last model matrix is the fixed effects and the response.

Parameters:
facs pointer to a list of grouping factors
ncv pointer to a list of model matrices
Returns:
pointer to an lmer object

SEXP lmer_Crosstab SEXP  flist  ) 
 

SEXP lmer_ECMEsteps SEXP  x,
SEXP  nsteps,
SEXP  REMLp,
SEXP  Verbp
 

Perform ECME steps for the REML or ML criterion.

Parameters:
x pointer to an ssclme object
nsteps pointer to an integer scalar - the number of ECME steps to perform
REMLp pointer to a logical scalar indicating if REML is to be used
verb pointer to a logical scalar indicating verbose output
Returns:
R_NilValue if verb == FALSE, otherwise a list of iteration numbers, deviances, parameters, and gradients.

SEXP lmer_factor SEXP  x  ) 
 

If status[["factored"]] is FALSE, create and factor Z'Z+Omega. Also create RZX and RXX, the deviance components, and the value of the deviance for both ML and REML.

Parameters:
x pointer to an lmer object
Returns:
NULL

SEXP lmer_firstDer SEXP  x,
SEXP  val
 

Fill in four symmetric matrices for each level, providing the information to generate the gradient or the ECME step. The four matrices are 1) -m_i^{-1} 2) 3) [{}(+)] 4) The term added to 3) to get [{}]

Parameters:
x pointer to an lme object
val pointer to a list of matrices of the correct sizes
Returns:
val

SEXP lmer_fixef SEXP  x  ) 
 

Extract the conditional estimates of the fixed effects

Parameters:
x Pointer to an lme object
Returns:
a numeric vector containing the conditional estimates of the fixed effects

SEXP lmer_gradient SEXP  x,
SEXP  REMLp,
SEXP  Uncp
 

SEXP lmer_inflate SEXP  x  ) 
 

Copy ZtZ to ZZpO and L. Inflate diagonal blocks of ZZpO by Omega. Update devComp[1].

Parameters:
x pointer to an lmer object

SEXP lmer_initial SEXP  x  ) 
 

Create and insert initial values for Omega.

Parameters:
x pointer to an lmer object
Returns:
NULL

SEXP lmer_invert SEXP  x  ) 
 

If necessary, factor Z'Z+Omega, ZtX, and XtX then, if necessary, replace the RZX and RXX slots by the corresponding parts of the inverse of the Cholesky factor. Replace the elements of the D slot by the blockwise inverses and evaluate bVar.

Parameters:
x pointer to an lmer object
Returns:
NULL (x is updated in place)

SEXP lmer_ranef SEXP  x  ) 
 

Extract the conditional modes of the random effects.

Parameters:
x Pointer to an lme object
Returns:
a vector containing the conditional modes of the random effects

SEXP lmer_sigma SEXP  x,
SEXP  REML
 

Extract the ML or REML conditional estimate of sigma

Parameters:
x pointer to an lme object
REML logical scalar - TRUE if REML estimates are requested
Returns:
pointer to a numeric scalar

SEXP lmer_update_mm SEXP  x,
SEXP  mmats
 

Update the arrays ZtZ, ZtX, and XtX in an lme object according to a list of model matrices.

Parameters:
x pointer to an lmer object
mmats pointer to a list of model matrices
Returns:
NULL

SEXP lmer_validate SEXP  x  ) 
 

Check validity of an lmer object.

Parameters:
x Pointer to an lmer object
Returns:
TRUE if the object is a valid lmer object, else a string describing the nature of the violation.

SEXP lmer_variances SEXP  x  ) 
 

Return the unscaled variances

Parameters:
x pointer to an lmer object
Returns:
a list similar to the Omega list with the unscaled variances


Generated on Fri Feb 18 08:49:35 2005 for Matrix by  doxygen 1.4.1