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
)

Arguments

caseAnnotation

Numeric vector or matrix of annotation scores for cases

controlAnnotation

Numeric matrix of annotation scores for controls

modelType

Character string specifying model type: "LASSO" or "GLM"

control_need_N

Integer, number of control samples to use per model

model_need_N

Integer, number of models to generate

Value

A list of fitted model objects (length = model_need_N)

Details

This function creates an ensemble of PI models by:

  1. Repeatedly sampling different subsets of control data

  2. Fitting a model (LASSO or GLM) to each sampled dataset

  3. 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.

Computational Complexity

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

Assumptions

  • modelType is either "LASSO" or "GLM"

  • control_need_N <= nrow(controlAnnotation)

  • caseAnnotation and controlAnnotation have compatible dimensions

Examples

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
} # }