data(eggs)
uni.C <- sort( unique(eggs$Code) )
ind <- 8
Data <- eggs[eggs$Code==uni.C[ind], ]
x0 <- Data$x
y0 <- Data$y
Res1 <- adjdata(x0, y0, ub.np=3000, len.pro=1/20)
x1 <- Res1$x
y1 <- Res1$y
dev.new()
plot( Res1$x, Res1$y, asp=1, cex.lab=1.5, cex.axis=1.5,
xlab=expression(italic("x")), ylab=expression(italic("y")) )
# \donttest{
Res2 <- lmPE(x1, y1, simpver=NULL, dev.angle=NULL, unit="cm")
summary( Res2$lm.tse )
Res2$RMSE.scaled / 2
if(FALSE){
dev.new()
xg1 <- seq(-1, 1, len=1000)
yg1 <- TSE(P=Res2$par, x=xg1, simpver=NULL)
xg2 <- seq(1, -1, len=1000)
yg2 <- -TSE(P=Res2$par, x=xg2, simpver=NULL)
plot(xg1, yg1, asp=1, type="l", col=2, ylim=c(-1,1), cex.lab=1.5, cex.axis=1.5,
xlab=expression(italic(x)), ylab=expression(italic(y)))
lines(xg2, yg2, col=4)
dev.new()
plot(Res2$x.obs, Res2$y.obs, asp=1, cex.lab=1.5, cex.axis=1.5,
xlab=expression(italic(x)), ylab=expression(italic(y)), type="l")
lines(Res2$x.obs, Res2$y.pred, col=2)
dev.new()
plot(Res2$x.stand.obs, Res2$y.stand.obs, asp=1, cex.lab=1.5, cex.axis=1.5,
xlab=expression(italic(x)), ylab=expression(italic(y)), type="l")
lines(Res2$x.stand.obs, Res2$y.stand.pred, col=2)
}
Res3 <- lmPE(x1, y1, simpver=NULL, dev.angle=seq(-0.05, 0.05, by=0.0001), unit="cm")
summary( Res3$lm.tse )
Res3$epsilon
Res3$RMSE.scaled / 2
Res4 <- lmPE(x1, y1, simpver=1, dev.angle=NULL, unit="cm")
summary( Res4$lm.tse )
# }
graphics.off()
Run the code above in your browser using DataLab