Learn R Programming

multivar (version 1.1.0)

cv.multivar: Cross Validation for multivar

Description

Cross Validation for multivar

Usage

cv.multivar(object)

Arguments

object

multivar object built using ConstructModel.

Value

An object of class multivar.results.

Details

The main function of the multivar package. Performs cross validation to select penalty parameters over a training sample and evaluates them over a test set.

Examples

Run this code
# NOT RUN {
# example 1 (run)
sim1  <- multivar_sim(
  k = 2,  # individuals
  d = 5,  # number of variables
  n = 20, # number of timepoints
  prop_fill_com = 0.1, # proportion of paths common
  prop_fill_ind = 0.05, # proportion of paths unique
  lb = 0.1,  # lower bound on coefficient magnitude
  ub = 0.5,  # upper bound on coefficient magnitude
  sigma = diag(5) # noise
)

model1 <- constructModel(data = sim1$data)
fit1 <- multivar::cv.multivar(model1)


# }

Run the code above in your browser using DataLab