#include "ssclme.h"
Defines | |
#define | slot_dup(dest, src, sym) SET_SLOT(dest, sym, duplicate(GET_SLOT(src, sym))) |
Functions | |
void | ssclme_copy_ctab (int nf, const int nc[], SEXP ctab, SEXP ssc) |
void | ssclme_calc_maxod (int n, int Parent[]) |
SEXP | ssclme_create (SEXP facs, SEXP ncv) |
void | bVj_to_A (int ncj, int Gpj, int Gpjp, const double bVj[], const int Ap[], const int Ai[], double Ax[]) |
SEXP | ssclme_transfer_dimnames (SEXP x, SEXP facs, SEXP mmats) |
SEXP | ssclme_update_mm (SEXP x, SEXP facs, SEXP mmats) |
SEXP | ssclme_inflate_and_factor (SEXP x) |
SEXP | ssclme_factor (SEXP x) |
int | ldl_update_ind (int probe, int start, const int ind[]) |
SEXP | ldl_inverse (SEXP x) |
SEXP | ssclme_invert (SEXP x) |
SEXP | ssclme_initial (SEXP x) |
SEXP | ssclme_fixef (SEXP x) |
SEXP | ssclme_ranef (SEXP x) |
SEXP | ssclme_sigma (SEXP x, SEXP REML) |
int | coef_length (int nf, const int nc[]) |
SEXP | ssclme_coef (SEXP x) |
SEXP | ssclme_coefUnc (SEXP x) |
SEXP | ssclme_coefGetsUnc (SEXP x, SEXP coef) |
SEXP | ssclme_coefGets (SEXP x, SEXP coef) |
SEXP | ssclme_EMsteps (SEXP x, SEXP nsteps, SEXP REMLp, SEXP verb) |
SEXP | ssclme_gradient (SEXP x, SEXP REMLp, SEXP Uncp) |
SEXP | ssclme_fitted (SEXP x, SEXP facs, SEXP mmats, SEXP useRf) |
SEXP | ssclme_variances (SEXP x) |
SEXP | ssclme_collapse (SEXP x) |
SEXP | ssclme_to_lme (SEXP call, SEXP facs, SEXP x, SEXP model, SEXP REML, SEXP rep, SEXP fitted, SEXP residuals) |
|
|
|
Copy information on Z'Z accumulated in the bVar array to Z'Z
|
|
Calculate the length of the parameter vector, which is called coef for historical reasons.
|
|
Update the diagonal blocks of the inverse of LDL' (=Z'Z+W). The lower Cholesky factors of the updated blocks are stored in the bVar slot.
|
|
Return the position of probe in the sorted index vector ind. It is known that the position is greater than or equal to start so a linear search from start is used.
|
|
Calculate and store the maximum number of off-diagonal elements in the inverse of L, based on the elimination tree. The maximum is itself stored in the Parent array. (FIXME: come up with a better design.)
|
|
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.)
|
|
Assign the Omega matrices from the unconstrained parameterization.
|
|
Extract the unconstrained parameters that determine the Omega matrices. (Called coef for historical reasons.) The unconstrained parameters are derived from the LDL' decomposition of Omega_i. The first nc[i] entries in each group are the diagonals of log(D) followed by the strict lower triangle of L in column order.
|
|
Copy an ssclme object collapsing the fixed effects slots to the response only.
|
|
Using the sscCrosstab object from the grouping factors, generate the slots in an ssclme object related to the symmetric sparse matrix representation of Z'Z. If the model matrices for the grouping factors have only one column each then the structure can be copied, otherwise it must be generated from the sscCrosstab and the number of columns per grouping factor.
|
|
Create an ssclme object from a list of grouping factors, sorted in order of non-increasing numbers of levels, and an integer vector of the number of columns in the model matrices. There is one more element in ncv than in facs. The last element is the number of columns in the model matrix for the fixed effects plus the response. (i.e. p+1)
|
|
Perform a number of ECME steps for the REML or ML criterion.
|
|
If status[["factored"]] is FALSE, create and factor Z'Z+Omega, then create RZX and RXX, the deviance components, and the value of the deviance for both ML and REML.
|
|
Calculate and return the fitted values.
|
|
Extract the conditional estimates of the fixed effects
|
|
Return the gradient of the ML or REML deviance.
|
|
Inflate Z'Z according to Omega and create the factorization LDL'
|
|
Create and insert initial values for Omega_i.
|
|
If necessary, factor Z'Z+Omega, ZtX, and XtX then, if necessary, form RZX, RXX, and bVar for the inverse of the Cholesky factor.
|
|
Extract the conditional modes of the random effects.
|
|
Extract the ML or REML conditional estimate of sigma
|
|
Create an lme object from its components. This is not done by new("lme", ...) at the R level because of the possibility of causing the copying of very large objects.
|
|
Copy the dimnames from the list of grouping factors and the model matrices for the grouping factors into the appropriate parts of the ssclme object.
|
|
Update the numerical entries x, ZtX, and XtX in an ssclme object according to a set of model matrices.
|
|
Return the unscaled variances
|