Learn R Programming

GMC (version 0.1.2)

estimate_EY_X_squared: Estimate E[(E[Y|X])^2] using kernel regression

Description

This function estimates the squared conditional expectation E[(E[Y|X])^2] using Nadaraya-Watson regression with Gaussian kernel.

Usage

estimate_EY_X_squared(X, Y, grid_length = 10000, kernel = dnorm)

Value

A list containing:

estimate

Estimated value of E[(E[Y|X])^2]

bandwidth

Selected kernel bandwidth

mean_Y

Mean of Y

var_Y

Variance of Y

EY_grid

Grid values of E[Y|X]

fx_grid

Estimated marginal density of X

x_grid

Grid points used in estimation

Arguments

X

A numeric vector of predictors.

Y

A numeric vector of responses.

grid_length

Number of grid points for numerical integration (default = 10000).

kernel

Kernel function (default is dnorm).

References

Zheng, S., Shi, N.Z., & Zhang, Z. (2012). Generalized Measures of Correlation for Asymmetry, Nonlinearity, and Beyond. Journal of the American Statistical Association, 107(499), 1239-1252. tools:::Rd_expr_doi("10.1080/01621459.2012.710509")