local_lin: Estimates E(Y|X) at the observed X by local linear...

local_linR Documentation

Estimates E(Y|X) at the observed X by local linear regression. We use a Gaussian kernel, and also output the kernel estimator of the density of X.

Description

Estimates E(Y|X) at the observed X by local linear regression. We use a Gaussian kernel, and also output the kernel estimator of the density of X.

Usage

local_lin(data, h = 1)

Arguments

data

is an environment variable containing the relevant data: - data$Y a matrix of size n x Tmax containing the values of the dependent variable Y. - data$X an array of size n x Tmax x dimX containing the values of the covariates X.

h

(default 1) the bandwidth for the local linear regressions. We increase it at points where the regression is degenerate otherwise.

Value

a list containing. - condlMeans: a vector of length n containing the estimates for P(S = j - 1 | X) at each observation. - densityEstimate: a vector of length n containing, at each row (individual), the estimated density for having covariates X.


cgaillac/MarginalFElogit documentation built on Dec. 24, 2024, 3:23 p.m.