lmer.h File Reference

#include <R.h>
#include <Rdefines.h>

Include dependency graph for lmer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SEXP mer_create_L (SEXP CmP)
 Create and initialize L.
SEXP mer_MCMCsamp (SEXP x, SEXP fm)
 Generate a Markov-chain Monte Carlo sample from an mer object.
SEXP mer_optimize (SEXP x, SEXP verb)
 Optimize the profiled deviance of an lmer object or the Laplace approximation to the deviance of a nlmer or glmer object.
SEXP mer_postVar (SEXP x)
 Extract the conditional variances of the random effects in an mer object.
SEXP mer_ST_chol (SEXP x)
 Return a list of (upper) Cholesky factors from the ST list.
SEXP mer_ST_getPars (SEXP x)
 Extract the parameters from the ST slot of an mer object.
SEXP mer_ST_initialize (SEXP ST, SEXP Gp, SEXP Zt)
 Evaluate starting estimates for the elements of ST.
SEXP mer_ST_setPars (SEXP x, SEXP pars)
 Update the ST slot of an mer object from a REAL vector of parameters and update the sparse model matrix A.
SEXP mer_update_dev (SEXP x)
 Evaluate the discrepancy and log of the penalized discrepancy.
SEXP mer_update_L (SEXP x)
 Externally callable update_L.
SEXP mer_update_mu (SEXP x)
 Externally callable update_mu.
SEXP mer_update_projection (SEXP x)
 Externally callable lmm_update_projection.
SEXP mer_update_ranef (SEXP x)
 Externally callable update_ranef.
SEXP mer_update_RX (SEXP x)
 Externally callable update_RX.
SEXP mer_update_u (SEXP x, SEXP verbP)
 Externally callable update_u.
SEXP mer_validate (SEXP x)
 Check validity of an mer object.
SEXP merMCMC_validate (SEXP x)
 Check validity of an merMCMC object.
SEXP merMCMC_VarCorr (SEXP x, SEXP typ)
SEXP spR_optimize (SEXP x, SEXP verbP)
 Optimize the log-likelihood for the sparse representation of a Rasch model.
SEXP spR_update_mu (SEXP x)
 Update the eta, mu, resid and var slots in a sparseRasch object from the current values of the model parameters in the beta slot.


Function Documentation

SEXP mer_create_L ( SEXP  CmP  ) 

Create and initialize L.

Parameters:
CmP pointer to the model matrix for the orthogonal random effects (transposed)
Returns:
L

Definition at line 1293 of file lmer.c.

References _, and c.

SEXP mer_MCMCsamp ( SEXP  x,
SEXP  fm 
)

Generate a Markov-chain Monte Carlo sample from an mer object.

Parameters:
x pointer to an merMCMC object
fm pointer to an mer object
Returns:
x with samples filled in

Definition at line 1316 of file lmer.c.

References DEV_SLOT, DIMS_SLOT, FIXEF_SLOT, lme4_devianceSym, lme4_sigmaSym, lme4_STSym, lmm_update_fixef_u(), MCMC_beta_u(), MCMC_S(), MCMC_T(), ML_POS, n_POS, np_POS, p_POS, pwrss_POS, q_POS, RANEF_SLOT, SLOT_REAL_NULL(), ST_getPars(), ST_setPars(), update_L(), update_ranef(), update_RX(), and update_u().

Here is the call graph for this function:

SEXP mer_optimize ( SEXP  x,
SEXP  verbp 
)

Optimize the profiled deviance of an lmer object or the Laplace approximation to the deviance of a nlmer or glmer object.

Parameters:
x pointer to an mer object
verbp pointer to indicator of verbose output
Returns:
R_NilValue

Definition at line 1366 of file lmer.c.

References Alloca, cvg_POS, DEV_SLOT, DIMS_SLOT, FIXEF_SLOT, lme4_STSym, lmm_update_fixef_u(), mer_update_dev(), ML_POS, MUETA_SLOT, nf_POS, np_POS, p_POS, ST_getPars(), ST_setPars(), update_L(), update_RX(), update_u(), and V_SLOT.

Here is the call graph for this function:

SEXP mer_postVar ( SEXP  x  ) 

Extract the conditional variances of the random effects in an mer object.

Some people called these posterior variances, hence the name.

