# NOT RUN {
# Use as an example the el_nino dataset.
# Run the function with l_max = 3 change-points, a maximum depth of 5 and the [0, 1] alphabet.
# The sampler is run for 100 iterations
res_unknown <- infer_unknown_changepoints(el_nino, 3, 5, c("01"), 100, fileName = NULL)
# Plot the posterior distribution of the locations and the posterior of the number of change-points.
plot_changepoint_posterior(res_unknown, 0.2)
# This function can be also used with the infer_fixed_changepoints.
# Assume l = 2.
res_fixed <- infer_fixed_changepoints(el_nino, 2, 5, c("01"), 100, fileName = NULL)
# Now, the function will only output the posterior distribution of the change-points
# (the number is fixed).
plot_changepoint_posterior(res_fixed, 0.2)
# }
Run the code above in your browser using DataLab