You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SortinoRatio(Stats_Data$EQ, MAR = Stats_Data$RF), I got the following error:
Error in DownsideDeviation(R, MAR) :
dims [product 71] do not match the length of object [197]
In addition: Warning message:
In MAR - r :
longer object length is not a multiple of shorter object length
Stats_Data is a grouped tibble and EQ and RF are columns with equity and risk-free returns, resp. They are numerical, of equal length and without any NAs.
The same error occurs with randomly generated data (see below).
Expected behavior
I would have expected an output as the one returned for MAR = 0:
SortinoRatio(Stats_Data$EQ, MAR = 0)
[,1]
Sortino Ratio (MAR = 0%) 0.6913074
Minimal, reproducible example
On randomly generated data:
Rand_EQ <- rnorm(100) # Random returns
Rand_RF <- rnorm(100, mean = 0.01) # Random benchmark returns
DownsideDeviation(Rand_EQ, MAR = 0) # Results in 0.5808906
DownsideDeviation(Rand_EQ, MAR = Rand_RF) # Results in error
Session Info
The text was updated successfully, but these errors were encountered:
Description
When using
SortinoRatio(Stats_Data$EQ, MAR = Stats_Data$RF)
, I got the following error:Error in DownsideDeviation(R, MAR) :
dims [product 71] do not match the length of object [197]
In addition: Warning message:
In MAR - r :
longer object length is not a multiple of shorter object length
Stats_Data
is a grouped tibble and EQ and RF are columns with equity and risk-free returns, resp. They are numerical, of equal length and without any NAs.The same error occurs with randomly generated data (see below).
Expected behavior
I would have expected an output as the one returned for MAR = 0:
Minimal, reproducible example
On randomly generated data:
Session Info
The text was updated successfully, but these errors were encountered: