I have forgotten to list the definition of pp. Here it is:
pp <- function(x,a) {ifelse(x>a, x-a, 0)}
______________________________________
Dear list,
when I execute
library(mda)
x1 <- rnorm(100000,mean=1,sd=.12)
x2 <- rnorm(100000,mean=.6,sd=.12)
y <- pp(x1,1)+pp(x1,1)*pp(x2,.6)+.12*rnorm(length(x1))
mymars <- mars(cbind(x1,x2),y,degree=2)
mymars$cuts
mymars$factor
I get what I expected. Instead, when I execute
x1 <- rnorm(100000,mean=1,sd=.12)
x2 <- rnorm(100000,mean=.6,sd=.12)
x3 <- rnorm(100000,mean=.2,sd=.12)
y <-
pp(x1,1)+pp(x2,.6)+pp(x3,.2)+pp(x1,1)*pp(x2,.6)+pp(x1,1)*pp(x3,.2)+pp(x2,.6)
*pp(x3,.2)+pp(x1,1)*pp(x2,.6)*pp(x3,.2)+.12*rnorm(length(x1))
mymars <- mars(cbind(x1,x2,x3),y,degree=3,prune=FALSE)
mymars$cuts
mymars$factor
or
x1 <- rnorm(100000,mean=1,sd=.12)
x2 <- rnorm(100000,mean=.6,sd=.12)
x3 <- rnorm(100000,mean=.2,sd=.12)
y <- pp(x1,1)*pp(x2,.6)*pp(x3,.2)+.12*rnorm(length(x1))
mymars <- mars(cbind(x1,x2,x3),y,degree=3,prune=FALSE)
mymars$cuts
mymars$factor
I do not get the term of interaction degree 3.
What am I thinking wrong?
Thank you
Jordi
--------------------------------------------------------------------------------
The information contained herein is confidential and is inte...{{dropped}}