-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weighted linear regression #48
Comments
Thanks for the incredibly fast reply, but I'm not sure I understand. Is there some way to use code written in R with javascript?? |
Sorry, not enough context; I was just adding references, since it takes a little while to figure out what weighted linear regression is. I'm not aware of any js implementations, I'll look into doing it or would accept a patch. |
I see, thanks for clarifying :) So far, the only implementation I've found in a language I understand is this: http://www.codeproject.com/Articles/25335/An-Algorithm-for-Weighted-Linear-Regression. I've actually already converted this to Javascript, which I can supply if you like, but there are a couple of issues at present: it's not clear to me what I'm supposed to put in the array X that's passed to the Regress method; also, in its current form, I'd have to re-calculate every time a new item of data becomes available. The ideal implementation, in my opinion, would allow for a moving window of data values over which to apply the regression analysis. This would allow me to use it something like this: var lrObj = new WeightedLinearRegression(lookbackPeriod); var returnVal; Hope this makes sense! |
simple-statistics is pretty committed to vanilla input; I don't plan on supporting generators, streams, etc., because these make it less readable and more complex. A more tuned implementation could be placed in stream-statistics. Though it doesn't look like online methods for linear regression can be implemented with identical behavior to offline. |
Hi
Do you, by any chance, know where I can find a Javascript library for weighted linear regression? If not, would you consider adding it to simple-statistics?
Thanks
Marcus
The text was updated successfully, but these errors were encountered: