Linear regression extension

48 views
Skip to first unread message

filip....@rapidrage.org

unread,
Mar 12, 2018, 7:02:24 AM3/12/18
to Warp 10 users
Hello Warp10 users!

I have written implementation of linear regression extension for Warp10. It is using least squares algorithm and work the following:
It consumes GTS at the top of the stack and returns A and B factor from linear function y=Ax+B.

I have done this for simple forecasting because with some functions linear regression fits the data model perfectly and is enough to do some simple forecasting.
I am attaching screenshots from Quantum of how it is working by now, and script used to generate these plots.

I will be releasing source code of this extension on my GitHub in the coming days.
I think it would be great addition to Warp10 standard library and I would like to discuss the inclusion of this new function directly into warp10-platform.

Sincerely,
Filip Dorosz.
WarpsSript-20180312105557.mc2
Screenshot_2018-03-12_11-55-33.png
Screenshot_2018-03-12_11-55-01.png
Screenshot_2018-03-12_11-54-45.png
Screenshot_2018-03-09_09-35-59.png

Mathias Herberts

unread,
Mar 12, 2018, 6:41:46 PM3/12/18
to Warp 10 users
Hi Filip,

thanks for this contribution. As it turns out, there is already a linear regression function in WarpScript, except its documentation was missing! Basically if you call LR instead of your LINEARREGRESSION function and swap the resulting levels of the stack, you will obtain the same result.

We'll fix the missing doc asap.

Filip Dorosz

unread,
Mar 13, 2018, 5:32:06 AM3/13/18
to Warp 10 users
Hello.

That's great that it is already there!

But as I see it's not calculating uncertainties. Because my code has uncertainties implemented - I just didn't pushed them back to stack in the version in examples above.
I can make a PR with that functionality added to further enhance simple forecasting capabilities of the warp10 platform.

Kind regards,
Filip Dorosz.
Reply all
Reply to author
Forward
0 new messages