Usage: |
{f,band}=EBBS(x,y,xgrid,hgrid,OrderDer,p{,msespan{,nterms{,bandspan{,varest{,Kernel{,J2{,J1}}}}}})
|
Input: |
| x | n x k matrix, the independent variables.
|
| y | n x 1 vector, the dependent variable.
|
| xgrid | m x k matrix, grid where you
estimate the dependent variable.
|
| hgrid | l x 1 vector representing a grid of bandwidths. For each point of xgrid, this
algorithm determines the best bandwidth in hgrid. Take care that
the first J1 values and the last J2 values are excluded.
Moreover, as the data are standardized, the grid is always
represented as a vector even if the data are multivariate.
|
| 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.
|
| msespan | optional scalar, represents the span for smoothing the mse.
|
| nterms | optional scalar, number of terms in the bias model.
The bias model is: <BR>
E(fhat(xh)) = b_0+b_1 h^(p+1)+...+ b_nterms h^(p + nterms)
|
| bandspan | optional scalar, bandwidth for smoothing the bandwidth. By default, we do not
smooth the bandwidth.
If this smoothing is not desired then this parameter
should be negative (<= 0).
|
| varest | optional m x 1 vector, estimates the variance function at each point of xgrid.
If not given, varest is computed in the quantlet by a local
polynomial regression of the errors obtained by smoothing
the raw data with EBBSmain.
|
| Kernel | optional string defining the kernel function used in the local
polynomial estimation. The available kernel functions are Quartic ("Qua") (default),
Epanechnikov ("Epa") and Triangle ("Tri").
|
| J2 | optional scalar, number of bandwidth points to the right used for
fitting a curve to estimate bias at one bandwidth.
|
| J1 | optional scalar, number of bandwidth points to the left used for
fitting a curve to estimate bias at one bandwidth.
|
Output: |
| f | m x 1 vector containing the estimated OrderDer-th derivative of
E(y|x) at each point on xgrid. |
| band | m x 1 vector of bandwidths, entails the bandwidth
at each point of xgrid. |