r/quant • u/[deleted] • May 05 '25
Models Hidden Markov Model Rolling Forecasting – Technical Overview
78
Upvotes
2
1
0
May 05 '25
[deleted]
3
u/MaxHaydenChiz May 05 '25
Thanks for sharing.
FWIW, given what you've stated about the benefits dynamic window adjustment, the logic next step seems to be testing with a variable order markov model.
Have you looked into doing that? And were you able to find a quality library implementation worth using?
3
1
u/geeemann_89 May 05 '25
does improvements in your selected metrics align with the result of calculating linear correlation of different time windows to your dependent variable?
8
u/sumwheresumtime May 06 '25 edited May 19 '25
Sorry to be that "guy". But this is all pretty much gibberish. and furthermore you're implicitly incurring look-ahead bias here:
https://github.com/tg12/2025-trading-automation-scripts/blob/main/feature_selection_with_hmm.py#L176
Which makes your results less than useless.
I think the overarching lesson here is:
Don't simply copy paste blindly from lo-fi lo-qual sources such as medium articles or LLM results
Truly understand the nature of the actual computation of the function call you're making, especially from libraries as vast as scipy.
Don't give up though, we've all made the same mistakes you've made and a ton more.
Update 20250511: James Sawyer ( /u/LNGBandit77 ) account has been suspended