Rolling.kurt(self, **kwargs)
[source]
Calculate unbiased rolling kurtosis.
This function uses Fisher’s definition of kurtosis without bias.
Parameters: |
|
---|---|
Returns: |
|
See also
Series.rolling
DataFrame.rolling
Series.kurt
DataFrame.kurt
scipy.stats.skew
scipy.stats.kurtosis
A minimum of 4 periods is required for the rolling calculation.
The example below will show a rolling calculation with a window size of four matching the equivalent function call using scipy.stats
.
>>> arr = [1, 2, 3, 4, 999] >>> fmt = "{0:.6f}" # limit the printed precision to 6 digits >>> import scipy.stats >>> print(fmt.format(scipy.stats.kurtosis(arr[:-1], bias=False))) -1.200000 >>> print(fmt.format(scipy.stats.kurtosis(arr[1:], bias=False))) 3.999946 >>> s = pd.Series(arr) >>> s.rolling(4).kurt() 0 NaN 1 NaN 2 NaN 3 -1.200000 4 3.999946 dtype: float64
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.core.window.Rolling.kurt.html