polars
polars copied to clipboard
feat(rust): Rolling kurtosis
This pull request is WIP for this feature request
I have some outstanding questions (I'm still learning)
-
I've modified the
SumSquaresWindowto be more generic for multiple powersSumPowersWindow, but I'm not sure how I can parameterise the variablebasethat I use for thepowfunctionality. I'd like to have access to thebasehere -
I'm using
let one: T = NumCast::from(1).unwrap();as constants for multiplying in the code, surely there's an easier way? here
Now, base = 2, so that the variance calculation doesn't break.
Let me know what you think :)
I'm thinking, am I implementing this in the right place? Maybe it's more like this;
ps sorry for the mess; had to cleanup my git settings and history :)
I'm now getting the same results as pandas :)
import pandas as pd
df = pd.DataFrame({'B': [3, 1, 4, 1, 5, 9, 2]})
list(df.rolling(4, min_periods=4).kurt(fisher=True, bias=False)['B'])
>> [nan,nan,nan, -3.901234567901234, -4.858131487889274, 1.1656663364605784, -0.5818938605619142]
I will close this as being stale.
Will there be no rolling_kurt in polars?
It would be very helpful if rolling_kurt could be added.