Description Usage Arguments Value References See Also Examples
View source: R/principal_curve.R
Fit a principal curve which describes a smooth curve that passes through the middle
of the data x
in an orthogonal sense. This curve is a non-parametric generalization
of a linear principal component. If a closed curve is fit (using smoother = "periodic_lowess"
)
then the starting curve defaults to a circle, and each fit is followed by a bias correction
suggested by Jeff Banfield.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | principal_curve(
x,
start = NULL,
thresh = 0.001,
maxit = 10,
stretch = 2,
smoother = c("smooth_spline", "lowess", "periodic_lowess"),
approx_points = FALSE,
trace = FALSE,
plot_iterations = FALSE,
...
)
## S3 method for class 'principal_curve'
lines(x, ...)
## S3 method for class 'principal_curve'
plot(x, ...)
## S3 method for class 'principal_curve'
points(x, ...)
whiskers(x, s, ...)
|
x |
a matrix of points in arbitrary dimension. |
start |
either a previously fit principal curve, or else a matrix
of points that in row order define a starting curve. If missing or NULL,
then the first principal component is used. If the smoother is
|
thresh |
convergence threshold on shortest distances to the curve. |
maxit |
maximum number of iterations. |
stretch |
A stretch factor for the endpoints of the curve, allowing the curve to grow to avoid bunching at the end. Must be a numeric value between 0 and 2. |
smoother |
choice of smoother. The default is
|
approx_points |
Approximate curve after smoothing to reduce computational time.
If |
trace |
If |
plot_iterations |
If |
... |
additional arguments to the smoothers |
s |
a parametrized curve, represented by a polygon. |
An object of class "principal_curve"
is returned. For this object
the following generic methods a currently available: plot, points, lines
.
It has components:
s |
a matrix corresponding to |
ord |
an index, such that |
lambda |
for each point, its arc-length from the beginning of the
curve. The curve is parametrized approximately by arc-length, and
hence is |
dist |
the sum-of-squared distances from the points to their projections. |
converged |
A logical indicating whether the algorithm converged or not. |
num_iterations |
Number of iterations completed before returning. |
call |
the call that created this object; allows it to be
|
Hastie, T. and Stuetzle, W., Principal Curves, JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, doi: 10.2307/2289936 (PDF).
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.