|
Algorithm 1: Computing the Locally Efficient Score Function |
| The first two steps are done only once. |
Posit a model for η2(ε, x) which has mean zero, and calculate (5), calling the result S*(X, Y, D). Use S*(·) in place of S(·) in (6)-(7).
Estimate fX|D(x, d) by a kernel density estimate among the data with Di = d, with result f̂x|D(x, d).
|
|
| The rest of the steps are done iteratively in the estimation algorithm. |
Solve
to obtain π̂0 and set π̂1 = 1 − π̂0.
In the definition of κ(x, y) in (6), form κ̂(x, y) by replacing πd by π̂d. Define κ̂i = κ̂(Xi, Yi).
Define f̂di = f̂D|X, Y(d, Xi, Yi) = NdH(d, Xi, Yi)κ̂i/(Nπ̂d).
For any function h(d, x, y) in (6), estimate E{h(D, X, Y) | X, D = d) by nonparametric regression among observations with Di = d.
For any function h(d, x, y) in (6), estimate E{h(D, X, Y) | D = d) as
.
For any function h(d, x, y) in (6), estimate E{h(D, Y, X)|ε, X} by
.
For any function h(d, x, y) in (6), estimate Etrue{h(D, X, Y) | X) by
.
|
| Application to the terms in (6) yields ĝ(εi, Xi) and v̂d, and we then form
. |
| We have described the algorithm when X is continuous. When X is discrete, one simply replaces the density estimators and various nonparametric regressions with the corresponding averages associated with the different x values. |