pyfinance icon indicating copy to clipboard operation
pyfinance copied to clipboard

semi_stdev function is wrong

Open AlessandroQI opened this issue 5 years ago • 0 comments

As you correctly said in comments formula is

    Formula: `sqrt( sum([min(self - thresh, 0] **2 ) / (n - ddof) )`

    Also known as: downside deviation.

so in the function --> line 867 of file returns.py: ss = ((nansum(np.minimum(self - threshold, 0.) ** 2 )/ n) ** 0.5) instead of: ss = (nansum(np.minimum(self - threshold, 0.) ** 2) ** 0.5) / n

AlessandroQI avatar Aug 20 '19 17:08 AlessandroQI