princurve

Build Status AppVeyor Build Status CRAN_Status_Badge Coverage Status

Fitting a principal curve to a data matrix in arbitrary dimensions.

Example

We generate some example data:

t <- runif(100, -1, 1)
x <- cbind(t, t ^ 2) + rnorm(200, sd = 0.05)
colnames(x) <- c("dim1", "dim2")

plot(x)

A principal curve can be fit to the data as follows:

library(princurve)
fit <- principal_curve(x)
plot(fit); whiskers(x, fit$s, col = "gray")

Check out ?principal_curve for more information on the specific outputs of principal_curve().

Latest changes in princurve 2.1.0 (unreleased)

Check NEWS.md for full list of changes.

References

Hastie, T. and Stuetzle, W., Principal Curves, JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, DOI: 10.2307/2289936 (PDF)