gelModel: Constructor for '"gelModels"' classes

Description Usage Arguments Value References Examples

View source: R/gel.R

Description

It builds the object of either class "linearGel", "nonlinearGel", "functionGel" or "formulaGel". This is the first step before running any estimation algorithm.

Usage

1
2
3
gelModel(g, x=NULL, gelType, rhoFct=NULL, theta0=NULL,grad=NULL,
        vcov = c("MDS", "iid", "HAC"),vcovOptions=list(),
        centeredVcov = TRUE, data=parent.frame())

Arguments

g

A function of the form g(θ,x) and which returns a n \times q matrix with typical element g_i(θ,x_t) for i=1,...q and t=1,...,n. This matrix is then used to build the q sample moment conditions. It can also be a formula if the model is linear (see detailsbelow).

x

The matrix or vector of data from which the function g(θ,x) is computed. If "g" is a formula, it is an n \times Nh matrix of instruments or a formula (see details below).

gelType

A character string specifying the type of GEL. The available types are "EL", "ET", "EEL" and "HD".

rhoFct

An optional function that return ρ(v). This is for users who want a GEL model that is not built in the package. The four arguments of the function must be "gmat", the matrix of moments, "lambda", the vector of Lagrange multipliers, "derive", which specify the order of derivative to return, and k a numeric scale factor required for time series and kernel smoothed moments.

theta0

A k \times 1 vector of starting values. It is required only when "g" is a function, a formula or a list of formulas

grad

A function of the form G(θ,x) which returns a q\times k matrix of derivatives of \bar{g}(θ) with respect to θ. By default, the numerical algorithm numericDeriv is used. It is of course strongly suggested to provide this function when it is possible. This gradient is used to compute the asymptotic covariance matrix of \hat{θ} and to obtain the analytical gradient of the objective function if the method is set to "CG" or "BFGS" in optim and if "type" is not set to "cue". If "g" is a formula, the gradiant is not required (see the details below).

vcov

Assumption on the properties of the moment conditions. By default, they are weakly dependant processes. For MDS, we assume that the conditions are martingale difference sequences, which implies they are serially uncorrelated, but may be heteroscedastic. There is a difference between iid and MDS only when g is a formula. In that case, residuals are assumed homoscedastic as well as serially uncorrelated.

vcovOptions

A list of options for the covariance matrix of the moment conditions. See vcovHAC for the default values.

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).

Value

'gmmModel' returns an object of one of the subclasses of "gmmModels".

References

Anatolyev, S. (2005), GMM, GEL, Serial Correlation, and Asymptotic Bias. Econometrica, 73, 983-1002.

Kitamura, Yuichi (1997), Empirical Likelihood Methods With Weakly Dependent Processes. The Annals of Statistics, 25, 2084-2102.

Kitamura, Y. and Otsu, T. and Evdokimov, K. (2013), Robustness, Infinitesimal Neighborhoods and Moment Restrictions. Econometrica, 81, 1185-1201.

Newey, W.K. and Smith, R.J. (2004), Higher Order Properties of GMM and Generalized Empirical Likelihood Estimators. Econometrica, 72, 219-255.

Smith, R.J. (2011), GEL Criteria for Moment Condition Models. Econometric Theory, 27(6), 1192–1235.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(simData)
theta <- c(beta0=1,beta1=2)

## A linearGmm
model1 <- gelModel(y~x1, ~z1+z2, gelType="EL", data=simData)
model1

## A nonlinearGmm
g <- y~beta0+x1^beta1
h <- ~z1+z2
model2 <- gelModel(g, h, theta0=c(beta0=1, beta1=2), data=simData, gelType="ET")
model2

gmm4 documentation built on Dec. 6, 2019, 3:01 a.m.