Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree. I hate that I have to preface this sort of thing by pointing out that I am not against legalization. But, according to that graph, the rate is actually higher after the legalization of marijuana, but the "trend" is down. Except that the trend would have been upwards had you made the stopped measuring at the end of 2014 instead of the end of 2015. And they're cheating by not measuring the trend in the same way for previous years as the post-marijuana years because before the graph the trend is measured as a single line spanning 14 years, while the trend is only for 2 years afterwards. So you'd need to do some sort of running average, or whatever the equivalent is for linear regression. Actually now I'm seriously interested in knowing if there's a running version of linear regression like there is for averages.


I believe you can use a polynomial curve fitter for this sort of "regression" [0]. There are other, much better, curve fitting algorithms out there than in NumPy. Some implementations can also guess how many terms there are and iteratively optimize making it very similar to a linear regression.

A good first order (that is much more commonly used) is to just, as you have already pointed out, use centered averages spanning N days of data.

edit: I'd also like to note that I'm neither pro nor anti legalization. I am definitely against false reporting, knee jerking, and lying to the public with statistics.

[0] - https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: