findCPprobs function

Find Set of Changepoints with Highest probability

Find Set of Changepoints with Highest probability

This function calculates the changepoints with highest probability in the online algorithm to take in the current probabilities at time t in the form of a list of lists. It will not calculate the result at every possible end point, because this will be done in the main loop of online cpd as it iterates: the probmaxes and cps list will be returned and passed into the function again each time. methods

findCPprobs(currrunprobs, probmaxes, logprobcpstrunc, Rlength, t, minsep = 3, maxsep = 90, ppres = FALSE)

Arguments

  • currrunprobs: The current most recently calculated "R" vector, of run length probabilities (sums to 1).
  • probmaxes: The probabilities of the set of changepoints with the highest probability for each preceding time point.
  • logprobcpstrunc: The set of changepoints with the highest probability for each previous time point.
  • Rlength: The length of the current R vector, to use in case it was truncated.
  • t: The current time point.
  • minsep: The minimum distance of separation allowed for eligible changepoint locations to be included in the list of changepoints with the highest probability.
  • maxsep: The maximum distance of separation allowed for eligible changepoint locations to be included in the list of changepoints with the highest probability.
  • ppres: Set to true if wanting to return optional outputs, useful for plotting and inspecting the algorithm, but not necessary.

Returns

Two lists needed for the use in calculating this changepoints for the next incoming time point: the vector of max probabilities for each time point (probmaxes), and the list of changepoints with the highest probability at each time point (changepoints: a list of lists). It also returns ppresult: optional outputs, will be null if ppres=FALSE.

  • Maintainer: Andrea Pagotto
  • License: GPL-3
  • Last published: 2019-04-21

Useful links