[R] Help with Projection Pursuit, ppr().

gbrajovic@entelchile.net gbrajovic at entelchile.net
Sat Sep 2 00:36:34 CEST 2000


Recently, I installed the 1.1.0 version of R (for Windows), since it includes an implementation of Projection Pursuit (I failed to write my own version of PP as a standalone C++ program).

As far as I know, R offers two interfaces/sintax for the ppr() function. The first one requieres a regression formula and a data frame. The other requieres X, a matrix with the explanatory variables, and Y, wich I presume is a matrix containing the responses (documentation for ppr doesn't explain what kind of object is Y). 

My problems are:

a)I can't use the "non regression formula" ppr(), since it returns an error condition I cannot understand. This is what i did/got:

> library(modreg)
> X <- matrix(scan("miX_e.txt", 0), ncol=2, byrow=TRUE)
Read 450 items
> Y <- matrix(scan("g1_sr_e.txt", 0), ncol=1, byrow=TRUE)
Read 225 items
> g1.ppr <-ppr(X,Y, nterms=3, max.terms=5)
Error in matrix(smod[q + 6 + p * ml + 1:(q * mu)], q, mu, dimnames = list(ynames,  : 
        length of dimnames[1] not equal to array extent

Where "miX_e.txt" is a file containing 225 rows (225 cases for training) with 2 columns (2 explanatory variables), and "g1_sr_e.txt" is a file with one column (1 response) and 225 rows (one for each of the 225 trining cases). I presume the problem is related to Y, since its use is not explained in the ppr documentation, and I'm guessing its a matrix with the responses.

Any help about this? (By the way, the test data is the noiseless g1 function published by Hwang).

b)I can use the "regression formula" ppr() succesfuly, but I would like a non parametric approach (I guess that the need of a regression formula makes it "parametric"). How does ppr() use this regression formula? Is there a way to avoid the use of the regression formula? Is there a "non parametric" regression formula?

Any help will be MOST welcome, since I'm running out of time (i need to perform some evaluations with PP before the end of september).

Thanks in advance,

Guillermo Brajovic A.
gbrajovic at entelchile.net
Universidad de Santiago,

ps sorry for the "suscribe" message you received recently.

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list