timesfm icon indicating copy to clipboard operation
timesfm copied to clipboard

error when calculating the MSE and MAS between ols_forecast and true value.

Open JieNi4 opened this issue 1 year ago • 4 comments

Normalisation of the output of the Xreg model is used in timesfm.py if we use covariance_forecast. But the code only renormalise the output of timesfm with covariance. And the output of Xreg model is very small. So it's meaningless to compare with different models.

we should add this code 'xregs = _renormalize(xregs, per_instance_stats))' in timesfm.py file (about 745 raws).

JieNi4 avatar Jul 25 '24 09:07 JieNi4

The xreg output is mostly FYI. My intuition is that renormalizing xreg output makes little sense if we call TimesFM forecast first and use xreg to fit the residuals.

Do you have a specific usecase in mind?

siriuz42 avatar Jul 26 '24 06:07 siriuz42

If we use xregmode = 'xreg + timesfm', then algorithm will first use xreg based on 'cov' predict the target y'. and then calculating the residuals between y' and the true label y : d. Then TimesFM will according to this delta predict the future residuals d' for the xreg model. Finally, Xreg will based on the new cov input predict the future target y''. The result finally is y_pred = y'' + d'. It's the basic function. In this method, it seems like xreg model will preform the more important role than timesfm model. And another question, shall we use other regression model like SVR, Boost ?

JieNi4 avatar Jul 30 '24 02:07 JieNi4

You understanding is correct. Other regression models also work and can be implemented in a similar fashion. Linear + ridge are provided here since they have closed form solutions which have relatively minimal (but still significant) impacts on the e2e inference latency.

siriuz42 avatar Aug 01 '24 20:08 siriuz42

Thank you for your reply. It's a nice model. Hope a new version will be published.

JieNi4 avatar Aug 02 '24 06:08 JieNi4