spcr | R Documentation |
This function computes a principal component regression model via sparse regularization.
spcr(x, y, k, lambda.B, lambda.gamma, w=0.1, xi=0.01, adaptive=FALSE, center=TRUE, scale=FALSE)
x |
A data matrix. |
y |
A response vector. |
k |
The number of principal components. |
lambda.B |
The regularization parameter for the parameter B. |
lambda.gamma |
The regularization parameter for the coefficient vector γ. |
w |
Weight parameter with 0≤ w ≤ 1. The default is 0.1. |
xi |
The elastic net mixing parameter with 0≤ α ≤ 1. The default is 0.01. |
adaptive |
If |
center |
If |
scale |
If |
loadings.B |
the loading matrix B |
gamma |
the coefficient |
gamma0 |
intercept |
loadings.A |
the loading matrix A |
Shuichi Kawano
skawano@ai.lab.uec.ac.jp
Kawano, S., Fujisawa, H., Takada, T. and Shiroishi, T. (2015). Sparse principal component regression with adaptive loading. Compuational Statistics & Data Analysis, 89, 192–203.
cv.spcr
#data n <- 100 np <- 5 set.seed(4) nu0 <- c(-1, 1) x <- matrix( rnorm(np*n), n, np ) e <- rnorm(n) y <- nu0[1]*x[ ,1] + nu0[2]*x[ ,2] + e #fit spcr.fit <- spcr(x=x, y=y, k=2, lambda.B=6, lambda.gamma=2) spcr.fit #fit (adaptive SPCR) adaspcr.fit <- spcr(x=x, y=y, k=2, lambda.B=6, lambda.gamma=2, adaptive=TRUE) adaspcr.fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.