gmm4 {momentfit} | R Documentation |
GMM estimation
Description
The main functions and methods to fit any model with GMM. As opposed to
gmmFit
, models don't need to be created. It is all done by
the functions. It is meant to be more user friendly. This document
needs to changed. It is just a copy and paste from the gmm package
Usage
gmm4(g, x, theta0 = NULL, grad = NULL,
type = c("twostep", "iter", "cue", "onestep"),
vcov = c("iid", "HAC", "MDS", "TrueFixed", "CL"),
initW = c("ident", "tsls", "EbyE"), weights = "optimal",
itermaxit = 50, cstLHS=NULL, cstRHS=NULL,
vcovOptions=list(), survOptions=list(),
itertol = 1e-07, centeredVcov = TRUE,
data = parent.frame(), ...)
## S4 method for signature 'formula'
tsls(model, x, vcov = c("iid", "HAC", "MDS", "CL"),
vcovOptions=list(), survOptions=list(), centeredVcov = TRUE,
data = parent.frame())
## S4 method for signature 'list'
tsls(model, x=NULL, vcov = c("iid", "HAC", "MDS",
"CL"), vcovOptions=list(), survOptions=list(),
centeredVcov = TRUE, data = parent.frame())
## S4 method for signature 'list'
ThreeSLS(model, x=NULL, vcov = c("iid", "HAC", "MDS",
"CL"), vcovOptions=list(), survOptions=list(),
centeredVcov = TRUE, data = parent.frame())
Arguments
model |
A formula or a list of formulas. |
g |
A function of the form |
x |
The matrix or vector of data from which the function
|
theta0 |
A |
grad |
A function of the form |
type |
What GMM methods should we use? for
|
vcov |
Assumption on the properties of the random vector x. By
default, x is a weakly dependant process. The "iid" option will avoid
using the HAC matrix which will accelerate the estimation if one is
ready to make that assumption. The option "TrueFixed" is used only
when the matrix of weights is provided and it is the optimal one. For
type |
initW |
How should be compute the initial coefficient vector in the first. It only makes a difference for linear models for which the choice is GMM with identity matrix or two-stage least quares. |
weights |
What weighting matrix to use? The
choices are |
itermaxit |
Maximum iterations for iterative GMM |
itertol |
Tolance for the stopping rule in iterative GMM |
centeredVcov |
Should the moment function be centered when computing its covariance matrix. Doing so may improve inference. |
data |
A data.frame or a matrix with column names (Optional). |
cstLHS |
The left hand side of the constraints to impose on the
coefficients. See |
cstRHS |
The right hand side of the constraints to impose on the
coefficients. See |
vcovOptions |
A list of options for the covariance matrix of the
moment conditions. See |
survOptions |
If needed, a list with the type of survey weights and
the weights as a numeric vector, data.frame or formula. The type is either
|
... |
Arguments to pass to |
Value
It returns an object of class "gmmfit"
References
Zeileis A (2006), Object-oriented Computation of Sandwich Estimators. Journal of Statistical Software, 16(9), 1–16. URL doi: 10.18637/jss.v016.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.
Hansen, L.P. (1982), Large Sample Properties of Generalized Method of Moments Estimators. Econometrica, 50, 1029-1054,
Hansen, L.P. and Heaton, J. and Yaron, A.(1996), Finite-Sample Properties of Some Alternative GMM Estimators. Journal of Business and Economic Statistics, 14 262-280.
See Also
Examples
data(simData)
res <- gmm4(y~x1, ~z1+z2, vcov="MDS", type="iter", data=simData)
res