Usage: |
{ab,e} = locpolex(x,xg,y,h{,kernfunc,omitx,z,zg})
|
Input: |
| x | n x d matrix of explanatory variables
|
| xg | m x d matrix of grid points at which the estimation will be done
|
| y | n x 1 vector representing the dependent variable
|
| h | scalar or d x 1 vector representing the bandwidth(s);
if h is a scalar, the same bandwidth is used across all
dimensions of x
|
| kernfunc | optional string, it contains the name of a function that
computes a kernel (e.g., a function from library "kernel");
if kernfunc is omitted or empty, the Gaussian kernel function "gau"
is used
|
| omitx | optional scalar, if non-zero, then the point at which we just
compute the local linear approximation is itself excluded from
the computation; this option is only usable if x == xg and it
is disabled (omitx == 0) by default
|
| z | optional n x d1 matrix, it can contain alternative data points that
are then used in computing the kernel distances instead of x
(e.g., z can be a subset of x); it can be used only together with zg;
by default, z = x
|
| zg | optional m x d1 matrix, it can contain alternative data points that
are then used in computing the kernel distances instead of xg
(e.g., z can be a subset of x); it can be used only together with z;
by default, zg = xg
|
Output: |
| ab | m x (d+1) matrix, the regression function (the first column) and
its first d derivatives at xg |
| e | n x 1 vector of regression residuals |