I am a newbie in R.

From an investment universe of around 150 international stocks, I want to find the five best-performing portfolios (each containing 20 stocks) in terms of return for the period 2013-2017 under the constraints: a concrete range for the individual weights, a concrete standard deviation of the portfolio, long only, full investment.

Is it possible to do this reliably and what approach would you recommend? For example, using for loop or some apply function or some approach on portfolio optimization?

I am asking just for a short advice in which direction to go.

Thank you in advance.

  • 1
    $\begingroup$ What do you mean by concrete? $\endgroup$ – Bob Jansen Jan 5 '18 at 14:03
  • 1
    $\begingroup$ What do you mean by "five best-performing"? What distinguishes the First best performing portfolio from the Second best performing, etc. $\endgroup$ – noob2 Jan 5 '18 at 15:33
  • $\begingroup$ By concrete I mean: weight of each stock to be in the range 1 - 10 %; sd of the portfolio to be for example 15 %. By "five best-performing" I mean: the First portfolio will have the highest return under the constraints: individual weight of each stock in the range 1 - 10 %, sd of portfolio = 15 %. Second portfolio will have the second highest return under the same constraints and so on. I am wondering if this can be done reliably, there are a lot of possible combinations: n combinations of 20 stocks' portfolios from 150 stocks universe and range of individual weights in each portfolio. $\endgroup$ – Kuker4e Jan 5 '18 at 17:23
  • $\begingroup$ - Universe of 150 stocks; - All possible combinations of portfolios consisiting of 20 stocks under the constraints: - Sd of each portfolio = 15 % - Individual weight of each stock in each portfolio >= 1 % & <= 10 % - The five portfolios from the above with the highest return $\endgroup$ – Kuker4e Jan 5 '18 at 17:44

Setting your desired constraints and finding the optimal portfolio is all possible with the R package "PortfolioAnalytics".

Unless you have some weird weight constraints (e.g. equally weighted) it is not possible to derive something like the porfolio with the second highest return, since the weights are in $\mathbb{R}$.

| improve this answer | |
  • $\begingroup$ May be it is not so difficult to find the optimal portfolio under sd = 15 % and individual weights in between 1 - 10 % using PortfolioAnalytics. However, I guess there may be more portfolios under these constraints and I want to find them. I will start to work on the task soon and will ask for help again if I am stuck. $\endgroup$ – Kuker4e Jan 5 '18 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.