View source: R/segmentation_fixed_number_changepoints.R
infer_fixed_changepoints | R Documentation |
This function implements the Metropolis-Hastings sampling algorithm for inferring the locations of the change-points.
infer_fixed_changepoints( input_data, l, depth, alphabet, iters, fileName = NULL )
input_data |
the sequence to be analysed. |
l |
number of change-points. |
depth |
maximum memory length. |
alphabet |
symbols appearing in the sequence. |
iters |
number of iterations; for more information see Lungu et al. (2022). |
fileName |
file path for storing the results. |
return a list object which includes:
positions |
the sampled locations of the change-points. |
acceptance_prob |
the empirical acceptance ratio. |
infer_unknown_changepoints
# Use as an example the three_changes dataset. # Run the function with 3 change-points, a maximum depth of 5 and the [0,1,2] alphabet. # The sampler is run for 100 iterations output <- infer_fixed_changepoints(three_changes, 3, 5, c("012"), 100, fileName = NULL) # If the fileName is not set to NULL, # the output file will contain on each line the sampled locations of the change-points.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.