Find the portfolio with the maximum return at a given risk level using the `fPortfolio` package in `R`
I’m trying to find the portfolio with the maximum return at a given risk level using the fPortfolio
package in R
. However, there appears to be a bug in the package that the optimal portfolio (based on max returns) does not change when changing the target risk level, suggesting that it is not taking into account the target risk level specified by the user. This issue has been identified by others (see links below), and I provide a minimal reproducible example below. As far as I can tell, this issue has not been addressed in the package documentation (archived here) or in the authors’ book on fPortfolio (archived here). The bug was described nearly 10 years ago and it still hasn’t been fixed, so I figured we could turn to the community to help address it. My goal in creating this issue is to summarize what is known, identify potential issues with the package code, and hopefully get help to address it.