Learn R Programming

OBASpatial (version 1.9)

tsrobapred: Prediction under Student-t Objective Bayesian Analysis (OBA).

Description

This function uses the sampling distribution of parameters obtained from the function tsroba to predict values at unknown locations.

Usage

tsrobapred(obj,xpred,coordspred)

Value

This function returns a vector with the predicted values at the specified locations.

Arguments

obj

object of the class "tsroba" (see tsroba function).

xpred

Values of the X design matrix for prediction coordinates.

coordspred

Points coordinates to be predicted.

Author

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

Details

This function predicts using the sampling distribution of parameters obtained from the function tsroba and the conditional Student-t distribution of the predicted values given the data.

References

Diggle, P. and P. Ribeiro (2007).Model-Based Geostatistics. Springer Series in Statistics.

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

tsroba,nsrobapred1

Examples

Run this code
# \dontshow{
set.seed(25)
data(dataca20)
d1=dataca20[1:158,]

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

datapred=dataca20[159:178,]
formula=calcont~altitude+area
xpred=model.matrix(formula,data=datapred)

tsrobapred(res,xpred=xpred,coordspred=dataca20[159:178,1:2])
# }
# \donttest{
set.seed(25)
data(dataca20)
d1=dataca20[1:158,]

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

datapred=dataca20[159:178,]
formula=calcont~altitude+area
xpred=model.matrix(formula,data=datapred)

tsrobapred(res,xpred=xpred,coordspred=dataca20[159:178,1:2])
# }

Run the code above in your browser using DataLab