statsmodels.nonparametric.kernel_regression.KernelCensoredReg.cv_loo¶
-
KernelCensoredReg.
cv_loo
(bw, func)[source]¶ The cross-validation function with leave-one-out estimator
Parameters: - bw (array_like) – Vector of bandwidth values
- func (callable function) – Returns the estimator of g(x).
Can be either
_est_loc_constant
(local constant) or_est_loc_linear
(local_linear).
Returns: L – The value of the CV function
Return type: float
Notes
Calculates the cross-validation least-squares function. This function is minimized by compute_bw to calculate the optimal value of bw
For details see p.35 in [2]
CV(h)=n−1n∑i=1(Yi−g−i(Xi))2where g−i(Xi) is the leave-one-out estimator of g(X) and h is the vector of bandwidths