4.8.9.1.11. statsmodels.tsa.tsatools.unintegrate

statsmodels.tsa.tsatools.unintegrate(x, levels)[source]

After taking n-differences of a series, return the original series

Parameters:

x : array-like

The n-th differenced series

levels : list

A list of the first-value in each differenced series, for [first-difference, second-difference, ..., n-th difference]

Returns:

y : array-like

The original series de-differenced

Examples

>>> x = np.array([1, 3, 9., 19, 8.])
>>> levels = unintegrate_levels(x, 2)
>>> levels
array([ 1.,  2.])
>>> unintegrate(np.diff(x, 2), levels)
array([  1.,   3.,   9.,  19.,   8.])