spregimes {hspm} | R Documentation |
Estimation of spatial regimes models
Description
The function spregimes
deals
with the estimation of spatial regimes models.
This is a general function that allows the estimation
of various spatial specifications, including the spatial lag regimes model,
the spatial error regimes model, and the spatial SARAR regimes model.
Since the estimation is based on generalized method of moments (GMM),
endogenous variables can be included.
For further information on estimation, see details.
Usage
spregimes(
formula,
data = list(),
model = c("sarar", "lag", "error", "ols"),
listw,
wy_rg = FALSE,
weps_rg = FALSE,
initial.value = NULL,
rgv = NULL,
het = FALSE,
verbose = FALSE,
control = list()
)
## S3 method for class 'spregimes'
coef(object, ...)
## S3 method for class 'spregimes'
vcov(object, ...)
## S3 method for class 'spregimes'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'spregimes'
summary(object, ...)
## S3 method for class 'summary.spregimes'
print(x, digits = max(5, getOption("digits") - 3), ...)
## S3 method for class 'spregimes'
residuals(object, ...)
## S3 method for class 'spregimes'
fitted(object, ...)
Arguments
formula |
a symbolic description of the model of
the form |
data |
the data of class |
model |
should be one of |
listw |
a spatial weighting matrix of class |
wy_rg |
default |
weps_rg |
default |
initial.value |
initial value for the spatial error parameter |
rgv |
an object of class |
het |
heteroskedastic variance-covariance matrix |
verbose |
print a trace of the optimization |
control |
select arguments for the optimization |
object |
an object of class spregimes |
... |
additional arguments |
x |
an object of class spregimes |
digits |
number of digits |
Details
The function spregimes
is a wrapper that allows the
estimation of a general
spatial regimes model.
For convenience and without loss of generality,
we assume the presence of only two regimes.
In this case the general model can be written as:
\begin{aligned}
y = & W\begin{bmatrix}
y_1& 0 \\
0 & y_2 \\
\end{bmatrix}
\begin{bmatrix}
\lambda_1 \\
\lambda_2 \\
\end{bmatrix}
+
\begin{bmatrix}
X_1& 0 \\
0 & X_2 \\
\end{bmatrix}
\begin{bmatrix}
\beta_1 \\
\beta_2 \\
\end{bmatrix}
+ X\beta +
\begin{bmatrix}
Y_1& 0 \\
0 & Y_2 \\
\end{bmatrix}
\begin{bmatrix}
\pi_1 \\
\pi_2 \\
\end{bmatrix}
+ Y\pi + \\
&
W\begin{bmatrix}
X_1& 0 \\
0 & X_2 \\
\end{bmatrix}
\begin{bmatrix}
\delta_1 \\
\delta_2 \\
\end{bmatrix}+ WX\delta+
W
\begin{bmatrix}
Y_1& 0 \\
0 & Y_2 \\
\end{bmatrix}
\begin{bmatrix}
\theta_1 \\
\theta_2 \\
\end{bmatrix}
+ WY\theta
+
\begin{bmatrix}
\varepsilon_1 \\
\varepsilon_2 \\
\end{bmatrix}
\end{aligned}
where
\begin{bmatrix}
\varepsilon_1 \\
\varepsilon_2 \\
\end{bmatrix}
=W \begin{bmatrix}
\varepsilon_1&0 \\
0&\varepsilon_2 \\
\end{bmatrix}
\begin{bmatrix}
\rho_1 \\
\rho_2 \\
\end{bmatrix}
+u \nonumber
The model includes the spatial lag of the dependent variable,
the spatial lag of the regressors,
the spatial lag of the errors
and, possibly, additional endogenous variables.
The function
spregimes
estimates all of the nested
specifications deriving from this model.
There are, however, some restrictions.
For example, if weps_rg
is set to TRUE,
all the regressors in the model should also vary by regimes.
The estimation of the different models relies heavily
on code available from the package sphet.
For the spatial lag (or Durbin) regimes model (i.e, when
\rho_1
and\rho_2
are zero), an instrumental variable procedure is adopted, where the matrix of instruments is formed by the spatial lags of the exogenous variables and the additional instruments included in theformula
. A robust estimation of the variance-covariance matrix can be obtained by settinghet = TRUE
.For the spatial error regime models (i.e, when
\lambda_1
and\lambda_2
are zero), the spatial coefficient(s) are estimated with the GMM procedure described in Kelejian and Prucha (2010) and Drukker et al., (2013). The difference between Kelejian and Prucha (2010) and Drukker et al., (2013), is that the former assume heteroskedastic innovations (het = TRUE
), while the latter does not (het = FALSE
).For the SARAR regimes model, the estimation procedure alternates a series of IV and GMM steps. The variance-covariance can be estimated assuming that the innovations are homoskedastic (
het = FALSE
) as well as heteroskedastic (het = TRUE
).
Value
An object of class “spregimes
”
Author(s)
Gianfranco Piras and Mauricio Sarrias
References
Arraiz, I. and Drukker, M.D. and Kelejian, H.H. and Prucha, I.R. (2010) A spatial Cliff-Ord-type Model with Heteroskedastic Innovations: Small and Large Sample Results, Journal of Regional Sciences, 50, pages 592–614.
Drukker, D.M. and Egger, P. and Prucha, I.R. (2013) On Two-step Estimation of a Spatial Auto regressive Model with Autoregressive Disturbances and Endogenous Regressors, Econometric Review, 32, pages 686–733.
Kelejian, H.H. and Prucha, I.R. (2010) Specification and Estimation of Spatial Autoregressive Models with Autoregressive and Heteroskedastic Disturbances, Journal of Econometrics, 157, pages 53–67.
Gianfranco Piras (2010). sphet: Spatial Models with Heteroskedastic Innovations in R. Journal of Statistical Software, 35(1), 1-21. doi:10.18637/jss.v035.i01.
Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation Methods for Spatial Econometrics. Journal of Statistical Software, 63(18), 1-36. doi:10.18637/jss.v063.i18.
Gianfranco Piras, Paolo Postiglione (2022). A deeper look at impacts in spatial Durbin model with sphet. Geographical Analysis, 54(3), 664-684. https://onlinelibrary.wiley.com/doi/10.1111/gean.12318
Luc Anselin, Sergio J. Rey (2014). Modern Spatial Econometrics in Practice: A Guide to GeoDa, GeoDaSpace and PySal. GeoDa Press LLC.
Examples
data("natreg")
data("ws_6")
form <- HR90 ~ 0 | MA90 + PS90 +
RD90 + UE90 | 0 | 0 | MA90 + PS90 +
RD90 + FH90 + FP89 + GI89 | 0
form1 <- HR90 ~ MA90 -1 | PS90 +
RD90 + UE90 | 0 | MA90 -1 | PS90 +
RD90 + FH90 + FP89 + GI89 | 0
form2 <- HR90 ~ MA90 -1 | PS90 +
RD90 + UE90 | MA90 | MA90 -1 | PS90 +
RD90 + FH90 + FP89 + GI89 | 0
form3 <- HR90 ~ MA90 -1 | PS90 +
RD90 + UE90 | MA90 | MA90 -1 | PS90 +
RD90 + FH90 + FP89 + GI89 | GI89
form4 <- HR90 ~ MA90 -1 | PS90 +
RD90 + UE90 | MA90 + RD90 | MA90 -1 | PS90 +
RD90 + FH90 + FP89 + GI89 | GI89
split <- ~ REGIONS
###################################################
# Linear model with regimes and lagged regressors #
###################################################
mod <- spregimes(formula = form2, data = natreg,
rgv = split, listw = ws_6, model = "ols")
summary(mod)
mod1 <- spregimes(formula = form3, data = natreg,
rgv = split, listw = ws_6, model = "ols")
summary(mod1)
mod2 <- spregimes(formula = form4, data = natreg,
rgv = split, listw = ws_6, model = "ols")
summary(mod2)
###############################
# Spatial Error regimes model #
###############################
mod <- spregimes(formula = form, data = natreg,
rgv = split, listw = ws_6, model = "error", het = TRUE)
summary(mod)
mod1 <- spregimes(formula = form, data = natreg,
rgv = split, listw = ws_6, model = "error",
weps_rg = TRUE, het = TRUE)
summary(mod1)
mod2 <- spregimes(formula = form1, data = natreg,
rgv = split, listw = ws_6, model = "error", het = TRUE)
summary(mod2)
###############################
# Spatial Lag regimes model #
###############################
mod4 <- spregimes(formula = form, data = natreg,
rgv = split, listw = ws_6, model = "lag",
het = TRUE, wy_rg = TRUE)
summary(mod4)
mod5 <- spregimes(formula = form1, data = natreg,
rgv = split, listw = ws_6, model = "lag",
het = TRUE, wy_rg = TRUE)
summary(mod5)
###############################
# Spatial SARAR regimes model #
###############################
mod6 <- spregimes(formula = form, data = natreg,
rgv = split, listw = ws_6, model = "sarar",
het = TRUE, wy_rg = TRUE, weps_rg = TRUE)
summary(mod6)
mod7 <- spregimes(formula = form, data = natreg,
rgv = split, listw = ws_6, model = "sarar",
het = TRUE, wy_rg = FALSE, weps_rg = FALSE)
summary(mod7)
mod8 <- spregimes(formula = form1, data = natreg,
rgv = split, listw = ws_6, model = "sarar",
het = TRUE, wy_rg = TRUE, weps_rg = FALSE)
summary(mod8)