Skip to contents

Compute profile-likelihood curves and confidence intervals for random-effects variance parameters by fixing one variance parameter at a time and re-optimizing all remaining parameters.

Usage

profile_random_effects(
  model,
  tau_indices = NULL,
  level = 0.95,
  n_points = 21,
  span = 3,
  grid = NULL,
  optim_method = "L-BFGS-B",
  control = list(factr = 1e+07, maxit = 400)
)

Arguments

model

A fitted mars model object (non-LASSO).

tau_indices

Optional indices (1-based) of random-effects parameters to profile. Defaults to all random-effects parameters.

level

Confidence level for profile-likelihood intervals. Default 0.95.

n_points

Number of grid points used per profiled parameter. Default 21.

span

Multiplicative span around the MLE for automatic grids. Default 3.

grid

Optional custom grid specification:

  • numeric vector: reused for each parameter

  • list of numeric vectors with one entry per profiled parameter.

optim_method

Optimization method passed to optim(). Default "L-BFGS-B".

control

Control list passed to optim() for each conditional fit.

Value

A list containing per-parameter profile grids and profile-likelihood CIs.

Examples

if (FALSE) { # \dontrun{
fit <- mars(
  data = teacher_expectancy,
  studyID = "study",
  effectID = NULL,
  sample_size = NULL,
  formula = yi ~ 1,
  variance = "vi",
  varcov_type = "univariate",
  structure = "univariate"
)
profile_random_effects(fit, n_points = 7)
} # }