sdPrior (version 1.0-0)

mdbeta: Marginal Density of \(\beta\)

Description

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\).

Usage

mdbeta(D = 1, rangebeta, ngridbeta, a = 5, b = 25, r = 0.00025,
  a0 = 0.5, b0 = 0.5, plot = FALSE, log = FALSE)

Arguments

D

dimension of \(\beta\).

rangebeta

a vector containing the start and ending point of \(\beta\) to be computed for.

ngridbeta

the number of grid values.

a

shape parameter of inverse gamma prior of \(\psi^2\).

b

scale parameter of inverse gamma prior of \(\psi^2\).

r

the scaling parameter \(r(\delta=1)\) in the variance \(r(\delta)\psi^2\) of prior of \(\tau^2\).

a0

shape parameter of beta prior of \(\omega\).

b0

scale parameter of beta prior of \(\omega\).

plot

logical value (default is FALSE). If TRUE, a plot is also returned as the function pl().

log

logical value (default is FALSE). If TRUE, \(log(p(\beta))\) is also returned in logval. as well as, if necessary, a plot function logpl().

Value

the marginal density, the sequence of \(\beta\) and depending on specified plot, log arguments also the log-density and plot functions.

References

Nadja Klein, Thomas Kneib, Stefan Lang and Helga Wagner (2016). Spike and Slab Priors for Effect Selection in Distributional Regression. Working Paper.

Examples

Run this code
# NOT RUN {
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()

# }

Run the code above in your browser using DataLab