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

________________________________________

From: Brian G. Peterson <

[hidden email]>

Sent: Thursday, March 8, 2018 11:13 AM

To: Alec Schmidt; Jason Hart

Cc: R-SIG-Finance

Subject: Re: [R-SIG-Finance] Minimizing tracking error with restricted number of stocks

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:

> 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

> ________________________________________

> From: R-SIG-Finance <

[hidden email]> on behalf

> of Jason Hart <

[hidden email]>

> Sent: Thursday, March 8, 2018 9:46 AM

> To: Brian G. Peterson

> Cc: R-SIG-Finance

> Subject: Re: [R-SIG-Finance] Minimizing tracking error with

> restricted number of stocks

>

> Great presentation, thanks for sharing the link

>

> Sent from my iPad

>

> > On Mar 7, 2018, at 10:00 PM, Brian G. Peterson <

[hidden email]
> > > wrote:

> >

> > > On 03/07/2018 08:39 PM, Alec Schmidt wrote:

> > > Thank you Brian. I searched PortfolioAnalytics.pdf for 'tracking'

> > > but didn't find one. Are there any implementation examples?

> >

> > 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

> >

> > > ________________________________________

> > > From: R-SIG-Finance <

[hidden email]> on

> > > behalf of Brian G. Peterson <

[hidden email]>

> > > Sent: Wednesday, March 7, 2018 9:14 PM

> > > To:

[hidden email]
> > > Subject: Re: [R-SIG-Finance] Minimizing tracking error with

> > > restricted number of stocks

> > > > On 03/07/2018 07:55 PM, Alec Schmidt wrote:

> > > > 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.

> > >

> > > PortfolioAnalytics can do this.

> > >

> >

> > _______________________________________________

> >

[hidden email] 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.

>

> _______________________________________________

>

[hidden email] 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.

>

_______________________________________________

[hidden email] 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.