-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
table.DownsideRiskRatio/table.Variability variable freq not defined #128
Comments
thanks for the report. Could you describe why you think this is a problem? If you don't pass scale, the function tries to figure it out. Do you have an example of a problem you're having? I'm happy to take a look, but I want to know what you were expecting, and what, if anything, is not working. |
Thank you for quick response! table.DownsideRiskRatio(port, scale = 252, digits=4) I checked the function and found that if scale is defined, Thank you! PerformanceAnalytics is a very nice package. |
version: PerformanceAnalytics_1.5.3 |
upon investigation, your report doesn't make sense to me, and I still dont have a reproducible example. The code in question is this: if(is.na(scale)) {
freq = periodicity(y)
switch(freq$scale,
minute = {stop("Data periodicity too high")},
hourly = {stop("Data periodicity too high")},
daily = {scale = 252},
weekly = {scale = 52},
monthly = {scale = 12},
quarterly = {scale = 4},
yearly = {scale = 1}
)
} so In all cases, I suspect that your |
Hi! Thanks for following up! PerformanceAnalytics/R/table.DownsideRiskRatio.R Lines 61 to 72 in faf539c
In line 64, |
OK, now I understand you. I will fix. |
Thank you! Similar issues may also happen in other functions using scale input. |
Please fix the same bug in function 'table.Distributions()' It can be done by just placing the following string outside the block 'if(is.na(scale)) {...}' |
This commit removes references to 'freq' which is not assigned when the argument 'scale' != NA for the following tables: * table.Distributions * table.DownsideRiskRatio * table.Variability Fixes braverock#128.
This commit removes references to 'freq' which is not assigned when the argument 'scale' != NA for the following tables: * table.Distributions * table.DownsideRiskRatio * table.Variability Fixes braverock#128.
Hello,
in table.DownsideRiskRatio function:
freq is not defined if scale is not NA.
y = checkData(R)
columns = ncol(y)
columnnames = colnames(y)
if (is.na(scale)) {
freq = periodicity(R)
...
}
for (column in 1:columns) {
...
znames = c(paste0(**freq$**scale, " downside risk"), "Annualised downside risk",
"Downside potential", "Omega", "Sortino ratio",
"Upside potential", "Upside potential ratio", "Omega-sharpe ratio")
...
}
The text was updated successfully, but these errors were encountered: