DFA would be quite easy to write as a statespace model, PRs welcome to pymc-extras to add that. The model is covered in Durbin and Koopsman Chapter 3.7
In general I agree with everything @JAB said above. I’ll just add 2 things:
- If you have plateaus, decreases, and short-term improvements, it might imply an HMM where there is a discrete latent state governing the time series dynamics
- The statespace module unfortunately don’t scale well at the moment, so if you have thousands of time series that you want to jointly estimate, it’s not a good choice. I hope this will change in the near future.
- For cases with big data and many time series, I suggest a method that reduces to linear regression: prophet, splines, or HSGP. Recursive models are always going to be way more computationally intensive than y = X \beta, even if getting X requires some effort.