random.CV: Select Tuning Parameter for Regularized Covariance Matrix by...

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

Apply a random cross-validation (CV) to select tuning parameters for regualrized covariance matrix with banding, tapering, soft-thresholding or hard-thresholding method under the Frobenius norm or the operator norm. The random CV randomly splits the data set to two parts, a training set and a validation set with user-specifed sizes, and repeats the process for multiple times.

Usage

1
2
random.CV(X, k.grid = 0.5, method = "Tapering", test.size = 5, norm = "F", 
boot.num = 50, seed = 10323)

Arguments

X

input data matrix with dimension n*p. n indicates the sample size and p indicates the dimension of the corresponding random vector.

k.grid

the default value is 0.5.

method

the regularized method, which can be "Banding", "Tapering", "HardThresholding" or "SoftThresholding". the default value is "Tapering".

test.size

the size of the validation set, which should be < n.

norm

the norms which can be used to measure the estimation accuracy, which can be the Frobenius norm "F" or the operator norm "L2".

boot.num

the number of random split. The default value is 50.

seed

the default value is 10323.

Value

A list including elements:

CV.k

the optimal tuning parameter selected by the random CV.

k.grid

the vector of tuning parameters

CV.pre.error

a vector denoting predicting errors by random CV at each element of tuning parameters based on the selected norm.

Author(s)

Binhuan Wang

Examples

1
2
3
4
5
6
7
8
9
library(MASS);
n <- 50;
p <- 50;
fold <- 3;
k.grid <- seq(0,2*(p-1),by=1);
Sigma <- AR1(p, rho=0.6);
X <- mvrnorm(n,rep(0,p),Sigma);
CV.F.fit <- random.CV(X,k.grid, method='Tapering',test.size = 10,norm='F');
CV.F.fit$CV.k;

CVTuningCov documentation built on May 29, 2017, 9:07 p.m.