Usage: |
{f,variance}=lplocband(x,y,h,xgrid,OrderDer,p{,RidgeCoef{,Kernel}})
|
Input: |
| x | n x k matrix, the independent variable.
|
| y | n x 1 vector, the dependent variable
|
| h | bandwidth which may be local or global. Possible dimensions:
- m x k matrix (local bandwidths)
- 1 x k vector (global bandwidths)
- scalar (global bandwidth)
|
| xgrid | m x k matrix, grid where you
estimate the dependent variable.
|
| OrderDer | scalar, order of the derivative you want to estimate. This order
depends on the dimension of the independent variables.
- OrderDer = 0 corresponds always to the function itself
- 1 <= OrderDer <= k corresponds to the first derivatives
- k < OrderDer <= 2*k corresponds to the non mixed
second derivatives
- OrderDer > 2*k corresponds to the mixed derivatives
|
| p | scalar, degree of the polynomials (1<=p<=2). Take care that if you want to
estimate second derivatives, p must be equal to 2.
|
| RidgeCoef | optional scalar representing the Ridge coefficient if ridge regression
is desired.
|
| Kernel | optional string defining the kernel function used. The kernel functions
available are Quartic ("Qua"), Epanechnikov ("Epa") and Triangle ("Tri")
|
Output: |
| f | m x 1 vector representing the estimated OrderDer-th derivative of
E(y|x) at each point on xgrid. |
| variance | m x 1 vector containing the estimate of the variance of this estimate
divided by sigma2, where sigma2 is the variance of the y's. |