Ejemplo n.º 1
0
                               call_cython,
                               min_periods,
                               freq=freq,
                               time_rule=time_rule,
                               **kwargs)

    return f


rolling_max = _rolling_func(_tseries.roll_max, 'Moving maximum')
rolling_min = _rolling_func(_tseries.roll_min, 'Moving minimum')
rolling_sum = _rolling_func(_tseries.roll_sum, 'Moving sum')
rolling_mean = _rolling_func(_tseries.roll_mean, 'Moving mean')
rolling_median = _rolling_func(_tseries.roll_median_cython, 'Moving median')

_ts_std = lambda *a, **kw: np.sqrt(_tseries.roll_var(*a, **kw))
rolling_std = _rolling_func(_ts_std,
                            'Unbiased moving standard deviation',
                            check_minp=_require_min_periods(2))
rolling_var = _rolling_func(_tseries.roll_var,
                            'Unbiased moving variance',
                            check_minp=_require_min_periods(2))
rolling_skew = _rolling_func(_tseries.roll_skew,
                             'Unbiased moving skewness',
                             check_minp=_require_min_periods(3))
rolling_kurt = _rolling_func(_tseries.roll_kurt,
                             'Unbiased moving kurtosis',
                             check_minp=_require_min_periods(4))


def rolling_quantile(arg,
Ejemplo n.º 2
0
    def f(arg, window, min_periods=None, freq=None, time_rule=None, **kwargs):
        def call_cython(arg, window, minp, **kwds):
            minp = check_minp(minp, window)
            return func(arg, window, minp, **kwds)
        return _rolling_moment(arg, window, call_cython, min_periods,
                               freq=freq, time_rule=time_rule, **kwargs)

    return f

rolling_max = _rolling_func(_tseries.roll_max, 'Moving maximum')
rolling_min = _rolling_func(_tseries.roll_min, 'Moving minimum')
rolling_sum = _rolling_func(_tseries.roll_sum, 'Moving sum')
rolling_mean = _rolling_func(_tseries.roll_mean, 'Moving mean')
rolling_median = _rolling_func(_tseries.roll_median_cython, 'Moving median')

_ts_std = lambda *a, **kw: np.sqrt(_tseries.roll_var(*a, **kw))
rolling_std = _rolling_func(_ts_std, 'Unbiased moving standard deviation',
                            check_minp=_require_min_periods(2))
rolling_var = _rolling_func(_tseries.roll_var, 'Unbiased moving variance',
                            check_minp=_require_min_periods(2))
rolling_skew = _rolling_func(_tseries.roll_skew, 'Unbiased moving skewness',
                             check_minp=_require_min_periods(3))
rolling_kurt = _rolling_func(_tseries.roll_kurt, 'Unbiased moving kurtosis',
                             check_minp=_require_min_periods(4))

def rolling_quantile(arg, window, quantile, min_periods=None, freq=None,
                     time_rule=None):
    """Moving quantile

    Parameters
    ----------
Ejemplo n.º 3
0
    def f(arg, window, min_periods=None, freq=None, time_rule=None, **kwargs):
        def call_cython(arg, window, minp, **kwds):
            minp = check_minp(minp, window)
            return func(arg, window, minp, **kwds)
        return _rolling_moment(arg, window, call_cython, min_periods,
                               freq=freq, time_rule=time_rule, **kwargs)

    return f

rolling_max = _rolling_func(lib.roll_max2, 'Moving maximum')
rolling_min = _rolling_func(lib.roll_min2, 'Moving minimum')
rolling_sum = _rolling_func(lib.roll_sum, 'Moving sum')
rolling_mean = _rolling_func(lib.roll_mean, 'Moving mean')
rolling_median = _rolling_func(lib.roll_median_cython, 'Moving median')

_ts_std = lambda *a, **kw: _zsqrt(lib.roll_var(*a, **kw))
rolling_std = _rolling_func(_ts_std, 'Unbiased moving standard deviation',
                            check_minp=_require_min_periods(2))
rolling_var = _rolling_func(lib.roll_var, 'Unbiased moving variance',
                            check_minp=_require_min_periods(2))
rolling_skew = _rolling_func(lib.roll_skew, 'Unbiased moving skewness',
                             check_minp=_require_min_periods(3))
rolling_kurt = _rolling_func(lib.roll_kurt, 'Unbiased moving kurtosis',
                             check_minp=_require_min_periods(4))

def rolling_quantile(arg, window, quantile, min_periods=None, freq=None,
                     time_rule=None):
    """Moving quantile

    Parameters
    ----------
Ejemplo n.º 4
0
    def f(arg, window, min_periods=None, freq=None, time_rule=None, **kwargs):
        def call_cython(arg, window, minp, **kwds):
            minp = check_minp(minp, window)
            return func(arg, window, minp, **kwds)
        return _rolling_moment(arg, window, call_cython, min_periods,
                               freq=freq, time_rule=time_rule, **kwargs)

    return f

rolling_max = _rolling_func(lib.roll_max2, 'Moving maximum')
rolling_min = _rolling_func(lib.roll_min2, 'Moving minimum')
rolling_sum = _rolling_func(lib.roll_sum, 'Moving sum')
rolling_mean = _rolling_func(lib.roll_mean, 'Moving mean')
rolling_median = _rolling_func(lib.roll_median_cython, 'Moving median')

_ts_std = lambda *a, **kw: _zsqrt(lib.roll_var(*a, **kw))
rolling_std = _rolling_func(_ts_std, 'Unbiased moving standard deviation',
                            check_minp=_require_min_periods(1))
rolling_var = _rolling_func(lib.roll_var, 'Unbiased moving variance',
                            check_minp=_require_min_periods(1))
rolling_skew = _rolling_func(lib.roll_skew, 'Unbiased moving skewness',
                             check_minp=_require_min_periods(3))
rolling_kurt = _rolling_func(lib.roll_kurt, 'Unbiased moving kurtosis',
                             check_minp=_require_min_periods(4))

def rolling_quantile(arg, window, quantile, min_periods=None, freq=None,
                     time_rule=None):
    """Moving quantile

    Parameters
    ----------