hildensia / bayesian_changepoint_detection

Methods to get the probability of a changepoint in a time series.
MIT License
670 stars 213 forks source link

Calculation of predprobs #15

Closed dcwu closed 6 years ago

dcwu commented 6 years ago

Hi. According to the paper, predprobs is defined as the probability of xt givn r(t-1) and x_t^r. To my knowledge, it means at each time t, we should compute the predictive distribution given different x_t^r. if rt = r(t-1) +1 , let's assume r_t = 4, t =10. we can use x9,x8,x7,x6,x5 to calculate the posterior probablity and thus the predictive distribution. But based on predprobs = observation_likelihood.pdf(x) , the predprobs[i] is the predictive distribution after observing the first i data points. It doesn't seem to be consistent with the original definition. But it works well. I have been struggling with this issue for a while. Correct me if I misunderstand the concept. Thanks.