gaurbans / ecm

R package 'ecm'
3 stars 1 forks source link

The MARS+ECM - includeIntercept = FALSE does not work #5

Open stusras opened 3 years ago

stusras commented 3 years ago

I ran a MARS model within ECM with the parameter includeIntercept = FALSE. My model still has the intercept. Moreover, the plotmo() is unable to plot if I set includeIntercept = FALSE.

If I have includeIntercept = TRUE, plotmo() runs fine and it has the same value of the intercept as the model with the parameter includeIntercept = FALSE

gaurbans commented 3 years ago

It seems that MARS requires an intercept to be present. When I tried to build a MARS ECM model on the Wilshire5000 data with includeIntercept=False, it gave me a warning saying "earth objects always have an intercept". Not sure exactly why this is necessary, but looking a bit into this it seems like the way a MARS model is built is by starting with a simple model based on the intercept. See: https://blog.zenggyu.com/en/post/2018-06-16/multivariate-adaptive-regression-splines-in-a-nutshell/

I added a comment into the 'ecm' description stating to set includeIntercept to TRUE if using 'earth' as linearFitter.