Learn R Programming

SafeBayes (version 1.1)

metropLambda: Metropolis-Hastings algorithm to sample lambda with a Beta prior for the Bayesian Lasso

Description

Metropolis-Hastings algorithm to sample lambda with a Beta prior from (de los Campos et al., 2009) for the Bayesian Lasso regression model.

Usage

metropLambda(tau2, lambda, shape1 = 1.2, shape2 = 1.2, max = 200, ncp = 0)

Arguments

tau2
Latent parameter tau-squared to form the Laplace prior on the coefficients of the Lasso from a normal-mixture.
lambda
Initial value for lambda.
shape1
First shape parameter for the Beta distribution.
shape2
Second shape parameter for the Beta distribution.
max
Maximum value of lambda.
ncp
Dummy parameter.

Value

Returns a value for lambda to use in the Gibbs samplers of the functions in the SafeBayes package.

Details

Metropolis-Hastings algorithm to sample lambda with a Beta prior from (de los Campos et al., 2009) for the Bayesian Lasso regression model.

References

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.

Examples

Run this code
rm(list=ls())
library(SafeBayes)
tau2 <- 1/4
lambda <- 50

metropLambda(tau2=tau2, lambda=lambda)

Run the code above in your browser using DataLab