Learn R Programming

OBASpatial (version 1.9)

intmnorm: Marginal posterior density for a model.

Description

It calculates the marginal density density for a model \(M\) (up to a proportionality constant) for the NSR model using the based reference, Jeffreys' rule, Jeffreys' independent and vague priors. In this context \(\phi\) corresponds to the range parameter.

Usage

intmnorm(formula,prior="reference",coords.col=1:2,kappa=0.5,
cov.model="exponential",data,asigma=2.1,intphi,maxEval)

Value

Marginal density of the model \(m_k\) for the reference based, Jeffreys' rule, Jeffreys' independent and vague priors.

Arguments

formula

A valid formula for a linear regression model.

prior

Objective prior densities avaiable for the TSR model: ( reference: Reference based, jef.rul: Jeffreys' rule, jef.ind: Jeffreys' independent).

coords.col

A vector with the column numbers corresponding to the spatial coordinates.

kappa

Shape parameter of the covariance function (fixed).

cov.model

Covariance functions available for the TSR model. matern: Matern, pow.exp: power exponential, exponential:exponential, cauchy: Cauchy, spherical: Spherical.

data

Data set with 2D spatial coordinates, the response and optional covariates.

asigma

Value of \(a\) for vague prior.

intphi

An interval for \(\phi\) used for vague prior.

maxEval

Maximum number of iterations for the integral computation.

Author

Jose A. Ordonez, Marcos O. Prates, Larissa A. Matos, Victor H. Lachos.

Details

Let \(m_k\) a parametric model with parameter vector \(\theta_k\). Under the TSR model and the prior density proposal:

$$\frac{\pi(\phi)}{(\sigma^2)^a}$$

we have that the marginal density is given by:

$$\int L(\theta_{m_k})\pi(m_k)dm_k$$

This quantity can be useful as a criteria for model selection. The computation of \(m_k\) could be compute demanding depending on the number of iterations in maxEval.

References

Berger, J.O, De Oliveira, V. and Sanso, B. (2001). Objective Bayesian Analysis of Spatially Correlated Data. Journal of the American Statistical Association., 96, 1361 -- 1374.

See Also

dnsrposoba,dtsrprioroba,dnsrprioroba

Examples

Run this code

# \dontshow{
data(dataca20)

set.seed(25)
data(dataelev)## data using by Berger et. al (2001)

######### Using reference prior ###########
m1=intmnorm(prior="reference",formula=elevation~1,
kappa=0.5,cov.model="matern",data=dataelev,maxEval=1)

log(m1)


######### Using reference prior kappa=1 ###########
m2=intmnorm(prior="reference",formula=elevation~1,
kappa=1,cov.model="matern",data=dataelev,maxEval=1)
log(m2)

######### Using reference prior kappa=1.5 ###########
m3=intmnorm(prior="reference",formula=elevation~1
,kappa=1.5,cov.model="matern",data=dataelev,maxEval=1)
log(m3)

tot=m1+m2+m3

########posterior probabilities: higher probability:
#########prior="reference", kappa=1
p1=m1/tot
p2=m2/tot
p3=m3/tot


# }


# \donttest{

data(dataca20)

set.seed(25)
data(dataelev)## data using by Berger et. al (2001)

######### Using reference prior ###########
m1=intmnorm(prior="reference",formula=elevation~1,
kappa=0.5,cov.model="matern",data=dataelev,maxEval=1000)

log(m1)


######### Using reference prior kappa=1 ###########
m2=intmnorm(prior="reference",formula=elevation~1,
kappa=1,cov.model="matern",data=dataelev,maxEval=1000)
log(m2)

######### Using reference prior kappa=1.5 ###########
m3=intmnorm(prior="reference",formula=elevation~1
,kappa=1.5,cov.model="matern",data=dataelev,maxEval=1000)
log(m3)

tot=m1+m2+m3

########posterior probabilities: higher probability:
#########prior="reference", kappa=1
p1=m1/tot
p2=m2/tot
p3=m3/tot
# }

Run the code above in your browser using DataLab