Closed crossxwill closed 3 years ago
I'm working on setting up 'ecm' and other functions to take in 'lm' or 'earth' as arguments for the linear fitter of choice. Is there a reason you've chosen to pass 'yLag1' as an argument for linpreds?
It's an attempt to preserve the "theory" of ECM (i.e., prior deviations from equilibrium are followed by a correction), but allowing for non-linear features to affect the equilibrium levels of 'y'. Suppose the equilibrium levels of 'y' is a parabolic function of 'x'.
Then the ECM equation would look like:
So yLag1 is still linear despite a non-linear transformation of 'x'. Generally speaking, we could allow for arbitrary non-linear transformations of the features. The 'earth' function would figure out the 'f' and 'g' functions.
Just my two cents. I haven't actually seen this done in literature because most economists assume 'f' and 'g' are linear.
Got it, thanks.
Sorry for the delay. The 'ecm' function can now fit models using the 'earth' algorithm, and 'ecmpredict' can predict on said models.
I thought it would be fun to swap out
lm
withearth
to get non-linear features into the equilibrium regression and transient terms. May cause some overfitting.