detect_cp_uni {BayesChange} | R Documentation |
Detect Change Points on an univariate time series.
Description
Detect Change Points on an univariate time series.
Usage
detect_cp_uni(
data,
n_iterations,
q,
phi,
a,
b,
c,
par_theta_c = 1,
par_theta_d = 1,
print_progress = TRUE,
user_seed = 1234L
)
Arguments
data |
vector of observations. |
n_iterations |
number of MCMC iteration. |
q |
probability of performing a split at each iterations. |
phi |
parameter |
a , b , c |
parameters of the Normal-Gamma prior for |
par_theta_c , par_theta_d |
parameters of the shifted Gamma prior for |
print_progress |
If TRUE (default) print the progress bar. |
user_seed |
seed for random distribution generation. |
Value
Function detect_cp_uni
returns a list containing the following components:
$orders
a matrix where each row corresponds to the output order of the corresponding iteration.time
computational time in seconds.$sigma_MCMC
traceplot for\sigma
.$sigma_MCMC_01
a0/1
vector, then
-th element is equal to1
if the proposed\sigma
was accepted,0
otherwise.$theta_MCMC
traceplot for\theta
.
Examples
data_vec <- as.numeric(c(rnorm(50,0,0.1), rnorm(50,1,0.25)))
out <- detect_cp_uni(data = data_vec,
n_iterations = 2500,
q = 0.25,
phi = 0.1, a = 1, b = 1, c = 0.1)
get_clust_VI(out$order)