The cross-validation function with leave-one-out estimator.
Parameters : | bw: array_like :
func: callable function :
|
---|---|
Returns : | L: 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]
..math:: CV(h)=n^{-1}sum_{i=1}^{n}(Y_{i}-g_{-i}(X_{i}))^{2}
where g_{-i}(X_{i}) is the leave-one-out estimator of g(X) and h is the vector of bandwidths