# Data preprocessing for dynamic linear regression

In DLM, what kind of preprocessing should be done before fitting the model?

$$Y_t = \beta_t'X_t+\epsilon_t$$ $$\beta_t = \beta_{t-1}+\eta_t$$

1. Should I transform both $$Y$$ and $$X$$ into stationary time series? e.g. log, difference of log, etc.
2. Should I centered and standardize $$X$$ like in Lasso/Ridge regression? If yes, should I do it variable-wise or time-wise?
3. I think the any transformation will have an impact on the signal/noise ratio, does it matter? Because I think a high signal/noise ratio makes the estimation easier in state space model.

Any suggestions would be greatly appreciated. Thanks!

• Hi: it's a state space model so you don't even stationarity. I would just leave as is and estimate. key thing is how stable $\beta$ is. If it's flying all over the place, that might be a sign that the model could be improved. note that you need the variances of $\epsilon_t$ and $\eta_t$ before you can run KF which I assume you estimate in some manner ? – mlofton Mar 24 at 2:54
• The variances of $\eta_t$ and $\epsilon_t$ can be estimated by combining KF and EM algorithm. But I think the estimated variance is actually impacted by the scale of $X_t$, like if $X_t$ is in km or miles, the variance can be different. And in SSM, I think a high $\frac{\sigma_\eta}{\sigma_\epsilon}$ leads to a more stable estimation. – H.Yuanchen Mar 24 at 2:59
• Hi: I can't say for sure but I don't think the units you use should matter ? Also, note that you can estimate the variances before the KF update by using the prediction error decomposition in Andrew Harvey blue book. I think the title is "kalman filter and structural models". You can also estimate them by KF-EM but my limited understanding of the latter leads me to believe that prediction error decomposition is easier. Hopefully others can chime in because I don't feel too confident giving advice on either A) standardizing or B) usefuleness of using EM instead of prediction error decomp. – mlofton Mar 24 at 5:18
• I'll check out prediction error decomposition. Can you please give the name of the book? I found he wrote 4 books about SSM. Thank you, mlofton! – H.Yuanchen Mar 24 at 18:09
• It's terse and compact ( each page is like 5 pages if someone else wrote them ) which is his general style. I hated it when I read it 20 years ago. Now I glance at it once in a while and realize how good it is. amazon.com/Forecasting-Structural-Models-Kalman-Filter-ebook/dp/… Note that his other books are very good also ( same description applies ) but they are not really focused on KF-SSM. – mlofton Mar 25 at 17:39