Skip to content

Minimizing tracking error with restricted number of stocks

10 messages · Vivek Rao, Alec Schmidt, Jason Hart +1 more

#
Say I have a portfolio of 100 stocks and want to find a subset of 20 stocks with minimum tracking error in respect to the original portfolio. I wonder if a solver to this problem is implemented in some R-based library.

Thanks! Alec
#
Alec,
You could regress the returns of the 100-stock portfolio on the?returns of the 100 stocks, using the Lasso or Elastic Net(there are R packages glmnet and elasticnet?for these methods)?to zero out most of the regression?coefficients.
Vivek RaoBoston, MA
      From: Alec Schmidt <aschmid1 at stevens.edu>
 To: "r-sig-finance at r-project.org" <r-sig-finance at r-project.org> 
 Sent: Wednesday, March 7, 2018 8:55 PM
 Subject: [R-SIG-Finance] Minimizing tracking error with restricted number of stocks
   
Say I have a portfolio of 100 stocks and want to find a subset of 20 stocks with minimum tracking error in respect to the original portfolio. I wonder if a solver to this problem is implemented in some R-based library.

Thanks! Alec

??? [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
#
On 03/07/2018 07:55 PM, Alec Schmidt wrote:
PortfolioAnalytics can do this.
#
Thank you Brian. I searched PortfolioAnalytics.pdf for 'tracking' but didn't find one. Are there any implementation examples?
#
On 03/07/2018 08:39 PM, Alec Schmidt wrote:
See Ross Bennett's tutorial from R/Finance 2017:

https://rossb34.github.io/PortfolioAnalyticsPresentation2017/#1

Tracking Error example starts on slide 29, though you should find the 
rest of the tutorial useful.

- Brian
#
Great presentation, thanks for sharing the link

Sent from my iPad
#
This is a very handy doc indeed. I'm not sure though that examples on #29 - #31 address the problem I'm looking into. Namely, I need minimum tracking error with explicit constraint on the number of stocks that is lower than in the benchmark portfolio. Coleman, Li, and Henniger (2004) state that it's NP-hard problem and review a few heuristic methods. Is there one implemented in PortfolioAnalytics?
Thanks much! Alec
#
Alec,

I do not believe that there is a closed form optimization solution for
what you are trying to do.  In other words, I am agreeing with Coleman
et. al.

That is not the same thing as saying that you can't solve it with
PortfolioAnalytics.

First, add a position_limit constraint setting the number of non-zero
positions that you want in the portfolio

Second, add a tracking error objective as described in Ross'
presentation. 

(along with adding any other objectives or constraints you need in your
portfolio specification)

Third, utilize one of the global numerical solvers, e.g. DEoptim,
random portfolios, genSA, or pso.

The numerical solvers will not search the entire feasible space, but
rather search a subset of the feasible space stochastically.  You
should get acceptably close to the global optimum portfolio using these
methods in finite time.

Regards,

- Brian
On Thu, 2018-03-08 at 16:04 +0000, Alec Schmidt wrote:
#
Thank you Brian,
 position_limit constraint - that's exactly what I needed. But then I guess that's how NP-hard problem looks like: it may need lots of resampling.
Best, Alec
12 days later
#
I have a sample of daily portfolio returns and would like to estimate the weights using 252-day periods, starting with the 1st day of the sample, and do rebalancing every 126 days. How do I define the following parameters:
   rebalance_on,
   training_period,
  rolling_window 

Thank you, Alec