sysGmmModel: Constructor for '"sysGmmModels"' classes

Description Usage Arguments Value References Examples

View source: R/sysGmmModel.R

Description

It builds the object of either class "slinearGmm" or "snonlinearGmm", which are system of equations to be estimated by GMM.

Usage

1
2
3
4
5
sysGmmModel(g, h=NULL, theta0=NULL,
            vcov = c("iid", "HAC", "MDS", "CL"),
            vcovOptions=list(), centeredVcov = TRUE,
            data=parent.frame(),na.action="na.omit",
            survOptions=list())

Arguments

g

A list of linear or nonlinear regression formulas for each equation in the system.

h

A list of linear formulas for the instruments in each equation in the system.

theta0

A list of vectors of starting values. It is required only when the equations are nonlinear, in which case, it must be a list of named vector, with the names corresponding to the coefficient names in the regression formulas.

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. For type CL, clustered covariance matrix is computed. The options are then included in vcovOptions (see meatCL).

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

na.action

Action to take for missing values. If missing values are present and the option is set to "na.pass", the model won't be estimable.

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 "sampling" or "fequency".

Value

'sysGmmModel' returns an object of one of the subclasses of "sysGmmModels".

References

Hayashi, F. (2000). Econometrics, New Jersey: Princeton University Press.

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
set.seed(1122)
x1 <- rchisq(50,5)
x2 <- rchisq(50,5)
x3 <- rnorm(50)
x4 <- rnorm(50)
z1 <- .2*x1+rnorm(50)
z2 <- .2*x2+rnorm(50)
z3 <- rnorm(50)
z4 <- rnorm(50)
z5 <- rnorm(50)
y1 <- x1+rnorm(50)
y2 <- 2*x1+rnorm(50)
y3 <- 0.5*x2+rnorm(50)
dat <- data.frame(y1=y1,y3=y3,y2=y2, z1=z1,x1=x1,z2=z2,x2=x2,z3=z3,x3=x3,
                  x4=x4,z4=z4,z5=z5)

g1 <- y1~x1+x4; h1 <- ~z1+z2+z3+z4+x4
g2 <- y2~x1+x2+x3; h2 <- ~z1+z2+z3+z4+x3
g3 <- y3~x2+x3+x4; h3 <- ~z2+z3+z4+x3+x4
g <- list(g1,g2,g3)
h <- list(h1,h2,h3)

smodel <- sysGmmModel(g, h, data=dat)

## not really nonlinear
nlg <- list(y1~theta0+theta1*x1+theta2*x4,
            y2~alpha0+alpha1*x1+alpha2*x2+alpha3*x3,
            y3~beta0+beta1*x2+beta2*x3+beta3*x4)
theta0 <- list(c(theta0=1,theta1=2,theta2=3),
              c(alpha0=1,alpha1=2,alpha2=3, alpha3=4),
              c(beta0=1,beta1=2,beta2=3,beta3=4))
snmodel <- sysGmmModel(nlg, h, theta0, data=dat)

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