Hacker News new | ask | show | jobs
by akamoonknight 1096 days ago
Is there an adaptation of Bayesian statistics that also takes into account timeliness of the data ? e.g. a more recent string of negative reviews would potentially indicate something compared to a more smooth distribution
5 comments

Sure—you just use a likelihood function that doesn’t assume reviews are independently and identically distributed (where each review is an independent Bernoulli trial) but rather have some dependence on other reviews that are nearby in time. For example, a (Markov) switching autoregressive model, e.g. [0].

Everything else about Bayes’ rule (weighting likelihood by a prior distribution and re-normalizing to obtain a distribution over model parameters) applies just the same.

[0] https://www.statsmodels.org/dev/examples/notebooks/generated...

There two approaches:

1) A moving window: you only calculate your updates from the values in the window (say the last n reviews). The downside of this method is that older values drop off precipitously.

2) A forgetting factor: there are many possibilities but one simple one is the EWMA (exponentially weighted moving average). This is pretty standard, and takes the form

  Y_updated = alpha x Y_current + (1 - alpha) x Y_previous
with alpha in [0,1]. Applying this recursively, it "forgets" older values by weight alpha. This is also known as exponential smoothing in time series. The advantage of this method is that older values are simply weighed less and drop out more gradually.
Two thoughts.

1. There is a vast literature in "Bayesian Change Point Detection." So you might find a point where something changed and a string of negative reviews began.

https://dataorigami.net/Probabilistic-Programming-and-Bayesi...

2. Similarly, there a bajillion ways to weight recent data. One way is to increase the gain on a kalman filter. That will make recent observations more important. There are bayesian implementations of the Kalman filter.

http://stefanosnikolaidis.net/course-files/CS545/Lecture6.pd...

Is "Bayesian Change Point Detection" like https://xkcd.com/2701/?
Two things I like about Bayesian Change Point Detection compared to "look at the graph"

1. It can provide a probability distribution. So after running bayes, you might have multiple places where it's likely a change has taken place.

2. It generalizes to high dimensional space. It's much harder to tilt the graph in 5-d.

Bayesian analysis means you set up at least two models and evaluate the likelihood of the observed data under each. In this case rather than assume a fixed probability of good reviews, you might model a sudden switch (for example if an account was taken over or sold) or a gradual decline (for example if a manufacturer gradually lowers quality). Then you proceed as usual from that point. (I.e. find likelihoods and assign priors for each hypothesis/model, and use Bayes' rule.)
I think you would change the prior in that situation under the assumption that it indicates some sort of underlying shift. I'm not sure that there is any theory guiding how you do that though.