Nixtla / hierarchicalforecast

Probabilistic Hierarchical forecasting 👑 with statistical and econometric methods.
https://nixtlaverse.nixtla.io/hierarchicalforecast
Apache License 2.0
587 stars 75 forks source link

Reconcile function fail and try/except protections. #48

Closed kdgutier closed 8 hours ago

kdgutier commented 2 years ago

Discussed in https://github.com/Nixtla/hierarchicalforecast/discussions/47

Originally posted by **jakebajo** August 25, 2022 Is there a way to write the `HierarchicalReconciliation.reconcile()` function so that if one reconcile method fails, the function will move on to the next one and still output a dataframe with the reconcile methods that worked? I understand that you can loop through various reconcile methods instead but that is slower and inefficient. I don't think this would be a huge change in the function, just some try except essentially to the for loop. Could also output an error dataframe if necessary. I could possibly put some things together in a pull request if I have time but wanted to ask if the team has thought about this.
kdgutier commented 2 years ago

Hey @jakebajo,

Thanks for the suggestion, we have done a similar approach in the past to protect the convergence of AutoARIMA. If you are using methods that require an inverse or a pseudo-inverse I recommend you to explore the regularization parameters that aim to make the reconciliation numerically stable, for example MinT-ridge and ERM-lasso.

If you want to take a look to protect the reconciliation with try and excepts, your effort will be welcome.

jakebajo commented 2 years ago

Awesome, thank you!