Estimating the spatial dynamic panel data model with M-estimator
msdpd(
y,
x,
w1,
correction = TRUE,
hessian_er = FALSE,
true_range = FALSE,
max_try = 5,
w2 = w1,
w3 = w1,
no_tf = FALSE,
model = "full",
rcpp = TRUE,
cma_pop_multi = 1
)matrix, containing regional index (first column), time index (second column, numeric) and dependent variable (third column, numeric).
matrix, containing regional index (first column), time index (second column, numeric) and regressors (numeric).
matrix, the spatial weight matrix. If w2 and w3 are supplied, the spatial weight matrix for spatial lag.
logical, whether to use adjusted score function. Default value is TRUE.
logical, whether to output hessian based se. Ignored if correction is set to False. Default value is FALSE.
logical, whether to used the accurate stationary check. Default value is FALSE due to performance reasons.
integer, maximum attempt for the solver. Default value is 5.
matrix, the spatial weight matrix for spatio-temporal lag. Default value is the same as w1.
matrix, the spatial weight matrix for spatial error. Default value is the same as w1.
logical, whether to account for time effect. Default value is TRUE.
character, indicates the model used for estimation, can be "full", "slm", "sem", "sltl". See Details.
logical, whether to use the rcpp implementation to calculate the score function. Default value is TRUE.
integer, multiplier for the population size used in CMA-ES. Default value is 1.
A list of estimation results of S3 class "msdpd"
"coefficient" list, coefficients and standard errors
"model" character, model used for estimation
"vc_mat" matrix, variance-covariance matrix
"hessian" matrix, optional, hessian matrix
Estimating the spatial dynamic panel data model with Yang(2018)'s M-estimator $$ y_{ti} = \mu_{i}+\alpha_t + x_{ti}\beta + \rho y_{t-1,i} + \lambda_1 \sum_{j =1}^{n}w_{1,ij}y_{tj} + \lambda_2 \sum_{j =1}^{n}w_{2,ij}y_{t-1,j} + u_{ti},\\ u_{ti} = \lambda_3\sum_{j =1}^{n}w_{3,ij}u_{tj} + v_{ti}, i=1,\ldots,n,t=1,\ldots,T$$ The minimum number of time-periods is 4. Make sure the rows and columns of w1, w2, and w3 are lined up with the regional index. Sub-models can be specified by argument "model"
"full" Full model
"slm" \(\lambda_2 = \lambda_3 = 0\)
"sem" \(\lambda_1 = \lambda_2 = 0\)
"sltl" \(\lambda_3 = 0\)
Some suggestions when the optimizer fails:
Increase max_try
Increase cma_pop_multi
try a different submodel
Yang, Z. (2018). Unified M-estimation of fixed-effects spatial dynamic models with short panels. Journal of Econometrics, 205(2), 423-447.
# NOT RUN {
data(data_n, data_nw)
result <- msdpd(y = data_n$y, x = data_n$x, w1 = data_nw)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab