MCEM.sclm {RcppCensSpatial}R Documentation

ML estimation of spatial censored linear models via the MCEM algorithm

Description

It fits the left, right, or interval spatial censored linear model using the Monte Carlo EM (MCEM) algorithm. It provides estimates and standard errors of the parameters and supports missing values on the dependent variable.

Usage

MCEM.sclm(y, x, ci, lcl = NULL, ucl = NULL, coords, phi0, nugget0,
  type = "exponential", kappa = NULL, lower = c(0.01, 0.01),
  upper = c(30, 30), MaxIter = 500, nMin = 20, nMax = 5000,
  error = 1e-04, show_se = TRUE)

Arguments

y

vector of responses of length n.

x

design matrix of dimensions n\times q, where q is the number of fixed effects, including the intercept.

ci

vector of censoring indicators of length n. For each observation: 1 if censored/missing, 0 otherwise.

lcl, ucl

vectors of length n representing the lower and upper bounds of the interval, which contains the true value of the censored observation. Default =NULL, indicating no-censored data. For each observation: lcl=-Inf and ucl=c (left censoring); lcl=c and ucl=Inf (right censoring); and lcl and ucl must be finite for interval censoring. Moreover, missing data could be defined by setting lcl=-Inf and ucl=Inf.

coords

2D spatial coordinates of dimensions n\times 2.

phi0

initial value for the spatial scaling parameter.

nugget0

initial value for the nugget effect parameter.

type

type of spatial correlation function: 'exponential', 'gaussian', 'matern', and 'pow.exp' for exponential, gaussian, matérn, and power exponential, respectively.

kappa

parameter for some spatial correlation functions. See CovMat.

lower, upper

vectors of lower and upper bounds for the optimization method. If unspecified, the default is c(0.01,0.01) for lower and c(30,30) for upper.

MaxIter

maximum number of iterations for the MCEM algorithm. By default =500.

nMin

initial sample size for Monte Carlo integration. By default =20.

nMax

maximum sample size for Monte Carlo integration. By default =5000.

error

maximum convergence error. By default =1e-4.

show_se

logical. It indicates if the standard errors should be estimated by default =TRUE.

Details

The spatial Gaussian model is given by

Y = X\beta + \xi,

where Y is the n\times 1 response vector, X is the n\times q design matrix, \beta is the q\times 1 vector of regression coefficients to be estimated, and \xi is the error term. Which is normally distributed with zero-mean and covariance matrix \Sigma=\sigma^2 R(\phi) + \tau^2 I_n. We assume that \Sigma is non-singular and X has a full rank (Diggle and Ribeiro 2007).

The estimation process is performed via the MCEM algorithm, initially proposed by Wei and Tanner (1990). The Monte Carlo (MC) approximation starts with a sample of size nMin; at each iteration, the sample size increases (nMax-nMin)/MaxIter, and at the last iteration, the sample size is nMax. The random observations are sampled through the slice sampling algorithm available in package relliptical.

Value

An object of class "sclm". Generic functions print and summary have methods to show the results of the fit. The function plot can extract convergence graphs for the parameter estimates.

Specifically, the following components are returned:

Theta

estimated parameters in all iterations, \theta = (\beta, \sigma^2, \phi, \tau^2).

theta

final estimation of \theta = (\beta, \sigma^2, \phi, \tau^2).

beta

estimated \beta.

sigma2

estimated \sigma^2.

phi

estimated \phi.

tau2

estimated \tau^2.

EY

MC approximation of the first conditional moment.

EYY

MC approximation of the second conditional moment.

SE

vector of standard errors of \theta = (\beta, \sigma^2, \phi, \tau^2).

InfMat

observed information matrix.

loglik

log-likelihood for the MCEM method.

AIC

Akaike information criterion.

BIC

Bayesian information criterion.

Iter

number of iterations needed to converge.

time

processing time.

call

RcppCensSpatial call that produced the object.

tab

table of estimates.

critFin

selection criteria.

range

effective range.

ncens

number of censored/missing observations.

MaxIter

maximum number of iterations for the MCEM algorithm.

Note

The MCEM final estimates correspond to the mean of the estimates obtained at each iteration after deleting the half and applying a thinning of 3.

To fit a regression model for non-censored data, just set ci as a vector of zeros.

Author(s)

Katherine L. Valeriano, Alejandro Ordoñez, Christian E. Galarza, and Larissa A. Matos.

References

Diggle P, Ribeiro P (2007). Model-based Geostatistics. Springer.

Wei G, Tanner M (1990). “A Monte Carlo implementation of the EM algorithm and the poor man's data augmentation algorithms.” Journal of the American Statistical Association, 85(411), 699–704. doi:10.1080/01621459.1990.10474930.

See Also

EM.sclm, SAEM.sclm, predict.sclm

Examples

# Example 1: left censoring data
set.seed(1000)
n = 50   # Test with another values for n
coords = round(matrix(runif(2*n,0,15),n,2), 5)
x = cbind(rnorm(n), rnorm(n))
data = rCensSp(c(2,-1), 2, 3, 0.70, x, coords, "left", 0.08, 0, "matern", 1)

fit = MCEM.sclm(y=data$y, x=x, ci=data$ci, lcl=data$lcl, ucl=data$ucl,
                coords, phi0=2.50, nugget0=0.75, type="matern",
                kappa=1, MaxIter=30, nMax=1000)
fit$tab

# Example 2: left censoring and missing data
yMiss = data$y
yMiss[20] = NA
ci = data$ci
ci[20] = 1
ucl = data$ucl
ucl[20] = Inf

fit1 = MCEM.sclm(y=yMiss, x=x, ci=ci, lcl=data$lcl, ucl=ucl, coords,
                 phi0=2.50, nugget0=0.75, type="matern", kappa=1,
                 MaxIter=300, nMax=1000)
summary(fit1)
plot(fit1)

[Package RcppCensSpatial version 0.3.0 Index]