cv_mb {mbr} | R Documentation |
Cross-validation
Description
Cross-validation
Usage
cv_mb(
instQ,
pc.list,
cv.folds,
start.year,
lambda = 1,
log.trans = NULL,
force.standardize = FALSE,
return.type = c("fval", "metrics", "metric means", "Q")
)
Arguments
instQ |
Instrumental data, in the same order as pc.list. The "season" column must be a factor. |
pc.list |
List of PC matrices |
cv.folds |
A list containing the cross validation folds |
start.year |
The first year of record |
lambda |
The penalty weight |
log.trans |
A vector containing indices of the targets to be log-transformed. If no transformation is needed, provide |
force.standardize |
If TRUE, all observations are standardized. See Details. |
return.type |
The type of results to be returned. Several types are possible to suit multiple use cases.
|
Value
A data.table
containing cross-validation results (metrics, fval, or metric means) for each target.
Examples
cvFolds <- make_Z(1922:2003, nRuns = 50, frac = 0.25, contiguous = TRUE)
cv <- cv_mb(p1Seasonal, pc3seasons, cvFolds, 1750, log.trans = 1:3, return.type = 'metrics')