[R] Problem with Princurve

guy33 david.reshef at magd.ox.ac.uk
Thu May 19 15:43:28 CEST 2011


Hey all,

I can't seem to get the princurve package to produce correct results, even
in the simplest cases.  For example, if you just generate a 1 period
noiseless sine wave, and ask for the principal curve and plot, the returned
curve is clearly wrong (doesn't follow the sine wave).  Here's my code:

library(princurve)
x <- runif(1000,0,2*pi); x <- cbind(x/(2*pi), sin(x))
fit1 <- principal.curve(x, plot = TRUE)

Anyone have any suggestions?  If you run this code, do you get the correct
principal curve?

Any help would be really appreciated!
-guy33 

--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-Princurve-tp3535721p3535721.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list