Description Usage Arguments Details Value Author(s) References Examples
The function SBLassoRlog (R-log-Safe-Bayesian Lasso) provides a Gibbs sampler together with the R-log-Safe-Bayesian algorithm for Bayesian lasso regression models.
1 2 | SBLassoRlog(y, X = NULL, etaseq = 1, prior = NULL, nIter = 1100, burnIn = 100,
thin = 10, minAbsBeta = 1e-09, pIter = TRUE)
|
y |
Vector of outcome variables, numeric, NA allowed, length n. |
X |
Design matrix, numeric, dimension n x p, n >= 2. |
etaseq |
Vector of learning rates eta, numeric, 0 <= eta <= 1. Default 1. |
prior |
List containing the following elements
|
nIter |
Number of iterations, integer. Default 1100. |
burnIn |
Number of iterations for burn-in, integer. Default 100. |
thin |
Number of iterations for thinning, integer. Default 10. |
minAbsBeta |
Minimum absolute value of sampled coefficients beta to avoid numerical problems, numeric. Default 10^-9. |
pIter |
Print iterations, logical. Default TRUE. |
Details on the Safe-Bayesian lasso can be found in Chapter 2 of (de Heide, 2016). The implementation of the Gibbs sampler is based on the BLR package of (de los Campos et al., 2009).
The Safe-Bayesian algorithm was proposed by Grunwald (2012) as a method to learn the learning rate for the generalized posterior to deal with model misspecification.
$y |
Vector of original outcome variables. |
$mu |
Posterior mean of the intercept. |
$varE |
Posterior mean of of the variance. |
$yHat |
Posterior mean of mu + X*beta + epsilon. |
$SD.yHat |
Corresponding standard deviation. |
$whichNa |
Vector with indices of missing values of y. |
$fit$pD |
Estimated number of effective parameters. |
$fit$DIC |
Deviance Information Criterion. |
$lambda |
Posterior mean of lambda. |
$bL |
Posterior mean of beta. |
$SD.bL |
Corresponding standard deviation. |
$tau2 |
Posterior mean of tau^2. |
$prior |
List containing the priors used. |
$nIter |
Number of iterations. |
$burnIn |
Number of iterations for burn-in. |
$thin |
Number of iterations for thinning. |
$CMRlogEallen |
List of cumulative posterior-expected posterior-randomized log-loss per eta. |
$eta.min |
Learning rate eta minimizing the cumulative posterior-expected posterior-randomized log-loss. |
R. de Heide
de Heide, R. 2016. The Safe-Bayesian Lasso. Master Thesis, Leiden University.
de los Campos G., H. Naya, D. Gianola, J. Crossa, A. Legarra, E. Manfredi, K. Weigel and J. Cotes. 2009. Predicting Quantitative Traits with Regression Models for Dense Molecular Markers and Pedigree. Genetics 182: 375-385.
Grunwald, P.D. 2012. chapter The Safe Bayesian. Algorithmic Learning Theory: 23rd International Conference, ALT 2012, Lyon, France, October 29-31, 2012. Proceedings. 169-183. Springer Berlin Heidelberg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | rm(list=ls())
# Simulate data
x <- runif(10, -1, 1) # 10 random uniform x's between -1 and 1
y <- NULL
# for each x, an y that is 0 + Gaussian noise
for (i in 1:10) {
y[i] <- 0 + rnorm(1, mean=0, sd=1/4)
}
plot(x,y)
## Not run:
# Let R-log-SafeBayes learn the learning rate
sbobj <- SBLassoRlog(y, x, etaseq=c(1, 0.5, 0.25))
# eta
sbobj$eta.min
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.