Description Usage Arguments Details Value Author(s) References Examples
Calculates covariate weights for the Adaptive Liso
1 | liso.covweights(obj, signfind = FALSE)
|
obj |
Initial fit to use, a |
signfind |
If TRUE, conduct monotonicity detection procedure. |
This function calculates automatically weights for a second run of the Liso algorithm, in an adaptive liso scheme. See example for practical usage.
Produces a vector of covariate weights to be supplied as the covweight
argument in liso.backfit.
Zhou Fang
Zhou Fang and Nicolai Meinshausen (2009), Liso for High Dimensional Additive Isotonic Regression, available at http://blah.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## 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)
## Adaptive liso
initialfit = liso.backfit(x,y, 4)
secondfit = liso.backfit(x,y, 4, covweights = liso.covweights(initialfit))
## Compare sparsity
which(dim(initialfit) != 0)
which(dim(secondfit) != 0)
set.seed(79)
y2 <- scale(3 * (x[,1]> 0), scale=FALSE) + x[,2]^3-6*(abs(x[,2] - 1)< 0.1) + rnorm(n)
## Sign finding
initialfit = liso.backfit(x,y2, 2, monotone=FALSE)
secondfit = liso.backfit(x,y2, 2, monotone=FALSE, covweights = liso.covweights(initialfit, signfind=TRUE))
## Compare monotonicity. Note near x=1
plot(secondfit, dim=2)
plot(initialfit, dim=2, add=TRUE, col=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.