PredStempCens {StempCens}R Documentation

Prediction in spatio-temporal model with censored/missing responses

Description

This function performs spatio-temporal prediction in a set of new S spatial locations for fixed time points.

Usage

PredStempCens(Est.StempCens, locPre, timePre, xPre)

Arguments

Est.StempCens

an object of class Est.StempCens given as output by the EstStempCens function.

locPre

a matrix of coordinates for which prediction is performed.

timePre

the time point vector for which prediction is performed.

xPre

a matrix of covariates for which prediction is performed.

Value

The function returns an object of class Pred.StempCens which is a list given by:

predValues

predicted values.

VarPred

predicted covariance matrix.

Author(s)

Katherine L. Valeriano, Victor H. Lachos and Larissa A. Matos

See Also

EstStempCens

Examples


set.seed(12345)
# Parameter values
beta <- c(-1,1.50)
phi  <- 5
rho  <- 0.60
tau2 <- 0.80
sigma2 <- 2
coord <- matrix(runif(34, 0, 10), ncol=2)
time  <- matrix(1:5, ncol=1)
x     <- cbind(rexp(85,2), rnorm(85,2,1))

# Data simulation
data  <- rnStempCens(x, time, coord, beta, phi, rho, tau2, sigma2,
                     type.S="pow.exp", kappa=0.5, cens="left", pcens=0.10)
# Splitting the dataset
train <- data[11:85,]
test  <- data[1:10,]

# Estimation
x <- cbind(train$x1, train$x2)
coord2 <- cbind(train$x.coord, train$y.coord)
est_teste <- EstStempCens(train$yObs, x, train$ci, train$time, coord2, train$lcl,
                          train$ucl, init.phi=3.5, init.rho=0.5, init.tau2=1, kappa=0.5,
                          type.S="pow.exp", IMatrix=FALSE, M=20, perc=0.25, MaxIter=300,
                          pc=0.20)
# Prediction
xPre <- cbind(test$x1, test$x2)
pre_test <- PredStempCens(est_teste, test[,1:2], test$time, xPre)

[Package StempCens version 1.2.0 Index]