mdbeta {sdPrior} | R Documentation |
\beta
This function computes the marginal density of \beta
and for \beta
on an equidistant grid specified by the user.
Currently only implemented for dim(\beta)=1,2
.
mdbeta(D = 1, rangebeta, ngridbeta, a = 5, b = 25, r = 0.00025,
a0 = 0.5, b0 = 0.5, plot = FALSE, log = FALSE)
D |
dimension of |
rangebeta |
a vector containing the start and ending point of |
ngridbeta |
the number of grid values. |
a |
shape parameter of inverse gamma prior of |
b |
scale parameter of inverse gamma prior of |
r |
the scaling parameter |
a0 |
shape parameter of beta prior of |
b0 |
scale parameter of beta prior of |
plot |
logical value (default is |
log |
logical value (default is |
the marginal density, the sequence of \beta
and depending on specified plot
, log
arguments also the log-density and plot functions.
Nadja Klein
Nadja Klein, Thomas Kneib, Stefan Lang and Helga Wagner (2016). Spike and Slab Priors for Effect Selection in Distributional Regression. Working Paper.
set.seed(123)
#1-dimensional example
D = 1
ngridbeta = 1000
rangebeta = c(0.000001,1)
a0 = b0 = 0.5
a = 5
b = 50
r = 0.005
mdf <- mdbeta(D=1,rangebeta,ngridbeta,a=a,b=b,r=r,a0=a0,b0=b0)
#2-dimensional example
D = 2
ngridbeta = 100
rangebeta = c(0.000001,8)
a0 = b0 = 0.5
a = 5
b = 50
r = 0.005
mdf <- mdbeta(D=2,rangebeta,ngridbeta,a=a,b=b,r=r,a0=a0,b0=b0,plot=TRUE,log=TRUE)
mdf$logpl()