calcLambda: Estimate the regularization parameter

Description Usage Arguments Examples

Description

Find the optimal regularization parameter according to a fit criterion

Usage

1
2
3
4
5
6
calcLambda(x, ...)

## S3 method for class 'plvmfit'
calcLambda(x, seq_lambda1, data.fit = x$data$model.frame,
  data.test = x$data$model.frame, warmUp = lava.options()$calcLambda$warmUp,
  fit = lava.options()$calcLambda$fit, trace = TRUE, ...)

Arguments

x

a plvmfit object

...

additional arguments - e.g. control argument for estimate.lvm

seq_lambda1

the sequence of penalisation paramaters to be used to define the sub model

data.fit

the data used to fit the model

data.test

the data used to test the model

warmUp

should the new model be initialized with the solution of the previous model (i.e. estimated for a different penalization parameter)

fit

criterion to decide of the optimal model to retain among the penalized models.

trace

shoud the execution of the function be traced

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(10)
n <- 300
formula.lvm <- as.formula(paste0("Y~",paste(paste0("X",1:4), collapse = "+")))
mSim <- lvm(formula.lvm)
df.data <- sim(mSim,n)

lvm.model <- lvm(formula.lvm)
plvm.model <- penalize(lvm.model)

res <- estimate(plvm.model, data = df.data, increasing = FALSE, regularizationPath = TRUE)

perf <- calcLambda(res$regularizationPath, res$x, data.fit = df.data)
perf

bozenne/lava.penalty documentation built on May 13, 2019, 1:41 a.m.