# kernapply-methods: A kernel smoothing utility for '"gelModels"' classes In gmm4: S4 Generalized Method of Moments

## Description

It either generates the optimal bandwidth and kernel weights or the smoothed moments of GEL models.

## Usage

 1 2 3 4 5 ## S4 method for signature 'gelModels' kernapply(x, theta=NULL, smooth=TRUE, ...) ## S4 method for signature 'gmmModels' kernapply(x, theta=NULL, ...) 

## Arguments

 x An object of class "gelModels". theta An optional vector of coefficients. For smooth=FALSE, it is used to obtain the optimal bandwidth. If NULL, the bandwidth is obtained using one step GMM with the identity matrix as weights. For smooth=TRUE, the coefficient is required since the function returns the smoothed moments at a given vector of coefficients. smooth By default, it returns the smoothed moment matrix. If FALSE, it computes the optimal bandwidth and kernel weights. ... Other arguments to pass. Currently not used

## Value

A list which contains:

 k 2\times 1 vector of scaling factors used for GEL asymptotics. See Anatolyev (2005). w The kernel weights as an object of class "tskernel". See kernel. bw A numeric bandwidth. kernel A character specifying th type of kernel used for smoothing smoothx Only when smooth=TRUE, a matrix of smoothed moments

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

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 13 14 15 16 17 18 19 20 data(simData) theta <- c(beta0=1,beta1=2) ## A linearGmm model1 <- gmmModel(y~x1, ~z1+z2, data=simData,vcov="HAC",vcovOptions=list(kernel="Bartlett")) ### get the bandwidth ### Notice that the kernel name is the not the same ### That's because a Truncated kernel for smoothing ### lead to a Bartlett kernel for the HAC of the moments ### See Smith (2011) kernapply(model1, smooth=FALSE) ### The GEL model contains the info when it is created model2 <- gmmToGel(model1, "EL") model2@wSpec kernapply(model2, theta)\$smoothx[1:5,] 

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