cv_lspath: Compute cross validation error

Description Usage Arguments Details Functions See Also

View source: R/utility_functions.R

Description

functions used to calculate cross validation error and used by the cv.shim function

Usage

1
2
3
4
5
6
7
cv_lspath(outlist, x, y, foldid, nlambda, nlambda.beta, nlambda.gamma)

cvcompute(mat, foldid, nlams)

getmin_type(lambda, cvm, cvsd, type)

lambda.interp(lambda, s)

Arguments

outlist

list of cross validated fitted models. List is of length equal to nfolds argument in cv.shim function

x

Design matrix of dimension n x q, where n is the number of subjects and q is the total number of variables; each row is an observation vector. This must include all main effects and interactions as well, with column names corresponding to the names of the main effects (e.g. x1, x2, E) and their interactions (e.g. x1:E, x2:E). All columns should be scaled to have mean 0 and variance 1; this is done internally by the shim function.

y

response variable (matrix form) of dimension n x 1

foldid

numeric vector indicating which fold each observation belongs to

nlambda

total number of tuning parameter pairs. This includes those pairs of tuning parameters that didn't converge in the CV folds.

nlambda.beta

number of tuning paramters for the main effect

nlambda.gamma

number of tuning parameters for the interaction effects

type

should be one of "beta" or "gamma"

outlist

list containing results from cv.shim function. each element of the list is a run of shim_multiple_faster for each CV fold

Details

The output of the cv_lspath function only returns values for those tuning paramters that DID converge

Functions

See Also

cv.shim


sahirbhatnagar/shim documentation built on May 25, 2017, 11:36 p.m.