Closed-form mean squared error and optimal window in the evenly spread design
Source:R/bandwidth.R
cdd_risk_ideal.RdEvaluates the mean squared error of the two extrapolants in the evenly
spread design of the paper: errors with common variance sigma2, equal
weights, and rho comparison respondents per year spread evenly over a
window of h years that ends k years before the exposed survey. For each
extrapolant the function returns the squared bias plus the variance of the
extrapolated mean. For the kernel mean the bias is the slope beta times
the distance from the centre of the window to the target, plus a curvature
term bounded through M; its variance is that of a simple average of the
window. For the local-linear fit the bias is the worst case under the
curvature bound M, which grows with the square of k and with the window
length, and the variance is that of a regression line predicted k years
beyond the window, which grows quickly as the window shortens relative to
k. The variance of the exposed mean is the same for both and is left out.
Value
A data frame with h, the two mean squared errors (risk0,
risk1), and their components. The attribute "h_star" holds the
minimizing h for each order over the grid supplied; the attribute
"h_foc" holds the solutions of the two first-order conditions (NA
when beta = 0 or M = 0, where the optimal window is unbounded).
Details
The attributes of the result give the window that minimizes each expression. A longer window is optimal when the errors are noisy, respondents are few, or the trend is close to flat (kernel mean) or close to linear (local-linear fit). The closed-form expressions and their derivation are in the article that accompanies the package.