Skip to contents

The exponential mechanism over split points, with utility the between-segment sum of squares.

Usage

morie_dp_changepoint(
  y,
  epsilon = 1,
  bounds = NULL,
  min_segment = 5,
  seed = NULL
)

Arguments

y

series.

epsilon

privacy budget.

bounds

c(lo, hi) from outside the data.

min_segment

shortest admissible segment.

seed

optional integer seed.

Value

list with changepoint (the number of observations in the FIRST segment, as in the Python module – the second segment starts at index changepoint + 1), utility, best_utility, utility_ratio, probabilities.

Details

The mechanism ALWAYS returns a location, including on a series with no changepoint at all – it is a selection procedure, not a test. Compare best_utility against what pure noise would produce before believing the location means anything.

References

Cummings, R. et al. (2018). Differentially private change-point detection. NeurIPS, 10825-10834.

Examples

set.seed(1)
y <- c(rnorm(50), rnorm(50, 4))
morie_dp_changepoint(y, epsilon = 20, bounds = c(-6, 10))$changepoint
#> [1] 49