Relative constraint to a group in fportfolio in R

56 Views Asked by At

I am wondering if it is possible to set a relative constraint for a specific asset within a group of assets. I feel like this is a rather common situation in portfolio optimization constraining. Box and group constraints are pretty straight forward, but not a relative constraint for a single asset within a group. I am open to other packages but I seem to run into the same issue with PortfolioAnalytics in R too.

Below is what I have so far. Basic box constraints and one group constraint.

Constraints <- c("minW[1]=0.00","maxW[1]=.25",# Asset1
                 "minW[2]=0.00","maxW[2]=.5",# Asset2
                 "minW[3]=0.00","maxW[3]=.25",# Asset3
                 "minW[4]=0.00","maxW[4]=.05",# Asset4
                 "minW[5]=0.00","maxW[5]=.1",# Asset5
                 "minW[6]=0.00","maxW[6]=.05",# Asset6
                 "minW[7]=0.00","maxW[7]=.25",# Asset7
                 "minW[8]=0.00","maxW[8]=.05",# Asset8
                 "minW[9]=0.00","maxW[9]=.05",# Asset9
                 "minW[10]=0.00","maxW[10]=.1",# Asset10
                 "minW[11]=0.00","maxW[11]=.15",# Asset11
                 "minW[12]=0.00","maxW[12]=.05",# Asset12
                 "minW[13]=0.00","maxW[13]=.05",# Asset13
                 "minsumW[c(7,8)]=.01","maxsumW[c(7,8)]=.10")

What if I want to constrain asset 7 to be max of 50% of the sum of assets 7 & 8?

So: Asset 7 / (Asset 7 + Asset 8) <= 50%

0

There are 0 best solutions below