Previous topic

scikits.timeseries.TimeSeries.pct

Next topic

scikits.timeseries.TimeSeries.pct_symmetric

This Page

scikits.timeseries.TimeSeries.pct_log

TimeSeries.pct_log(series, nper=1)

Returns the rolling log percentage change of the series. This is defined as the log of the ratio of series[T]/series[T-nper]

Parameters:

series : {TimeSeries}

TimeSeries object to to calculate log 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_log()
timeseries([-- -0.69314718056 0.69314718056 0.405465108108],
           dates = [2005 ... 2008],
           freq  = A-DEC)
>>> series.pct_log(2)
timeseries([-- -- 0.0 1.09861228867],
           dates = [2005 ... 2008],
           freq  = A-DEC)