infer_fixed_changepoints {BCT}R Documentation

Inferring the change-points locations when the number of change-points is fixed.

Description

This function implements the Metropolis-Hastings sampling algorithm for inferring the locations of the change-points.

Usage

infer_fixed_changepoints(
  input_data,
  l,
  depth,
  alphabet,
  iters,
  fileName = NULL
)

Arguments

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.

Value

return a list object which includes:

positions

the sampled locations of the change-points.

acceptance_prob

the empirical acceptance ratio.

See Also

infer_unknown_changepoints

Examples

# 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.

[Package BCT version 1.2 Index]