mosum.test_data

Module Contents

Functions

testData([model, lengths, means, sds, rand_gen, seed, ...])

Test data with piecewise constant mean

testSignal([model, lengths, means, sds])

Piecewise constant test signal

mosum.test_data.testData(model=['custom', 'blocks', 'fms', 'mix', 'stairs10', 'teeth10'][1], lengths=None, means=None, sds=None, rand_gen=np.random.normal, seed=None, rand_gen_args=[0, 1])

Test data with piecewise constant mean

Generate piecewise stationary time series with independent innovations and change points in the mean.

Parameters:
  • model (str) – custom or pre-defined signal

  • lengths (int) – vector of segment lengths (custom only)

  • means (int) – vector of segment means (custom only)

  • sds (int) – vector of segment standard deviations (custom only)

  • rand_gen (function) – innovation function

  • seed (int) – random seed

  • rand_gen_args (ndarray) – arguments for rand_gen

Returns:

  • x (ndarray) – simulated data series

  • mu (ndarray) – signal

  • sigma (float) – standard deviation

  • cpts (ndarray) – true change points

Examples

>>> mosum.testData()
>>> mosum.testData("custom", lengths = [100,100], means=[0,1], sds= [1,1])
mosum.test_data.testSignal(model=['custom', 'blocks', 'fms', 'mix', 'stairs10', 'teeth10'][1], lengths=None, means=None, sds=None)

Piecewise constant test signal

Produce vectors of mean and dispersion values for generating piecewise stationary time series.