Re: [R] Problem with Princurve

2011-06-07 Thread guy33
guy33 wrote: > > As suggested above, specifying useful starting points definitely helps in > the case of: > > x <- seq(0,2*pi, length=1000) > x <- cbind(x/(2*pi), sin(x)) > fit1 <- principal.curve(x, plot = TRUE, trace = TRUE, maxit = 100, start = >

Re: [R] Problem with Princurve

2011-06-07 Thread guy33
As suggested above, specifying useful starting points definitely helps in the case of: x <- seq(0,2*pi, length=1000) x <- cbind(x/(2*pi), sin(x)) fit1 <- principal.curve(x, plot = TRUE, trace = TRUE, maxit = 100, start = cbind(sort(x[,1]), rep(1, nrow(x Interestingly, I find that if you sim

Re: [R] Fitting spline using Pspline

2011-05-29 Thread guy33
ooth.spline: x=array(0,1000) y=array(0,1000) for (i in 1:1000){ x[i] = i/1000 y[i] = (x[i]*(1-x[i]))^.5 * sin(2*pi*(1.05/(x[i]+.05))) } plot(x,y) fit = sm.spline(x, y, norder=2, cv=FALSE) lines(fit$x,fit$y) fit2 = smooth.spline(x, y, cv=FALSE) lines(fit2$x,fit2$y) What do you make

[R] Fitting spline using Pspline

2011-05-29 Thread guy33
know if this is just a limitation, or am I missing something. The dataset I'd like to run it on contains n=6000. If it is a limitation, does anyone know of any other ways to do this that would accommodate a larger dataset (ideally with generalized cross validation)? Thanks! -guy33 -- View

[R] Problem with Princurve

2011-05-19 Thread guy33
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 m