| bcp_wrapper | R Documentation |
Wraps bcp::bcp(), the MCMC implementation (Erdman and Emerson, 2007)
of the Barry and Hartigan (1993) product partition model. The engine
returns a posterior probability of a changepoint at every location;
locations whose posterior probability reaches prob_threshold are
reported as changepoints, and the full probability profile is kept so that
ggcpt_posterior() can draw the classic two-panel posterior
plot.
bcp_wrapper(x, prob_threshold = 0.5, burnin = 50, mcmc = 500, seed = NULL, ...)
x |
A numeric vector. |
prob_threshold |
Posterior probability cutoff in |
burnin |
Number of burn-in MCMC iterations. Defaults to |
mcmc |
Number of post-burn-in MCMC iterations. Defaults to |
seed |
Optional seed for reproducibility of the MCMC run. The seed
is scoped to this call: |
... |
Additional arguments passed to |
A ggcpt object. The changepoints tibble carries a
posterior_prob column, and the data tibble carries the
posterior mean in its fitted column.
barry1993bayesianggchangepoint
\insertReferdman2007bcpggchangepoint
Other changepoint engines:
beast_wrapper(),
bfast_wrapper(),
binsegrcpp_wrapper(),
bocpd_wrapper(),
capa_wrapper(),
cpm_wrapper(),
cpop_wrapper(),
cpt_wrapper(),
decafs_wrapper(),
ecp_wrapper(),
envcpt_wrapper(),
esac_wrapper(),
fabisearch_wrapper(),
fastcpd_wrapper(),
fcov_wrapper(),
fmean_wrapper(),
fpop_wrapper(),
geomcp_wrapper(),
hdcov_wrapper(),
hdreg_wrapper(),
idetect_wrapper(),
inspect_wrapper(),
kcp_wrapper(),
kwc_wrapper(),
mcp_wrapper(),
mosum_wrapper(),
network_wrapper(),
not_wrapper(),
npmojo_wrapper(),
nsp_wrapper(),
ocd_wrapper(),
pilliat_wrapper(),
segmented_wrapper(),
smuce_wrapper(),
sn_wrapper(),
strucchange_wrapper(),
taylor_wrapper(),
tguh_wrapper(),
trend_wrapper(),
var_wrapper(),
wbs2_wrapper(),
wbs_wrapper(),
wbsts_wrapper()
res <- bcp_wrapper(c(rnorm(60), rnorm(60, 4)), seed = 2026)
res$changepoints
ggcpt_posterior(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.