Liso Crossvalidation

Share:

Description

Applies crossvalidation to Liso

Usage

1
2
cv.liso(x, y, K = 10, lambda = NULL, trace = FALSE, plot.it = FALSE, se = TRUE, weights = rep(1, length(y)), weightedcv = FALSE, huber = Inf, covweights = rep(1, ncol(x)), gridsize = 50, gridmin = 0.01, ...)
plotCV(cv.object, se=TRUE, ...)

Arguments

For cv.liso:

x

Design matrix (without intercept).

y

Response value.

K

Number of CV folds.

lambda

Values of the penalty parameter lambda to be tried. For speed, it's advised that a decreasing vector be used. If NULL, a log grid used, using liso.maxlamb to calculate the maximum.

trace

If TRUE, print diagnostic information as calculation is done.

plot.it

If TRUE, plot a graph of CV error against lambda with plotCV.

weights

Observation weights. Should be a vector of length equal to the number of observations.

weightedcv

If TRUE, use observation weights when averaging CV error across folds.

huber

If less than Inf, huberisation parameter for huberised liso. (Experimental)

covweights

Covariate weights. Should be a vector of length equal to the number of covariates.

gridsize

Size of logarithmic grid of lambda values, if lambda is unspecified.

gridmin

Minimum of logarithmic grid of lambda values, if lambda is unspecified. Considered as a proportion of the maximum value of lambda.

For plotCV:

cv.object

Object to be plotted.

For both:

se

If TRUE, add error bars to CV plot.

...

Additional arguments to be passed to liso.backfit or plot

Value

cv.liso creates a list of 5 components:

lambda

Lambda values used.

cv

Mean or weighted mean CV for each lambda.

cv.error

Sqrt of MLE estimated variance of CV for each lambda.

residmat

Full length(lambda) x K matrix of CV errors.

optimlam

Lambda value that minimises CV error

Author(s)

Zhou Fang

References

Zhou Fang and Nicolai Meinshausen (2009), Liso for High Dimensional Additive Isotonic Regression, available at http://blah.com

See Also

liso.backfit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Use the method on a simulated data set

set.seed(79)
n <- 100; p <- 50

## Simulate design matrix and response
x <- matrix(runif(n * p, min = -2.5, max = 2.5), nrow = n, ncol = p)
y <- scale(3 * (x[,1]> 0), scale=FALSE)  + x[,2]^3 + rnorm(n)

## Do CV
CVobj <- cv.liso(x,y, K=10, plot.it=TRUE)

## Do the actual fit
fitobj <- liso.backfit(x,y,CVobj$optimlam)
plot(fitobj)