#include "lmer.h"
Defines | |
#define | BLK(i, j) INTEGER(VECTOR_ELT(VECTOR_ELT(Parent, i), 1))[j] |
#define | PAR(i, j) INTEGER(VECTOR_ELT(VECTOR_ELT(Parent, i), 0))[j] |
Functions | |
static R_INLINE int | coef_length (int nf, const int nc[]) |
SEXP | lmer_validate (SEXP x) |
static SEXP | lmer_crosstab (SEXP flist, int nobs, const int nc[]) |
SEXP | lmer_update_mm (SEXP x, SEXP mmats) |
SEXP | lmer_create (SEXP flist, SEXP mmats) |
SEXP | lmer_initial (SEXP x) |
SEXP | lmer_inflate (SEXP x) |
static R_INLINE int * | block_parent (int j, int n, int par[], SEXP ParP) |
SEXP | lmer_factor (SEXP x) |
static void | lmer_sm (enum CBLAS_SIDE side, enum CBLAS_TRANSPOSE trans, int nf, const int Gp[], int n, double alpha, SEXP L, double B[], int ldb) |
static int | max_nnz (int j, SEXP Parent) |
static void | fill_nnz (int i, int j, int nf, SEXP Parent, const int nc[], int nnz[], double *tmp[], int *ind[]) |
static R_INLINE int | fsrch (int target, const int vals[], int nvals) |
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_firstDer (SEXP x, SEXP val) |
static SEXP | EM_grad_array (int nf, const int nc[]) |
static double * | EM_grad_lc (double *cc, int EM, int REML, int ns[]) |
static void | EMsteps_verbose_print (SEXP x, int iter, int REML, SEXP firstDer, SEXP val) |
SEXP | lmer_ECMEsteps (SEXP x, SEXP nsteps, SEXP REMLp, SEXP Verbp) |
SEXP | lmer_gradient (SEXP x, SEXP REMLp, SEXP Uncp) |
static SEXP | lmer_secondDer (SEXP x, SEXP Valp) |
SEXP | lmer_variances (SEXP x) |
SEXP | lmer_Crosstab (SEXP flist) |
SEXP | lmer_fitted (SEXP x, SEXP mmats, SEXP useRf) |
|
|
|
|
|
Convert the extended parent pair (Parent, Block) to a parent array for the jth diagonal block of size n.
|
|
Calculate the length of the parameter vector (historically called "coef" even though these are not coefficients).
|
|
Return a length nf list of arrays of dimension (nci, nci, 4). The values of these arrays are assigned in lmer_firstDer.
|
|
Fill in the 4-dimensional vector of linear combinations of the firstDer array according to whether ECME steps or the gradient are needed and to whether or not REML is being used.
|
|
Print the verbose output in the ECME iterations
|
|
Fill the nnz array with the number of nonzero inner blocks in each outer block of the jth inner column block of the ith outer block of L^{-1}. Also allocate the tmp and ind arrays and fill the ind array.
|
|
|
|
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.
|
|
Assign the upper triangles of the Omega matrices. (Called coef for historical reasons.)
|
|
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.
|
|
|
|
Create the pairwise crosstabulation of the elements of flist.
|
|
Perform ECME steps for the REML or ML criterion.
|
|
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.
|
|
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 [{}]
|
|
Calculate and return the fitted values.
|
|
Extract the conditional estimates of the fixed effects
|
|
|
|
Copy ZtZ to ZZpO and L. Inflate diagonal blocks of ZZpO by Omega. Update devComp[1].
|
|
Create and insert initial values for Omega.
|
|
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.
|
|
Extract the conditional modes of the random effects.
|
|
Fill in five symmetric matrices, providing the information to generate the Hessian.
|
|
Extract the ML or REML conditional estimate of sigma
|
|
Solve one of the matrix equations op(L)*X=alpha*B or X*op(L)=alpha*B where L is a sparse, blocked, unit lower triangular matrix.
|
|
Update the arrays ZtZ, ZtX, and XtX in an lme object according to a list of model matrices.
|
|
Check validity of an lmer object.
|
|
Return the unscaled variances
|
|
|