View source: R/EstEMspatial_USER.R
EM.sclm | R Documentation |
It fits the left, right, or interval spatial censored linear model using the Expectation-Maximization (EM) algorithm. It provides estimates and standard errors of the parameters and supports missing values on the dependent variable.
EM.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 = 300, error = 1e-04, show_se = TRUE)
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:
|
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
|
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: |
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 EM algorithm. By default |
error |
maximum convergence error. By default |
show_se |
logical. It indicates if the standard errors should be estimated by default |
The spatial Gaussian model is given by
Y = Xβ + ξ,
where Y is the n\times 1 response vector, X is the n\times q design matrix, β is the q\times 1 vector of regression coefficients to be estimated, and ξ is the error term. Which is normally distributed with zero-mean and covariance matrix Σ=σ^2 R(φ) + τ^2 I_n. We assume that Σ is non-singular and X has a full rank \insertCitediggle2007springerRcppCensSpatial.
The estimation process is performed via the EM algorithm, initially proposed by
\insertCitedempster1977maximum;textualRcppCensSpatial. The conditional
expectations are computed using the function meanvarTMD
available in the
package MomTrunc
.
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, θ = (β, σ^2, φ, τ^2). |
theta |
final estimation of θ = (β, σ^2, φ, τ^2). |
beta |
estimated β. |
sigma2 |
estimated σ^2. |
phi |
estimated φ. |
tau2 |
estimated τ^2. |
EY |
first conditional moment computed in the last iteration. |
EYY |
second conditional moment computed in the last iteration. |
SE |
vector of standard errors of θ = (β, σ^2, φ, τ^2). |
InfMat |
observed information matrix. |
loglik |
log-likelihood for the EM 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 EM algorithm. |
The EM final estimates correspond to the estimates obtained at the last iteration of the EM algorithm.
To fit a regression model for non-censored data, just set ci
as a vector of zeros.
Katherine L. Valeriano, Alejandro Ordoñez, Christian E. Galarza, and Larissa A. Matos.
MCEM.sclm
, SAEM.sclm
, predict.sclm
# Simulated example: 10% of left-censored observations 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), runif(n)) data = rCensSp(c(-1,3), 2, 4, 0.5, x, coords, "left", 0.10, 0, "gaussian") fit = EM.sclm(y=data$y, x=x, ci=data$ci, lcl=data$lcl, ucl=data$ucl, coords=coords, phi0=3, nugget0=1, type="gaussian") fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.