# Projection pursuit example; simulated data set.seed(14) # To duplicate example x1 = runif(400,-1,1) x2 = runif(400,-1,1) eps = rnorm(400,0,.2) # Y=X1*X2+error y = x1*x2+eps x = cbind(x1,x2) out = ppr(x,y, nterms = 1, max.terms = 4) out out = ppr(x,y, nterms = 3, max.terms = 4) summary(out) par(oma=c(4,0,0,0),pch=1,mfrow=c(3,2)) plot(x1,y,sub="Y vs X1") plot(x2,y,sub="Y vs X2") plot(out) plot(x1*x2, out$fitted+mean(y), sub = "fitted Y-values vs. x1*x2", ylab="y") mtext("Projection Pursuit example; simulated data",outer=T, side=1,line=2)