tsroba {OBASpatial}R Documentation

Bayesian estimation for the TSR model.

Description

This function performs Bayesian estimation of \theta=(\bold{\beta},\sigma^2,\phi) for the TSR model using the based reference, Jeffreys' rule ,Jeffreys' independent and vague priors.

Usage

tsroba(formula, method="median",sdnu=1,
prior = "reference",coords.col = 1:2,kappa = 0.5,
cov.model = "matern", data,asigma=2.1, intphi = "default",
intnu="default",ini.pars,burn=500, iter=5000,thin=10,cprop = NULL)

Arguments

formula

A valid formula for a linear regression model.

method

Method to estimate (\bold{beta},\sigma,\phi,\nu). The methods availables are "mean","median" and "mode".

sdnu

Standard deviation logarithm for the lognormal proposal for \nu

prior

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

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 the uniform proposal. See DETAILS below.

intnu

An interval for \nu used for the uniform proposal. See DETAILS below.

ini.pars

Initial values for (\sigma^2,\phi,\nu) in that order.

burn

Number of observations considered in burning process.

iter

Number of iterations for the sampling procedure.

thin

Number of observations considered in thin process.

cprop

A constant related to the acceptance probability (Default = NULL indicates that cprop is computed as the interval length of intphi). See DETAILS below.

Details

For the prior proposal, it was considered the structure \pi(\phi,\nu,\lambda)=\phi(\phi)\pi(\nu|\lambda)\pi(\lambda). For the vague prior, \phi follows an uniform distribution on the interval intphi, by default, this interval is computed using the empirical range of data as well as the constant cprop. On the other hand, \nu|\lambda~ Texp(\lambda,A) with A the interval given by the argument intnu and \lambda~unif(0.02,0.5)

For the Jeffreys independent prior, the sampling procedure generates improper posterior distribution when intercept is considered for the mean function.

Value

dist

Joint sample (matrix object) obtaining for (\bold{beta},\sigma^2,\phi).

betaF

Sample obtained for \bold{beta}.

sigmaF

Sample obtained for \sigma^2.

phiF

Sample obtained for \phi.

nuF

Sample obtained for \phi.

coords

Spatial data coordinates.

kappa

Shape parameter of the covariance function.

$X

Design matrix of the model.

$type

Covariance function of the model.

$theta

Bayesian estimator of (\bold{beta},\sigma,\phi).

$y

Response variable.

$prior

Prior density considered.

Author(s)

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

References

Ordonez, J.A, M.O. Prattes, L.A. Matos, and V.H. Lachos (2020+). Objective Bayesian analysis for spatial Student-t regression models. (Submitted)

See Also

dnsrposoba,dtsrprioroba,dnsrprioroba,tsroba

Examples







set.seed(25)
data(dataca20)
d1=dataca20[1:158,]

xpred=model.matrix(calcont~altitude+area,data=dataca20[159:178,])
xobs=model.matrix(calcont~altitude+area,data=dataca20[1:158,])
coordspred=dataca20[159:178,1:2]

######covariance matern: kappa=0.3 prior:reference
res=tsroba(calcont~altitude+area, kappa = 0.3, data=d1,
           ini.pars=c(10,390,10),iter=11000,burn=1000,thin=10)

summary(res)

######covariance matern: kappa=0.3 prior:jef.rul
res1=tsroba(calcont~altitude+area, kappa = 0.3,
            data=d1,prior="jef.rul",ini.pars=c(10,390,10),
            iter=11000,burn=1000,thin=10)

summary(res1)

######covariance matern: kappa=0.3 prior:jef.ind
res2=tsroba(calcont~altitude+area, kappa = 0.3, data=d1,
            prior="jef.ind",ini.pars=c(10,390,10),iter=11000,
            burn=1000,thin=10)

summary(res2)

######covariance matern: kappa=0.3 prior:vague
res3=tsroba(calcont~altitude+area, kappa = 0.3,
     data=d1,prior="vague",ini.pars=c(10,390,10),,iter=11000,
     burn=1000,thin=10)

summary(res3)

####obtaining posterior probabilities
###(just comparing priors with kappa=0.3).
###the real aplication (see Ordonez et.al) consider kappa=0.3,0.5,0.7.

######### Using reference prior ###########
m1=intmT(prior="reference",formula=calcont~altitude+area,
kappa=0.3,cov.model="matern",data=dataca20,maxEval=1000)

######### Using Jeffreys' rule prior ###########
m1j=intmT(prior="jef.rul",formula=calcont~altitude+area,
kappa=0.3,cov.model="matern",data=dataca20,maxEval=1000)


######### Using Jeffreys' independent prior ###########
m1ji=intmT(prior="jef.ind",formula=calcont~altitude+area
,kappa=0.3,cov.model="matern",data=dataca20,maxEval=1000)

m1v=intmT(prior="vague",formula=calcont~altitude+area
,kappa=0.3,cov.model="matern",data=dataca20,maxEval=1000,intphi="default")


tot=m1+m1j+m1ji+m1v

####posterior probabilities#####
p1=m1/tot
pj=m1j/tot
pji=m1ji/tot
pv=m1v/tot


##########MSPE#######################################

pme=tsrobapred(res,xpred=xpred,coordspred=coordspred)
pme1=tsrobapred(res1,xpred=xpred,coordspred=coordspred)
pme2=tsrobapred(res2,xpred=xpred,coordspred=coordspred)
pme3=tsrobapred(res3,xpred=xpred,coordspred=coordspred)

mse=mean((pme-dataca20$calcont[159:178])^2)
mse1=mean((pme1-dataca20$calcont[159:178])^2)
mse2=mean((pme2-dataca20$calcont[159:178])^2)
mse3=mean((pme3-dataca20$calcont[159:178])^2)



[Package OBASpatial version 1.9 Index]