PLMM prep: a function to run checks, eigendecomposition, and rotation prior to fitting a PLMM model
Source:R/plmm_prep.R
plmm_prep.RdThis is an internal function for plmm()
Usage
plmm_prep(
std_X,
std_X_n,
std_X_p,
centered_y,
penalty_factor,
K = NULL,
eta = NULL,
fbm_flag,
trace = NULL,
...
)Arguments
- std_X
Column standardized design matrix. May include clinical covariates and other non-SNP data.
- std_X_n
The number of observations in
std_X(integer)- std_X_p
The number of features in
std_X(integer)- centered_y
Continuous outcome vector, centered.
- penalty_factor
A multiplicative factor for the penalty applied to each coefficient.
- K
Similarity matrix used to rotate the data. This should either be: (1) a known matrix that reflects the covariance of y, (2) an estimate (Default is \(\frac{1}{p}(XX^T)\)), or (3) a list with components
sandU, as returned by a previousplmm()model fit on the same data.- eta
Optional argument to input a specific eta term rather than estimate it from the data. If K is a known covariance matrix that is full rank, this should be 1.
- fbm_flag
Logical: is
std_Xa filebackedbig.matrixobject? This is set internally byplmm().- trace
If set to TRUE, inform the user of progress by announcing the beginning of each step of the modeling process. Default is FALSE.
- ...
Not used
Value
List with these components:
std_X: Standardized design matrix. If design matrix is filebacked, the descriptor for the filebacked data is returned usingbigmemory::describe().centered_y: Vector of centered outcomesK: Similarity matrixs: Vector of the non-zero eigenvalues ofKU: Matrix of eigenvectors ofKassociated withs(same as left singular values of X).eta: The numeric value of the estimated eta parameterpenalty_factorA multiplicative factor for the penalty applied to each coefficient.incpt_flagLogical: Does the model require fitting an intercept?trace: If set to TRUE, inform the user of progress by announcing the beginning of each step of the modeling process