Hello. It's my first time posting on this list. I hope the issue I am having is appropriate for this forum. Any help is greatly appreciated.
I want to estimate a simple model with one independent variable using MLE with a twist. The twist is the following, the effect of the independent variable (X) is split into a short run (SR) and a long run (LR) coefficient. My model thus looks like this: Y = a + b1*X_LR + e_LR + b2*X_SR + e_SR where e_LR and e_SR are i.i.d. disturbances. X_LR is a centered moving average of the independent variable and X_SR is the deviation of the actual series from its moving average. The length of the moving average should be determined endogenously, i.e. in such a way that the likelihood function is maximized. Now, I am capable of running a basic MLE in Gretl by specifying the log-likelihood function and the derivatives. However, I am having troubles with creating the short run and the long run series and in particular with the endogenous determination of the length of the moving average. I have a hunch that I need to iterate the MLE command itself, but I have no clue how to implement this in a script. Regards. -- Johann