data(whitespruce)
uni.C <- sort( unique(whitespruce$Code) )
Data <- whitespruce[whitespruce$Code==uni.C[12], ]
x0 <- Data$x
y0 <- Data$y
Res1 <- adjdata(x0, y0, ub.np=200, len.pro=1/20)
x1 <- Res1$x
y1 <- Res1$y
plot( x1, y1, asp=1, cex.lab=1.5, cex.axis=1.5, type="l",
col="grey73", lwd=2,
xlab=expression(italic("x")), ylab=expression(italic("y")) )
# \donttest{
x0.ini <- mean( x1 )
y0.ini <- mean( y1 )
theta.ini <- c(0, pi/4, pi/2)
a.ini <- mean(c(max(x1)-min(x1), max(y1)-min(y1)))/2
k.ini <- 1
n.ini <- c(1.5, 2, 2.5)
ini.val <- list( x0.ini, y0.ini, theta.ini, a.ini, k.ini, n.ini )
Res2 <- fitSuper(x=x1, y=y1, ini.val=ini.val, unit="cm", par.list=FALSE,
stand.fig=FALSE, angle=NULL, fig.opt=TRUE,
control=list(reltol=1e-20, maxit=20000), np=2000)
Res2$par
Res2$r.sq
# }
graphics.off()
Run the code above in your browser using DataLab