Description Usage Arguments Details Value Author(s) References See Also Examples
The marginal density of the data, i.e. the likelihood integrated with respect to the given prior distribution on the regression coefficients of the variables included in the model and an inverse gamma prior on the residual variance.
nlpMarginal
is the general function, the remaining ones
correspond to particular cases and are kept for backwards
compatibility with old code, and will be deprecated in the future.
1 2 3 4 5 6 7 8 9 10 11  nlpMarginal(sel, y, x, family="normal", priorCoef=momprior(tau=0.348),
priorVar=igprior(alpha=0.01,lambda=0.01), priorSkew=momprior(tau=0.348),
method='auto', hess='asymp', optimMethod='CDA', B=10^5, logscale=TRUE, XtX, ytX)
pimomMarginalK(sel, y, x, phi, tau=1, method='Laplace', B=10^5, logscale=TRUE, XtX, ytX)
pimomMarginalU(sel, y, x, alpha=0.001, lambda=0.001, tau=1,
method='Laplace', B=10^5, logscale=TRUE, XtX, ytX)
pmomMarginalK(sel, y, x, phi, tau, r=1, method='auto', B=10^5,
logscale=TRUE, XtX, ytX)
pmomMarginalU(sel, y, x, alpha=0.001, lambda=0.001, tau=1,
r=1, method='auto', B=10^5, logscale=TRUE, XtX, ytX)

sel 
Vector with indexes of columns in x to be included in the model 
y 
Vector with observed responses 
x 
Design matrix with covariates. Only the columns specified in

family 
Residual distribution. Possible values are 'normal','twopiecenormal','laplace', 'twopiecelaplace' 
priorCoef 
Prior on coefficients, created
by 
priorVar 
Inverse gamma prior on scale parameter, created by

priorSkew 
Either a number fixing tanh(alpha) where alpha is the
asymmetry parameter or a prior on residual skewness parameter,
assumed to be of
the same family as priorCoef. Ignored if 
method 
Method to approximate the integral. method=='auto' uses closedform expressions whenever possible and Laplace approximations otherwise. method=='Laplace' for Laplace approx. method=='MC' for Monte Carlo 
hess 
Method to estimat the hessian in the Laplace approximation to the integrated likelihood under Laplace or asymmetric Laplace errors. When hess=='asymp' the asymptotic hessian is used, hess=='asympDiagAdj' a diagonal adjustment is applied (see Rossell and Rubio for details). 
optimMethod 
Algorithm to maximize objective function when method=='Laplace' or method=='MC'. optimMethod=='LMA' uses modified NewtonRaphson algorithm, 'CDA' coordinate descent algorithm 
B 
Number of Monte Carlo samples to use (ignored unless

logscale 
If 
XtX 
Optionally, specify the matrix X'X. Useful when the function must be called a large number of times. 
ytX 
Optionally, specify the vector y'X. Useful when the function must be called a large number of times. 
phi 
Residual variance, assumed to be known by

alpha 
Prior for phi is inverse gamma 
lambda 
Prior for phi is inverse gamma 
tau 
Prior dispersion parameter for MOM and iMOM priors (see details) 
r 
Prior power parameter for MOM prior is 
The marginal density of the data is equal to the integral of N(y;x[,sel]*theta,phi*I) * pi(thetaphi,tau) * IG(phi;alpha/2,lambda/2) with respect to theta, where pi(thetaphi,tau) is a nonlocal prior and IG denotes the density of an inverse gamma.
pmomMarginalK
and pimomMarginalK
assume that the
residual variance is known and therefore the inversegamma term in the
integrand can be ommitted.
The product MOM and iMOM densities can be evaluated using the
functions dmom
and dimom
.
Marginal density of the observed data under the specified prior.
David Rossell
Johnson V.E., Rossell D. NonLocal Prior Densities for Default Bayesian Hypothesis Tests. Journal of the Royal Statistical Society B, 2010, 72, 143170. See http://rosselldavid.googlepages.com for technical reports.
modelSelection
to perform model selection based
on product nonlocal priors.
momunknown
, imomunknown
, momknown
, imomknown
to compute Bayes factors for additive MOM and iMOM priors.
mode2g
for prior elicitation.
1 2 3 4  x < matrix(rnorm(100*2),ncol=2)
y < x %*% matrix(c(.5,1),ncol=1) + rnorm(nrow(x))
pmomMarginalK(sel=1, y=y, x=x, phi=1, tau=1, method='Laplace')
pmomMarginalK(sel=1:2, y=y, x=x, phi=1, tau=1, method='Laplace')

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.