Formula: see bocpd
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)
Bayesocp(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"
