[R-SIG-Finance] PortfolioAnalytics: "Upper volatility bound"-constraint

Brian G. Peterson br|@n @end|ng |rom br@verock@com
Thu Feb 3 17:02:23 CET 2022


I'm not certain that 'risk_aversion' won't work, but I think that it
might be limited to a 'quadratic_utility' objective, which implies a
quadratic solver.

I'll try to take a look at the code in the coming days and see if I can
construct a self-contained, minimal, example.

Regards,

Brian
 
-- 
Brian G. Peterson
ph: +1.773.459.4973
im: bgpbraverock

On Thu, 2022-02-03 at 16:56 +0100, Jarno Bergmeier wrote:
> I explicitly wanted to combine both at the same time, that was what I
> read in the study and what I was so far not able to code myself. But
> I do not know, whether the authors used R or some other software, so
> it might very well be possible that this cannot be implemented
> simultaneously with R/PortfolioAnalytics. I will continue to try it,
> or just use the risk aversion coefficient to distinguish between
> investor types. 
>  
> Nevertheless, I want to thank you again!
> Jarno
>  
> Gesendet: Donnerstag, 03. Februar 2022 um 15:59 Uhr
> Von: "Brian G. Peterson" <brian using braverock.com>
> An: "Jarno Bergmeier" <jarno.bergmeier using web.de>
> Cc: r-sig-finance using r-project.org
> Betreff: Re: Aw: Re: [R-SIG-Finance] PortfolioAnalytics: "Upper
> volatility bound"-constraint
> I think you might want:
> 
> port <- add.objective(port, type = "risk", name = "StdDev",  max =
> 0.0225)
> 
> I'm not sure that you'll be able to combine risk_aversion and a max
> bound.
>  
> Brian
>  
> --
> Brian G. Peterson
> ph: +1.773.459.4973
> im: bgpbraverock
>  
> On Thu, 2022-02-03 at 15:33 +0100, Jarno Bergmeier wrote:
> > Hello Brian,
> > thank you so much for your response and for offering me to follow
> > up on it. Setting an upper limit on the risk objective function is
> > exactly what I want to do, you’re right. Basically, I would like to
> > implement something like the “max_prisk”-argument from the risk
> > budget constraint, but for the portfolio variance in the risk
> > objective function. 
> > I tried to implement it, so that I could use it like this e.g., in
> > the portfolio specification:
> > port <- add.objective(port, type = "risk", name = "var",
> > risk_aversion = 2, max_portfvar = 0.0225)
> > But so far I was not able to come up with a function like that,
> > that I could still use to maximize quadratic utility and supply
> > with a custom moment function in the
> > optimize.portfolio/optimize.portfolio.rebalancing function. 
> > I would therefore be extremely appreciative if you would be able to
> > provide me with a worked example.
> >  
> > Kind regards,
> > Jarno
> >  
> > Gesendet: Mittwoch, 02. Februar 2022 um 16:57 Uhr
> > Von: "Brian G. Peterson" <brian using braverock.com>
> > An: "Jarno Bergmeier" <jarno.bergmeier using web.de>, r-sig-finance using r-
> > project.org
> > Betreff: Re: [R-SIG-Finance] PortfolioAnalytics: "Upper volatility
> > bound"-constraint
> > You are correct that adding this type of constraint would break
> > most convex solvers.
> >  
> > You can do this today with any of the global solvers by setting an
> > upper limit on the risk objective function.
> >  
> > I believe that you could do this with a conical solver constraint
> > as well.  You could access some conical solvers today via ROI in
> > PortfolioAnalytics, and we hope to add explicit conical solver
> > support via CVXR this summer in a Google Summer of Code project.
> >  so maybe look into using ROI as well for now.
> >  
> > Hopefully this helps.  Please follow up if you need a worked
> > example and I'll try to find some time to put one together.
> >  
> > Regards,
> >  
> > Brian
> >  
> > --
> > Brian G. Peterson
> > ph: +1.773.459.4973
> > im: bgpbraverock
> >  
> > On Wed, 2022-02-02 at 16:48 +0100, Jarno Bergmeier wrote:
> > > Hello everyone,
> > > I wanted to ask my first-ever question via R-SIG-Finance, with
> > > regard to portfolio constraints and the “PortfolioAnalytics”-
> > > package in R. 
> > > When distinguishing between certain types of investors, the
> > > empirical literature often employs certain values for the risk
> > > aversion coefficient. I now read a study that additionally makes
> > > use of upper volatility bounds (“less than or equal to…”) and was
> > > asking myself whether it would be possible to implement something
> > > like that for out-of-sample portfolio optimization with
> > > PortfolioAnalytics. 
> > > So, a code similar to this: 
> > >  
> > > port <- portfolio.spec(assets = colnames(returns_monthly))
> > > port <- add.constraint(port, "long_only")
> > > port <- add.constraint(port, "weight_sum", min_weight = 0.99,
> > > max_weight = 1.01)
> > > port <- add.objective(port, type = "risk", name = "var",
> > > risk_aversion = 2)
> > > port <- add.objective(port, type = "return", name = "mean")
> > > opt <- optimize.portfolio.rebalancing(R = returns_monthly,
> > > portfolio = port, optimize_method = "ROI", rebalance_on =
> > > "months", training_period = 60, rolling_window = 60)
> > >  
> > > that also includes another constraint, which gives an upper
> > > volatility bound for the portfolio? 
> > > I recently read a dissertation, that stated that such a
> > > constraint would be a convex one, which could not be expressed
> > > linearly, and therefore not solvable for many packages/solvers.
> > > Therefore, I wanted to ask if anyone here might have already
> > > implemented an upper volatility/variance constraint with
> > > PortfolioAnalytics or knows, whether it would be possible to
> > > successfully do this with the package?
> > >  
> > > Kind regards
> > > Jarno
> > >  
> > > _______________________________________________
> > > R-SIG-Finance using 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.

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list