mdbeta: Marginal Density of beta

Description Usage Arguments Value Author(s) References Examples

View source: R/mdbeta.r

Description

This function computes the marginal density of β and for β on an equidistant grid specified by the user. Currently only implemented for dim(β)=1,2.

Usage

1
2
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 β.

rangebeta

a vector containing the start and ending point of β to be computed for.

ngridbeta

the number of grid values.

a

shape parameter of inverse gamma prior of ψ^2.

b

scale parameter of inverse gamma prior of ψ^2.

r

the scaling parameter r(δ=1) in the variance r(δ)ψ^2 of prior of τ^2.

a0

shape parameter of beta prior of ω.

b0

scale parameter of beta prior of ω.

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(β)) is also returned in logval. as well as, if necessary, a plot function logpl().

Value

the marginal density, the sequence of β and depending on specified plot, log arguments also the log-density and plot functions.

Author(s)

Nadja Klein

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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()

sdPrior documentation built on May 2, 2019, 8:57 a.m.

Related to mdbeta in sdPrior...