It looks like the confint in sandbox.nonparametric kernels have hard coded 1 sigma confidence interval, instead of critical value norm.isf(alpha/2)
I'm not able to reproduce the standard errors of Stata yet, but it looks like they are in the same neighborhood. (I haven't tried to figure out the details of the pilot bandwidth of Stata).
Mean prediction for epa2 with fixed bandwidth=1 seems to match.
In my initial plot of confints for all kernels the confidence interval looks much too small. Compared to Stata the implied standard deviation for gaussian is much smaller (about half with pilot bandwidth=1).
Staring at the source, I don't don't understand enough and cannot figure out what the corresponding formulas in Haerdle's book are.
updated link http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/anr/anrhtmlframe62.html
Haerdle's sigma_hat(x) is misleading ?, because in step 2 it uses (Y_i - m_hat(x))**2 instead of what I expected
and what's implemented in kernels: (Y_i - m_hat(X_i))**2
(Y_i - m_hat(x))**2
(Y_i - m_hat(X_i))**2
Bruce Hansen has a clearer and shorted description of the estimate of the conditional error variance sigma(x)
Bruce uses just a kernel regression on e_hat**2, where e_hat = Y_i - m_hat(X_i) to get the error variance.
e_hat = Y_i - m_hat(X_i)
Note: I think we assume heteroscedasticity here (based on comments by Bruce Hansen and the calculation). Assuming a constant sigma_error, it could just be estimated by the mean of e_hat**2, but in my test case there is a large heteroscedasticity and the constant sigma assumption doesn't produce good results.
I'm going to add benchmark results from Stata, but in the kernels I checked so far only the predicted values (conditional expectation) looks correct.
BUG: fix kernels smoothconf standard error, rename Biweight.smoothcon…
…f see #1231
TST: kernels smoothconf against Stata, confint is only approx. see #1231
Not exactly verified but se and confint are approximately the same as Stata's which uses a different se estimator
PR #1233 merged in 62a7c7e