mdf_ga: Marginal Density for Given Scale Parameter and Half-Normal...

Description Usage Arguments Value Author(s) References Examples

View source: R/mdf_ga.r

Description

This function computes the marginal density of z_p'β for gamma priors for τ^2 (referring to a half-normal prior for τ).

Usage

1
mdf_ga(f, theta, Z, Kinv)

Arguments

f

point the marginal density to be evaluated at.

theta

denotes the scale parameter of the gamma hyperprior for τ^2 (half-normal for τ).

Z

the row of the design matrix evaluated.

Kinv

the generalised inverse of K.

Value

the marginal density evaluated at point x.

Author(s)

Nadja Klein

References

Nadja Klein and Thomas Kneib (2015). Scale-Dependent Priors for Variance Parameters in Structured Additive Distributional Regression. Working Paper.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(123)
library(MASS)
# prior precision matrix (second order differences) 
# of a spline of degree l=3 and with m=20 inner knots
# yielding dim(K)=m+l-1=22
K <- t(diff(diag(22), differences=2))%*%diff(diag(22), differences=2)
# generalised inverse of K
Kinv <- ginv(K)
# covariate x
x <- runif(1)
Z <- matrix(DesignM(x)$Z_B,nrow=1)
fgrid <- seq(-3,3,length=1000)
mdf <- mdf_ga(fgrid,theta=0.0028,Z=Z,Kinv=Kinv)

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

Related to mdf_ga in sdPrior...