kern2 function

Kernel regression version 2 with optional residuals and gradients with regtype="ll" for local linear, bwmethod="cv.aic" for AIC-based bandwidth selection.

Kernel regression version 2 with optional residuals and gradients with regtype="ll" for local linear, bwmethod="cv.aic" for AIC-based bandwidth selection.

kern2( dep.y, reg.x, tol = 0.1, ftol = 0.1, gradients = FALSE, residuals = FALSE )

Arguments

  • dep.y: Data on the dependent (response) variable
  • reg.x: Data on the regressor (stimulus) variables
  • tol: Tolerance on the position of located minima of the cross-validation function (default =0.1)
  • ftol: Fractional tolerance on the value of cross validation function evaluated at local minima (default =0.1)
  • gradients: Make this TRUE if gradients computations are desired
  • residuals: Make this TRUE if residuals are desired

Returns

Creates a model object mod' containing the entire kernel regression output. Type names(mod)to reveal the variety of outputs produced bynpreg' of the `np' package. The user can access all of them at will by using the dollar notation of R.

Note

This is version 2 ("ll","cv.aic") of a work horse for causal identification.

Examples

## Not run: set.seed(34);x=matrix(sample(1:600)[1:50],ncol=2) require(np); options(np.messages=FALSE) k1=kern(x[,1],x[,2]) print(k1$R2) #prints the R square of the kernel regression ## End(Not run)

References

Vinod, H. D.'Generalized Correlation and Kernel Causality with Applications in Development Economics' in Communications in Statistics -Simulation and Computation, 2015, tools:::Rd_expr_doi("10.1080/03610918.2015.1122048")

See Also

See kern_ctrl.

Author(s)

Prof. H. D. Vinod, Economics Dept., Fordham University, NY

  • Maintainer: H. D. Vinod
  • License: GPL (>= 2)
  • Last published: 2023-10-09

Useful links