Description Usage Arguments Value Examples
View source: R/FunctionsALasso.R
Standardizes the input design matrix X and output vector Y to mean 0 and scales X
1 | standardize(X, Y, gamma)
|
X |
n x p design matrix of inputs |
Y |
n x 1 vector of outputs |
gamma |
a scalar(>0) input used in the weight(user input) |
Xstd |
scaled X |
Ystd |
scaled Y |
meanY |
mean of Y |
meanX |
Column means after centering the weighted X matrix from scale_X |
weights |
weights obtained by centering X_w which is obtained from scale X |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | X <- matrix(rnorm(500), 50, 10)
Y <- rnorm(50)
gamma <- 2
#Standardizing X and Y
std <- standardize(X , Y , gamma)
#Deriving weighted and centered design matrix
Xstd <- std$Xstd
#Column means of centered X_w
meanX <- std$meanX
#Deriving centered Y
Ystd <- std$Ystd
#Mean of Ystd
meanY <- std$meanY
# Weights
weights <- std$weights
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.