scikits.timeseries.TimeSeries.pct_symmetric¶
- TimeSeries.pct_symmetric(series, nper=1)¶
Returns the rolling symmetric percentage change of the series. This is defined as 2*(series[T] - series[T-nper])/(series[T] - series[T-nper])
Parameters: series : {TimeSeries}
TimeSeries object to to calculate symmetric percentage chage for. Ignore this parameter if calling this as a method.
nper : {int}
Number of periods for percentage change.
Notes
Series of integer types will be upcast 1.0 == 100% in result
Examples
>>> series = ts.time_series( ... [2.,1.,2.,3.], start_date=ts.Date(freq='A', year=2005)) >>> series.pct_symmetric() timeseries([-- -0.666666666667 0.666666666667 0.4], dates = [2005 ... 2008], freq = A-DEC) >>> series.pct_symmetric(2) timeseries([-- -- 0.0 1.0], dates = [2005 ... 2008], freq = A-DEC)
