crossv_GeDS: k-fold cross-validation

View source: R/cv_GeDSMethod.R

crossv_GeDSR Documentation

k-fold cross-validation

Description

crossv_GeDS implements k-fold cross-validation for the relevant parameters of NGeDS, GGeDS, NGeDSgam and NGeDSboost

Arguments

formula

a description of the structure of the model to be fitted, including the dependent and independent variables.

data

a data frame containing the variables referenced in the formula.

model_fun

the GeDS model to be fitted, that is, NGeDS, GGeDS, NGeDSgam or NGeDSboost.

parameters

to cross-validate. beta, phi and q in the case of NGeDS, GGeDS and NGeDSgam. In addition, for NGeDSboost, int.knots_init, shrinkage can also be tuned. Default values are int.knots_init_grid = c(0, 1, 2), shrinkage_grid = c(0.1, 0.5, 1), beta_grid = c(0.3, 0.5, 0.7), phi_grid = c(0.9, 0.95, 0.99), q_grid = c(2, 3)).

Value

Two data frames, best_params and results. best_params contains the best combination of parameters according to the cross-validated MSE. results presents the results for each of the possible combinations of parameters, given the input paramters.


alattuada/GeDS documentation built on April 26, 2024, 11:36 a.m.