Hastie-Stuetzle algorithm (ESL eqs 14.61-14.62): from the first principal
component line, alternate smoothing each coordinate on the projection index
(cubic smoothing spline with the given penalty) and projecting the points
onto the fitted polyline, re-parametrised by arc length. The iteration can
settle into a small 2-cycle, so the defaults follow princurve
(thresh = 0.001, maxit = 10).
Usage
morie_esl_principal_curve(X, penalty = 1, max_iter = 10, tol = 0.001)
Arguments
- X
Data, N by p.
- penalty
Smoothing-spline penalty on the arc-length scale.
- max_iter, tol
Iteration controls.
Value
Named list: lambda, fitted, curve, distance, distance_path,
iterations, converged.
References
Hastie, T. & Stuetzle, W. (1989). JASA 84, 502-516.
Examples
th <- (0:39) / 39 * pi
morie_esl_principal_curve(cbind(cos(th), sin(th)), penalty = 0.05)$distance
#> [1] 0.01167996