Title: | M-Estimator for Threshold Spatial Dynamic Panel Data Model |
---|---|
Description: | M-estimator for threshold and non-threshold spatial dynamic panel data model. Yang, Z (2018) <doi:10.1016/j.jeconom.2017.08.019>. Wu, J., Matsuda, Y (2021) <doi:10.1007/s43071-021-00008-1>. |
Authors: | Junyue Wu |
Maintainer: | Junyue Wu <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2 |
Built: | 2024-12-13 06:43:50 UTC |
Source: | CRAN |
M-estimator for threshold and non-threshold spatial dynamic panel data model.
Junyue Wu <[email protected]>
A simulated data set for testing
data_n
data_n
An object of class list
of length 4.
A simulated data set for testing
data_nw
data_nw
An object of class matrix
with 12 rows and 12 columns.
A simulated data set for testing
data_th
data_th
An object of class list
of length 8.
A simulated data set for testing
data_w
data_w
An object of class matrix
with 16 rows and 16 columns.
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 )
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 )
y |
matrix, containing regional index (first column), time index (second column, numeric) and dependent variable (third column, numeric). |
x |
matrix, containing regional index (first column), time index (second column, numeric) and regressors (numeric). |
w1 |
matrix, the spatial weight matrix. If w2 and w3 are supplied, the spatial weight matrix for spatial lag. |
correction |
logical, whether to use adjusted score function. Default value is TRUE. |
hessian_er |
logical, whether to output hessian based se. Ignored if correction is set to False. Default value is FALSE. |
true_range |
logical, whether to used the accurate stationary check. Default value is FALSE due to performance reasons. |
max_try |
integer, maximum attempt for the solver. Default value is 5. |
w2 |
matrix, the spatial weight matrix for spatio-temporal lag. Default value is the same as w1. |
w3 |
matrix, the spatial weight matrix for spatial error. Default value is the same as w1. |
no_tf |
logical, whether to account for time effect. Default value is TRUE. |
model |
character, indicates the model used for estimation, can be "full", "slm", "sem", "sltl". See Details. |
rcpp |
logical, whether to use the rcpp implementation to calculate the score function. Default value is TRUE. |
cma_pop_multi |
integer, multiplier for the population size used in CMA-ES. Default value is 1. |
Estimating the spatial dynamic panel data model with Yang(2018)'s M-estimator
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"
"sem"
"sltl"
Some suggestions when the optimizer fails:
Increase max_try
Increase cma_pop_multi
try a different submodel
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
Yang, Z. (2018). Unified M-estimation of fixed-effects spatial dynamic models with short panels. Journal of Econometrics, 205(2), 423-447.
data(data_n, data_nw) result <- msdpd(y = data_n$y, x = data_n$x, w1 = data_nw)
data(data_n, data_nw) result <- msdpd(y = data_n$y, x = data_n$x, w1 = data_nw)
Estimating threshold spatial dynamic panel data model with M-estimator
msdpdth( y, x, w1, th, correction = TRUE, max_try = 5, all_er = FALSE, true_range = FALSE, residual = FALSE, w3 = w1, w2 = w1, no_tf = FALSE, model = "full", th_type = "row", ini_val = NULL, rcpp = TRUE, cma_pop_multi = 1 )
msdpdth( y, x, w1, th, correction = TRUE, max_try = 5, all_er = FALSE, true_range = FALSE, residual = FALSE, w3 = w1, w2 = w1, no_tf = FALSE, model = "full", th_type = "row", ini_val = NULL, rcpp = TRUE, cma_pop_multi = 1 )
y |
matrix, containing regional index (first column), time index (second column) and dependent variable (third column). |
x |
matrix, containing regional index (first column), time index (second column) and regressors. |
w1 |
matrix, the spatial weight matrix. If w2 and w3 are supplied, the spatial weight matrix for spatial lag. |
th |
data.frame, containing regional index (first column, numeric) and grouping indicator(second column, logical). The number of rows should be the same as the number of regions. |
correction |
logical, whether to use adjusted score function. Default value is TRUE. |
max_try |
integer, maximum attempt for the solver. Default value is 5. |
all_er |
logical, whether to output Hessian and Gamma matrix based se. Ignored if correction is set to FALSE. Default value is FALSE. |
true_range |
logical, whether to used the accurate stationary check. Default value is FALSE due to performance reasons. |
residual |
logical, whether to output the residual. Default value is FALSE. |
w3 |
matrix, the spatial weight matrix for spatial error. Default value is the same as w1. |
w2 |
matrix, the spatial weight matrix for spatio-temporal lag. Default value is the same as w1. |
no_tf |
logical, whether to account for time effect. Default value is TRUE. |
model |
character, indicates the model used for estimation, can be "full", "slm", "sem", "sltl". See Details. |
th_type |
character, "row" or "col". Indicates whether the threshold is applied to the columns or the rows of the weight matrix. Default value is "row". |
ini_val |
vector msdpd object. A length 4 vector of the initial values of lambda1, lambda2, lambda3, rho or an msdpd object that contain the non-threshold estimation result. If unsupplied msdpd() will be called. |
rcpp |
logical, whether to use the rcpp implementation to calculate the score function. Default value is TRUE. |
cma_pop_multi |
integer, multiplier for the population size used in CMA-ES. Default value is 1. |
Estimating threshold spatial dynamic panel data model with extended Yang(2018)'s M-estimator
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"
"sem"
"sltl"
Some suggestions when the optimizer fails:
Increase max_try
Increase cma_pop_multi
try a different submodel
A list of estimation results of S3 class "msdpdth"
"coefficient" list, coefficients and standard errors
"model" character, model used for estimation
"vc_mat" matrix, variance-covariance matrix
"hes_mat" matrix, optional, Hessian matrix
"gamma_mat" matrix, optional, Gamma matrix
"residual" numeric, optional, residuals
Wu, J and Matsuda, Y. (2021). A threshold extension of spatial dynamic panel model with fixed effects. Journal of Spatial Econometrics 2,3
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th)
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th)
Print method for msdpd class
## S3 method for class 'msdpd' print(x, ...)
## S3 method for class 'msdpd' print(x, ...)
x |
msdpd class |
... |
other parameters |
Print method for msdpd class
A data.frame containing the coefficients and the corresponding standard error.
data(data_n, data_nw) result <- msdpd(y = data_n$y, x = data_n$x, w1 = data_nw) result
data(data_n, data_nw) result <- msdpd(y = data_n$y, x = data_n$x, w1 = data_nw) result
Print method for msdpdth class
## S3 method for class 'msdpdth' print(x, ...)
## S3 method for class 'msdpdth' print(x, ...)
x |
msdpdth class |
... |
other parameters |
Print method for msdpdth class
A data.frame containing the coefficients and the corresponding standard error.
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th) result
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th) result
Wald test for threshold spatial dynamic panel data model
wald_test(th_res)
wald_test(th_res)
th_res |
msdpdth class, generated by function msdpdth() |
Two sided Wald test for testing whether two estimated parameters for each group are equal
"h_0"
"h_1"
A list of p-values for each parameter.
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th) wald_test(result)
data(data_th, data_w) result <- msdpdth(y = data_th$y, x = data_th$x, w1 = data_w, th = data_th$th) wald_test(result)