liureg fits coefficients paths for Liu regression models
over a grid of values for the regularization (biasing)
parameter lambda. The returned object is of class liureg.
liureg(X, y, lambda = 1, scale = c("ulength", "unormal", "none"), ...)Fitted Liu regression object with the class of liureg
The design matrix of features. fastliu
standardizes the data and includes an intercept term by default.
The response vector.
User-specified values of lambda. The default
value is 1, which corresponds to the least squares estimator.
A lambda sequence can be entered to generate multiple models.
Scaling type of the design matrix. "ulength" corresponds
to unit-length scaling. In this scaling the scaled design matrix is
in the form of a correlation matrix. "unormal" scales the features
to have unit variance (using \(1/n\) rather than \(1/(n-1)\) formula). "none"
does not make scaling and computations are done on centered features.
Not used in this implementation.
Murat Genç and Ömer Özbilen
The sequence of Liu regression models indexed by the tuning parameter. \(\lambda\) are obtained by $$\hat{\boldsymbol{\beta}}^{liu}\left(\lambda\right)= \left(\mathbf{X}^{T}\mathbf{X}+\mathbf{I}_{p}\right)^{-1} \left(\mathbf{X}^{T}\mathbf{y}+\lambda\hat{\boldsymbol{\beta}}^{ls}\right),$$ where \(\hat{\boldsymbol{\beta}}^{ls}\) is the ordinary least squares estimator.To obtain the models, the singular value decomposition (SVD) of the matrix \(\mathbf{X}\) is used. This SVD is done once and is used to generate all models.
Explanatory variables in the design matrix are always centered
before fitting a model in the fastliu package.
For scaling, two options are possible:
unit-length and unit-normal scaling. In unit-length scaling,
the matrix of explanatory variables has correlation form.
In unit-normal scaling, the explanatory variables have zero
mean and unit variance.
Both Coefficient estimates based on the scaled data and
in original scale are presented.
The intercept of the model is not penalized and computed by
\(\bar{y}-\bar{X}\boldsymbol{\hat{\beta}}_1\), where \(\bar{X}\)
is the row vector of the explanatory variables and \(\boldsymbol{\hat{\beta}}_1\)
is computed based on centered design matrix.
The returned liureg object
is used for statistical testing of Liu coefficients,
plotting method and computing the Liu regression related statistics.
coef(), predict(), summary(), pressliu(), residuals()
data("Hitters")
Hitters <- na.omit(Hitters)
X <- model.matrix(Salary ~ ., Hitters)[, -1]
y <- Hitters$Salary
lam <- seq(0, 1, 0.05)
liu.mod <- liureg(X, y, lam)
Run the code above in your browser using DataLab