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 |
x |
design matrix of dimensions |
ci |
vector of censoring indicators of length |
lcl , ucl |
vectors of length |
coords |
2D spatial coordinates of dimensions |
phi0 |
initial value for the spatial scaling parameter. |
nugget0 |
initial value for the nugget effect parameter. |
type |
type of spatial correlation function: |
kappa |
parameter for some spatial correlation functions. See |
lower , upper |
vectors of lower and upper bounds for the optimization method.
If unspecified, the default is |
MaxIter |
maximum number of iterations for the MCEM algorithm. By default |
nMin |
initial sample size for Monte Carlo integration. By default |
nMax |
maximum sample size for Monte Carlo integration. By default |
error |
maximum convergence error. By default |
show_se |
logical. It indicates if the standard errors
should be estimated by default |
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 |
final estimation of |
beta |
estimated |
sigma2 |
estimated |
phi |
estimated |
tau2 |
estimated |
EY |
MC approximation of the first conditional moment. |
EYY |
MC approximation of the second conditional moment. |
SE |
vector of standard errors of |
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 |
|
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)