mosum.bottom_up

Module Contents

Functions

multiscale_bottomUp(x[, G, threshold, alpha, ...])

Multiscale MOSUM algorithm with bottom-up merging

mosum.bottom_up.multiscale_bottomUp(x, G=None, threshold=['critical_value', 'custom'][0], alpha=0.1, threshold_function=None, eta=0.4, do_confint=False, level=0.05, N_reps=1000)

Multiscale MOSUM algorithm with bottom-up merging

Parameters:
  • x (list) – input data

  • G (int) –

    vector of bandwidths; given as either integers less than len(x)/2,

    or numbers between 0 and 0.5 describing the moving sum bandwidths relative to len(x)

  • threshold (Str) – indicates which threshold should be used to determine significance. By default, it is chosen from the asymptotic distribution at the given significance level ‘alpha`. Alternatively it is possible to parse a user-defined function with ‘threshold_function’.

  • alpha (float) – numeric value for the significance level with ‘0 <= alpha <= 1’; use iff ‘threshold = “critical_value”’

  • threshold_function (function) –

  • eta (float) – a positive numeric value for the minimal mutual distance of changes, relative to moving sum bandwidth (iff ‘criterion = “eta”’)

  • do_confint (bool) – flag indicating whether to compute the confidence intervals for change points

  • level (float) – use iff ‘do_confint = True’; a numeric value (‘0 <= level <= 1’) with which ‘100(1-level)%’ confidence interval is generated

  • N_reps (int) – use iff ‘do.confint = True’; number of bootstrap replicates to be generated

Returns:

  • multiscale_cpts object containing

  • x (list) – input data

  • G (int) – bandwidth vector

  • threshold, alpha, threshold_function, eta – input

  • cpts (ndarray) – estimated change point

  • cpts_info (DataFrame) – information on change points, including detection bandwidths, asymptotic p-values, scaled jump sizes

  • pooled_cpts (ndarray) – change point candidates

  • do_confint (bool) – input

  • ci – confidence intervals

Examples

>>> import mosum
>>> xx = mosum.testData("blocks")["x"]
>>> xx_m  = mosum.multiscale_bottomUp(xx, G = [50,100])
>>> xx_m.summary()
>>> xx_m.print()