Deedle icon indicating copy to clipboard operation
Deedle copied to clipboard

Deedle Finance.ewmVol is returning the rolling mean not the standard deviation

Open ChrisAllisonMalta opened this issue 2 years ago • 1 comments

Copying from Stackoverflow

I am trying to do some calculations that I previously had done in python in c#. I came across the Deedle library and seems like it will fit the bill as a Panda's replacement.

When I came to test the library, I get very different data to what I get in Pandas when I test the Exponentially Weighted Standard Deviation.

If I create an array of doubles with a sequence from 1 through 50, in Pandas by the end of the series I'm getting data like

print(df['Numbers'].ewm(adjust=False, span=10).std().tail())

double | Pandas EW std

45 | 5.238847 46 | 5.239699 47 | 5.240413 48 | 5.241011 49 | 5.241511

When I run Finance.ewmVol(numberSeries, null, 10, null, null); I get very similar numbers to this function Stats.ewmMean(numberSeries, null, 10, null, null);

double | Deedle EW std | Deedle EW mean

45 | 41.5005 | 41.5005 46 | 42.5004 | 42.5004 47 | 43.5003 | 43.5003 48 | 44.5002 | 44.5002 49 | 45.5002 | 45.5002

Am I doing something wrong here?

ChrisAllisonMalta avatar Feb 06 '23 15:02 ChrisAllisonMalta