Maximum likelihood (ML) estimation of spatial panel models with random effects and serial error correlation.
spreml(formula, data, index = NULL, w, w2=w, lag = FALSE,
errors = c("semsrre", "semsr", "srre", "semre",
"re", "sr", "sem","ols", "sem2srre",
"sem2re", "semgre"),
pvar = FALSE, hess = FALSE, quiet = TRUE,
initval = c("zeros", "estimate"),
x.tol = 1.5e-18, rel.tol = 1e-15, ...)
An object of class "splm"
.
coefficients estimate of the model parameters
the coefficient for the spatial lag on y
the estimates of the error variance components
the asymptotic variance covariance matrix of the estimated coefficients
the asymptotic variance of the estimated spatial lag parameter
the asymptotic variance covariance matrix of the estimated error covariance parameters
'random effects ML'
the model residuals
the fitted values, calculated as \(\hat{y}=X \hat{\beta}\)
GLS residuals variance
the matrix of the data used
the call used to create the object
the value of the log likelihood function at the optimum
the value of the errors
argument
a symbolic description of the model to be estimated
an object of class data.frame
or pdata.frame
. A data frame containing the variables
in the model. When the object is a data.frame
, the first two columns shall contain the indexes, unless otherwise specified. See index
if not NULL (default), a character vector to identify the indexes among the columns of the data.frame
an object of class listw
or a matrix
. It represents the spatial weights to be used in estimation.
an object of class listw
or a
matrix
. Second set of spatial weights for estimation, if
different from the first (e.g., in a 'sarar' model).
default=FALSE
. If TRUE
, a spatial lag of the dependent variable is added.
Specifies the error covariance structure. See details.
legacy parameter here only for compatibility.
default=FALSE
. If TRUE
estimate the
covariance for beta_hat by numerical Hessian instead of GLS at optimal
values.
default=TRUE
. If FALSE
, report function and
parameters values during optimization.
one of c("zeros", "estimate")
, the initial values for
the parameters. If "zeros"
a vector of zeros is used. if
"estimate"
the initial values are retreived from the estimation
of the nested specifications. Alternatively, a numeric vector can be
specified.
control parameter for tolerance. See nlminb
for details.
control parameter for relative tolerance. See nlminb
for details.
additional arguments to pass over to other functions, e.g. method
.
Giovanni Millo
Second-level wrapper for estimation of random effects models
with serial and spatial correlation. The specifications without serial
correlation (no "sr" in errors
) can be called through
spml
, the extended ones only through spreml
.
The models are estimated by two-step Maximum Likelihood.
Abbreviations in errors
correspond to: "sem"
Anselin-Baltagi type spatial autoregressive error: if
present, random effects are not spatially correlated; "sem2"
Kapoor, Kelejian and Prucha-type spatial autoregressive error model
with spatially correlated random effects; "sr"
serially
correlated remainder errors; "re"
random effects; "ols"
spherical errors (usually combined with lag=T
).
The optimization method
can be passed on as optional
parameter. Default is "nlminb"
; all constrained optimization
methods from maxLik
are allowed ("BFGS", "NM", "SANN"
)
but the latter two are still experimental.
Millo, G. (2014) Maximum likelihood estimation of spatially and serially correlated panels with random effects. Computational Statistics and Data Analysis, 71, 914--933.
spml
data(Produc, package = "plm")
data(usaww)
fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
## random effects panel with spatial lag and serial error correlation
## optimization method set to "BFGS"
sarsrmod <- spreml(fm, data = Produc, w = usaww, errors="sr", lag=TRUE,
method="BFGS")
summary(sarsrmod)
Run the code above in your browser using DataLab