Formula: P(r_t=r_{t-1}+1, x_1:t) = P(r_{t-1},x_1:t-1) pi_t^(r) (1-H); P(r_t=0, x_1:t) = sum_r P(r_{t-1},x_1:t-1) pi_t^(r) H
Value
List with cp_prob (P(r_t = 1) at each t), reset_prob, run_length
(posterior mode), max_cp_prob, hazard, n.
References
Adams and MacKay (2007), Bayesian Online Changepoint Detection, arXiv:0710.3742. Equations (2)-(5) for the recursion and the changepoint prior, Section 2.3 and Algorithm 1 for the conjugate-exponential update of the run-specific sufficient statistics. Verified against the paper.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Bocpd(V)
#> $cp_prob
#> [1] 0.9960000000 0.0027455645 0.0021236410 0.0015650283 0.0011286041
#> [6] 0.0008232592 0.0006147170 0.0004702678
#>
#> $run_length
#> [1] 1 2 3 4 5 6 7 8
#>
#> $max_cp_prob
#> [1] 0.996
#>
#> $reset_prob
#> [1] 0.004
#>
#> $hazard
#> [1] 0.004
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Bayesian online changepoint detection (Normal-Inverse-Gamma)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
