dmom {mombf}R Documentation

Moment prior and inverse moment prior.

Description

dmom and dimom return the density for the moment and inverse moment priors, in the univariate and multivariate setting. pmom and pimom return the distribution function for the univariate moment and inverse moment priors. qmom and qimom return the quantiles for the univariate moment and inverse moment priors.

Usage

dmom(x, V1 = 1, g = 1, n = 1, theta0)
dimom(x, V1 = 1, g = 1, n = 1, nu = 1, theta0, logscale = FALSE)
pmom(q, V1 = 1, g = 1, n = 1)
pimom(q, V1 = 1, g = 1, n = 1, nu = 1)
qmom(p, V1 = 1, g = 1, n = 1)
qimom(p, V1 = 1, g = 1, n = 1, nu = 1)

Arguments

x In the univariate setting, x is a vector with the values at which to evaluate the density. In the multivariate setting it is a matrix with an observation in each row.
q Vector of quantiles.
p Vector of probabilities.
theta0 Location parameter. Defaults to 0.
V1 Scale matrix. Defaults to 1 in univariate setting and the identity matrix in the multivariate setting.
g Prior parameter. See details.
n Prior parameter. See details.
nu Prior parameter. The tails of the inverse moment prior are proportional to the tails of a multivariate T with nu degrees of freedom.
logscale For logscale==TRUE, dimom returns the natural log of the prior density.

Details

Define the quadratic form q(theta)= (theta-theta0)' * V1^{-1} * (theta-theta0) / (n*g). The moment prior density is proportional to q(theta)*dmvnorm(theta,theta0,n*g*V1). The inverse moment prior density is proportional to q(theta)^(-(nu+d)/2) * exp(-1/q(theta)). pmom, pimom and qimom use closed-form expressions, while qmom uses nlminb to find quantiles numerically.

Value

dmom returns the value of the moment prior density. dimom returns the value of the inverse moment prior density.

Author(s)

David Rossell

References

See http://rosselldavid.googlepages.com for technical reports.

See Also

g2mode to find the prior mode corresponding to a given g. mode2g to find the g value corresponding to a given prior mode.

Examples

#evaluate and plot the moment and inverse moment priors
library(mombf)
g <- 1
thseq <- seq(-3,3,length=1000)
plot(thseq,dmom(thseq,g=g),type='l',ylab='Prior density')
lines(thseq,dimom(thseq,g=g),lty=2,col=2)

[Package mombf version 1.0.3 Index]