Generates multiple variant-importance score (PI) prediction models by repeatedly sampling control data and fitting models. This ensemble approach can improve prediction stability and account for variability in control sampling.
model_PI(
caseAnnotation,
controlAnnotation,
modelType,
control_need_N,
model_need_N
)Numeric vector or matrix of annotation scores for cases
Numeric matrix of annotation scores for controls
Character string specifying model type: "LASSO" or "GLM"
Integer, number of control samples to use per model
Integer, number of models to generate
A list of fitted model objects (length = model_need_N)
This function creates an ensemble of PI models by:
Repeatedly sampling different subsets of control data
Fitting a model (LASSO or GLM) to each sampled dataset
Returning all fitted models
The ensemble approach helps to:
Reduce dependence on specific control samples
Improve prediction robustness
Allow for uncertainty quantification via model averaging
For LASSO models, each model uses cross-validation to select lambda independently, which can lead to different levels of sparsity across models.
O(model_need_N * cost_per_model) where cost_per_model depends on modelType:
LASSO: O(n * p * k) for CV with k lambda values
GLM: O(n * p^2) for matrix inversion
modelType is either "LASSO" or "GLM"
control_need_N <= nrow(controlAnnotation)
caseAnnotation and controlAnnotation have compatible dimensions
if (FALSE) { # \dontrun{
# Simulate annotation data
set.seed(123)
case_anno <- matrix(runif(50 * 5), ncol = 5)
control_anno <- matrix(runif(1000 * 5), ncol = 5)
# Generate 10 LASSO models
models <- model_PI(
caseAnnotation = case_anno,
controlAnnotation = control_anno,
modelType = "LASSO",
control_need_N = 100,
model_need_N = 10
)
length(models) # Should be 10
} # }