- data
data.frame of the dataset to be used.
- latent_var
list of data.frame. The elements of the list are the datasets used to construct each latent variable. For interpretability and proper convergence, not using the same variable in more than one latent variable is highly recommended. It is recommended to set names to the list elements to prevent confusion because otherwise, the latent variables will be named L1, L2, ...
- formula
Model formula. The names of latent_var
can be used in the formula to represent the latent variables. If names(latent_var
) is NULL, then L1, L2, ... can be used in the formula to represent the latent variables. Do not manually code interactions, write them in the formula instead (ex: G*E1*E2 or G:E1:E2).
- cv_iter
Number of cross-validation iterations (Default = 5).
- cv_folds
Number of cross-validation folds (Default = 10). Using cv_folds=NROW(data)
will lead to leave-one-out cross-validation.
- folds
Optional list of vectors containing the fold number for each observation. Bypass cv_iter and cv_folds. Setting your own folds could be important for certain data types like time series or longitudinal data.
- Huber_p
Parameter controlling the Huber cross-validation error (Default = 1.345).
- classification
Set to TRUE if you are doing classification (binary outcome).
- start_latent_var
Optional list of starting points for each latent variable (The list must have the same length as the number of latent variables and each element of the list must have the same length as the number of variables of the corresponding latent variable).
- eps
Threshold for convergence (.01 for quick batch simulations, .0001 for accurate results).
- maxiter
Maximum number of iterations.
- family
Outcome distribution and link function (Default = gaussian).
- ylim
Optional vector containing the known min and max of the outcome variable. Even if your outcome is known to be in [a,b], if you assume a Gaussian distribution, predict() could return values outside this range. This parameter ensures that this never happens. This is not necessary with a distribution that already assumes the proper range (ex: [0,1] with binomial distribution).
- seed
Seed for cross-validation folds.
- id
Optional id of observations, can be a vector or data.frame (only used when returning list of possible outliers).
- test_only
If TRUE, only uses the first fold for training and predict the others folds; do not train on the other folds. So instead of cross-validation, this gives you train/test and you get the test R-squared as output.