tsroba {OBASpatial} | R Documentation |
Bayesian estimation for the TSR model.
Description
This function performs Bayesian estimation of 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 ( |
sdnu |
Standard deviation logarithm for the lognormal proposal for |
prior |
Objective prior densities avaiable for the TSR model: ( |
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. |
data |
Data set with 2D spatial coordinates, the response and optional covariates. |
asigma |
Value of |
intphi |
An interval for |
intnu |
An interval for |
ini.pars |
Initial values for |
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
For the prior proposal, it was considered the structure . For the vague prior,
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, with A the interval given by the argument
intnu
and
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 ( |
betaF |
Sample obtained for |
sigmaF |
Sample obtained for |
phiF |
Sample obtained for |
nuF |
Sample obtained for |
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 ( |
$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)