Generalized method of moment estimation for system of equations
Functions to estimate a system of equations based on GMM.
sysGmm(g, h, wmatrix = c("optimal","ident"), vcov=c("MDS", "HAC", "CondHom", "TrueFixed"), kernel=c("Quadratic Spectral","Truncated", "Bartlett", "Parzen", "Tukey-Hanning"), crit=10e-7,bw = bwAndrews, prewhite = FALSE, ar.method = "ols", approx="AR(1)", tol = 1e-7, model=TRUE, X=FALSE, Y=FALSE, centeredVcov = TRUE, weightsMatrix = NULL, data, crossEquConst = NULL, commonCoef = FALSE) five(g, h, commonCoef = FALSE, data = NULL) threeSLS(g, h, commonCoef = FALSE, data = NULL) sur(g, commonCoef = FALSE, data = NULL) randEffect(g, data = NULL)
g |
A possibly named list of formulas |
h |
A formula if the same instruments are used in each equation or a list of formulas. |
wmatrix |
Which weighting matrix should be used in the objective function. By default, it is the inverse of the covariance matrix of g(θ,x). The other choice is the identity matrix. |
vcov |
Assumption on the properties of the moment vector. By default, it is a martingale difference sequence. "HAC" is for weakly dependent processes and "CondHom" implies conditional homoscedasticity. The option "TrueFixed" is used only when the matrix of weights is provided and it is the optimal one. |
kernel |
type of kernel used to compute the covariance matrix of the vector of sample moment conditions (see |
crit |
The stopping rule for the iterative GMM. It can be reduce to increase the precision. |
bw |
The method to compute the bandwidth parameter. By default it is |
prewhite |
logical or integer. Should the estimating functions be prewhitened? If |
ar.method |
character. The |
approx |
A character specifying the approximation method if the bandwidth has to be chosen by |
tol |
Weights that exceed |
model, X, Y |
logical. If |
centeredVcov |
Should the moment function be centered when computing its covariance matrix. Doing so may improve inference. |
weightsMatrix |
It allows users to provide |
data |
A data.frame or a matrix with column names (Optional). |
commonCoef |
If true, coefficients accross equations are the same |
crossEquConst |
Only used if the number of regressors are the same
in each equation. It is a vector which indicates which coefficient are
constant across equations. The order is 1 for Intercept and 2 to k as
it is formulated in the formulas |
This set of functions implement the estimation of system of equations as presented in Hayashi (2000)
'sysGmm' returns an object of 'class' '"sysGmm"'
The functions 'summary' is used to obtain and print a summary of the results. It also compute the J-test of overidentying restriction
The object of class "sysGmm" is a list containing at least:
coefficients |
list of vectors of coefficients for each equation |
residuals |
list of the residuals for each equation. |
fitted.values |
list of the fitted values for each equation. |
vcov |
the covariance matrix of the stacked coefficients |
objective |
the value of the objective function \| var(\bar{g})^{-1/2}\bar{g}\|^2 |
terms |
The list of |
call |
the matched call. |
y |
If requested, a list of response variables. |
x |
if requested, a list of the model matrices. |
model |
if requested (the default), a list of the model frames. |
Zeileis A (2006), Object-oriented Computation of Sandwich Estimators. Journal of Statistical Software, 16(9), 1–16. URL https://www.jstatsoft.org/v16/i09/.
Andrews DWK (1991), Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation. Econometrica, 59, 817–858.
Newey WK & West KD (1987), A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica, 55, 703–708.
Newey WK & West KD (1994), Automatic Lag Selection in Covariance Matrix Estimation. Review of Economic Studies, 61, 631-653.
Hayashi, F. (2000), Econometrics. Princeton University Press.
data(wage) eq1 <- LW~S+IQ+EXPR eq2 <- LW80~S80+IQ+EXPR80 g2 <- list(Wage69=eq1, WAGE80=eq2) h2 <- list(~S+EXPR+MED+KWW, ~S80+EXPR80+MED+KWW) res <- sysGmm(g2, h2, data=wage, commonCoef=TRUE) summary(res) res2 <- sysGmm(g2, h2, data=wage) summary(res2) five(g2, h2, data=wage) threeSLS(g2, h2[[1]], data=wage) sur(g2, data=wage) randEffect(g2, data=wage) ## Cross-Equation restrictions ## All but the intercept are assumed to be the same res <- sysGmm(g2, h2, data=wage, crossEquConst = 2:4) summary(res)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.