Implementation of the estimator of the generalized method of moments by Hansen.
Usage
gmm(X, u, dim, guess, lower, upper, maxiter=30, tol1=1e-3,
tol2=1e-3)
Arguments
X
a ts object containing a sample path of an sde.
u
a function of x, y, and theta and DELTA; see details.
dim
dimension of parameter space; see details.
guess
initial value of the parameters; see details.
lower
lower bounds for the parameters; see details.
upper
upper bounds for the parameters; see details.
tol1
tolerance for parameters; see details.
tol2
tolerance for Q1; see details.
maxiter
maximum number of iterations at the second stage; see details.
Details
The function gmm minimizes at the first stage
the function Q(theta) = t(Gn(theta)) * Gn(theta) with respect to
theta, where Gn(theta) = mean(u(X[i+1], X[i], theta)).
Then a matrix of weights W is obtained by inverting an estimate
of the long-run covariance and the quadratic function
Q1(theta) = t(Gn(theta)) * W * Gn(theta) with starting value theta1 (the solution
at the first stage). The second stage is iterated until the first of these
conditions verifies: (1) that the number of iterations reaches maxiter; (2) that the Euclidean
distance between theta1 and theta2 < tol1; (3) that Q1 < tol2.
The function u must be a function of (u,y,theta,DELTA) and should
return a vector of the same length as the dimension of the parameter space. The sanity checks
are left to the user.
Value
x
a list with parameter estimates, the value of Q1 at the minimum, and the Hessian
Author(s)
Stefano Maria Iacus
References
Hansen, L.P. (1982) Large Sample Properties of Generalized Method of Moments Estimators,
Econometrica, 50(4), 1029-1054.