How can I calculate the trending nature of a link? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionThe above image represents an article's page views over time. I'm looking for a decent, not to complex either physics or statistical calculation that would be able to give me (based on the history of the page views) what the current trending of the page views is for the past n days (which is represented by the blue box).
So basically, in the pas开发者_C百科t 5 days is this link trending unusually higher than it usually does and if so by what degree/magnitude?
Ideally the accepted answer would provide an algorithm class that applies to this problem as well as some example of that using the data provided from this chart above.
thanks!
One approach could be to perform a least squares fit of the points within the blue box. Trends could then measured by the difference between the points and the least squares fit approximation value.
It sounds like you want to compare a short term (5-day) moving average to a longer-term moving average (e.g., something like 90 days).
As a refinement, you might want to do a least-squares linear regression over the longer term, and then compare the shorter term average to the projection you get from that.
精彩评论