Parameters:
x pointer to an mer object
Returns:
pointer to a list of arrays

Definition at line 1434 of file lmer.c.

References Alloca, c, DEV_SLOT, DIMS_SLOT, Gp_SLOT, isREML_POS, L_SLOT, lme4_STSym, nf_POS, q_POS, sigmaML_POS, sigmaREML_POS, ST_nc_nlev(), and useSc_POS.

Here is the call graph for this function:

SEXP mer_ST_chol ( SEXP  x  ) 

Return a list of (upper) Cholesky factors from the ST list.

Parameters:
x an mer object
Returns:
a list of upper Cholesky factors

Definition at line 1495 of file lmer.c.

References Alloca, DIMS_SLOT, Gp_SLOT, lme4_STSym, nf_POS, and ST_nc_nlev().

Here is the call graph for this function:

SEXP mer_ST_getPars ( SEXP  x  ) 

Extract the parameters from the ST slot of an mer object.

Parameters:
x an mer object
Returns:
pointer to a REAL vector

Definition at line 1530 of file lmer.c.

References DIMS_SLOT, np_POS, and ST_getPars().

Here is the call graph for this function:

SEXP mer_ST_initialize ( SEXP  ST,
SEXP  Gpp,
SEXP  Zt 
)

Evaluate starting estimates for the elements of ST.

Parameters:
ST pointers to the nf ST factorizations of the diagonal elements of Sigma
Gpp length nf+1 vector of group pointers for the rows of Zt
Zt transpose of Z matrix

Definition at line 1548 of file lmer.c.

References Alloca, AZERO, lme4_DimSym, lme4_iSym, lme4_pSym, lme4_xSym, and ST_nc_nlev().

Here is the call graph for this function:

SEXP mer_ST_setPars ( SEXP  x,
SEXP  pars 
)

Update the ST slot of an mer object from a REAL vector of parameters and update the sparse model matrix A.

Parameters:
x an mer object
pars a REAL vector of the appropriate length
Returns:
R_NilValue

Definition at line 1584 of file lmer.c.

References _, DIMS_SLOT, np_POS, and ST_setPars().

Here is the call graph for this function:

SEXP mer_update_dev ( SEXP  x  ) 

Evaluate the discrepancy and log of the penalized discrepancy.

update_mu must be called first.

Parameters:
x pointer to an mer object

Definition at line 1601 of file lmer.c.

References DEV_SLOT, DIMS_SLOT, disc_POS, ldL2_POS, lme4_devResid(), ML_POS, MU_SLOT, MUETA_SLOT, n_POS, nAGQ_POS, PWT_SLOT, usqr_POS, vTyp_POS, wrss_POS, and Y_SLOT.

Referenced by mer_optimize().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP mer_update_L ( SEXP  x  ) 

Externally callable update_L.

Update the A, L, sqrtrWt and resid slots. It is assumed that update_mu has already been called at the current values of u and the model parameters.

Parameters:
x an mer object
Returns:
penalized weighted residual sum of squares

Definition at line 1637 of file lmer.c.

References update_L().

Here is the call graph for this function:

SEXP mer_update_mu ( SEXP  x  ) 

Externally callable update_mu.

Update the eta, v, mu, resid and var slots according to the current values of the parameters and u. Also evaluate d[wrss_POS] using the current contents of sqrtrWt. The sqrtrWt slot is updated in update_L.

Parameters:
x pointer to an mer object
Returns:
penalized, weighted residual sum of squares

Definition at line 1652 of file lmer.c.

References update_mu().

Here is the call graph for this function:

SEXP mer_update_projection ( SEXP  x  ) 

Externally callable lmm_update_projection.

Create the projections onto the column spaces of the random effects and the fixed effects.

Parameters:
x an mer object
Returns:
a list with two elements, both REAL vectors

Definition at line 1682 of file lmer.c.

References DIMS_SLOT, lmm_update_projection(), p_POS, and q_POS.

Here is the call graph for this function:

SEXP mer_update_ranef ( SEXP  x  ) 

Externally callable update_ranef.

Update the contents of the ranef slot in an mer object. For a linear mixed model the conditional estimates of the fixed effects and the conditional mode of u are evaluated first.

Parameters:
x an mer object
Returns:
R_NilValue

Definition at line 1706 of file lmer.c.

References update_ranef().

Here is the call graph for this function:

SEXP mer_update_RX ( SEXP  x  ) 

Externally callable update_RX.

Parameters:
x pointer to an mer object
Returns:
profiled deviance or REML deviance

Definition at line 1720 of file lmer.c.

References update_RX().

Here is the call graph for this function:

SEXP mer_update_u ( SEXP  x,
SEXP  verbP 
)

Externally callable update_u.

Iterate to determine the conditional modes of the random effects.

Parameters:
x pointer to an mer object
verbP scalar integer indicator of verbose output (negative values produce a lot of output)
Returns:
number of iterations to convergence (0 for non-convergence)

Definition at line 1668 of file lmer.c.

References update_u().

Here is the call graph for this function:

SEXP mer_validate ( SEXP  x  ) 

Check validity of an mer object.

Parameters:
x Pointer to an mer object
Returns:
TRUE if the object is a valid mer object, otherwise a string that describes the violation.

Definition at line 1771 of file lmer.c.

References _, A_SLOT, Alloca, BUF_SIZE, chkDims(), chkLen(), cvg_POS, L_SLOT, lme4_devianceSym, lme4_dimsSym, lme4_etaSym, lme4_fixefSym, lme4_flistSym, lme4_GpSym, lme4_muEtaSym, lme4_muSym, lme4_offsetSym, lme4_pWtSym, lme4_ranefSym, lme4_residSym, lme4_RXSym, lme4_RZXSym, lme4_sqrtrWtSym, lme4_STSym, lme4_uSym, lme4_varSym, lme4_VSym, lme4_XSym, lme4_ySym, n_POS, nf_POS, p_POS, q_POS, s_POS, wrss_POS, and Zt_SLOT.

Here is the call graph for this function:

SEXP merMCMC_validate ( SEXP  x  ) 

Check validity of an merMCMC object.

Parameters:
x Pointer to an merMCMC object
Returns:
TRUE if the object is a valid merMCMC object, otherwise a string that describes the violation.

Definition at line 1862 of file lmer.c.

References _, Alloca, BUF_SIZE, chkDims(), chkLen(), cvg_POS, lme4_devianceSym, lme4_dimsSym, lme4_fixefSym, lme4_GpSym, lme4_ncSym, lme4_ranefSym, lme4_sigmaSym, lme4_STSym, nf_POS, np_POS, p_POS, q_POS, and useSc_POS.

Here is the call graph for this function:

SEXP merMCMC_VarCorr ( SEXP  x,
SEXP  typ 
)

Definition at line 1725 of file lmer.c.

References _, Alloca, Gp_SLOT, lme4_sigmaSym, lme4_STSym, and SLOT_REAL_NULL().

Here is the call graph for this function:

SEXP spR_optimize ( SEXP  x,
SEXP  verbP 
)

Optimize the log-likelihood for the sparse representation of a Rasch model.

Parameters:
x pointer to a sparseRasch object
verbP pointer to indicator of verbose output
Returns:
R_NilValue

Definition at line 1944 of file lmer.c.

References _, apply_perm(), c, CM_MAXITER, CM_SMIN, CM_TOL, DEV_SLOT, FIXEF_SLOT, L_SLOT, MU_SLOT, MUETA_SLOT, PWT_SLOT, RESID_SLOT, spR_update_mu(), sqr_length(), SRWT_SLOT, VAR_SLOT, wrss_POS, Y_SLOT, and Zt_SLOT.

Here is the call graph for this function:

SEXP spR_update_mu ( SEXP  x  ) 

Update the eta, mu, resid and var slots in a sparseRasch object from the current values of the model parameters in the beta slot.

Parameters:
x pointer to an sparseRasch object
Returns:
R_NilValue

Definition at line 1905 of file lmer.c.

References _, c, DEV_SLOT, DIMS_SLOT, lme4_fixefSym, lme4_muEta(), lme4_varFunc(), lTyp_POS, MU_SLOT, MUETA_SLOT, n_POS, OFFSET_SLOT, RESID_SLOT, SRWT_SLOT, VAR_SLOT, vTyp_POS, wrss_POS, Y_SLOT, and Zt_SLOT.

Referenced by spR_optimize().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Jul 9 15:07:57 2008 for lme4 by  doxygen 1.4.7