pyfinance
pyfinance copied to clipboard
semi_stdev function is wrong
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