| HDBRR | R Documentation |
Ridge regression provide biased estimators of the regression parameters with lower variance. The HDBRR ("High Dimensional Bayesian Ridge Regression") function fits Bayesian Ridge regression without MCMC, this one uses the SVD or QR decomposition for the posterior computation.
HDBRR(y, X, n0 = 5, p0 = 5, s20 = NULL, d20 = NULL, h = 0.5,
intercept = TRUE, vpapp = TRUE,npts = NULL,c = NULL,
corpred = NULL, method = c("svd","qr"),bigmat = TRUE, ncores = 2, svdx = NULL)
y |
The data vector (numeric, n) NAs allowed. |
X |
Design Matrix of dimension |
n0, p0 |
|
s20, d20 |
|
h |
(numeric, 0< |
intercept |
Logic value. The default value for the |
vpapp |
Logic value. Compute an approximation of the predictive variance. The default value for the |
npts |
Number (integer) of points used to evaluate the u's density for the numeric aprroach. The default value for the |
c |
ratio of Gaussian densities (Spike/Slab) in the prior mixture density of each Beta for variable selection. |
corpred |
The method for the compute of the correlation, there are two methods, Empirical Bayes ( |
method |
Options for the posterior computation. There are two methods available: |
bigmat |
Use of the bigstatsr package. The default value for |
ncores |
Number of the cores for computation. The default value for the ncores is 2, you can detect your number of cores with |
svdx |
It is possible to add the svd. The default value es NULL. |
Ridge regression is a useful tool to deal with collinearity in the homoscedastic linear regression model providing biased estimators of the regression parameters with lower variance than the least square estimators. The model
y = X\beta + \epsilon
where \epsilon vector is assumed Normal with mean vector 0 and covariance matrix \sigma^2 I_n. For further details see the vignettes in the package.
List containing the following components:
betahat |
Vector (numeric, |
yhat |
Vector (numeric, |
sdyhat |
Vector (numeric, |
sdpred |
Vector (numeric, |
varb |
Vector (numeric, |
sigsqhat |
Value (numeric) of the residual variance estimate. |
sigbsqhat |
Value (numeric) of the Beta's variance estimate. |
u |
Vector (numeric, |
postu |
Vector (numeric, |
uhat |
Value (numeric) of u estimated. |
umode |
Value (numeric) of the posterior mode of u. |
whichNa |
Value (integer) of NAs in the y vector. |
phat |
Vector (numeric, |
delta |
Used in the variable selection. |
edf |
Value (numeric) of the effective degrees of freedom for regression. |
corr |
Vector (numeric, |
svdx |
The svd decomposition. |
Sergio Perez-Elizalde, Blanca E. Monroy-Castillo, Paulino Perez-Rodriguez, Jose Crossa.
## Not run:
set.seed(123)
n <- 50
p <- 10
X <- matrix(rnorm(n * p), n, p)
y <- 1 + X[, 1] - 0.5 * X[, 2] + rnorm(n)
fitall <- HDBRR(y, X, intercept = TRUE, corpred = "eb", c = 100)
fitall
summary(fitall, crit = 0)
plot(fitall, crit = 0)
predict(fitall)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.