Description Usage Arguments Examples
Find the optimal regularization parameter according to a fit criterion
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, ...)
|
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 |
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.