Accelerating the pace of engineering and science

# Documentation

### Contents

Class: PortfolioCVaR

Add group ratio constraints for portfolio weights to existing group ratio constraints for PortfolioCVaR object

UpperRatio)

## Description

obj = addGroupRatio(obj,GroupA,GroupB,LowerRatio) adds group ratio constraints for the portfolio weights to existing group ratio constraints with just a lower bound on the ratio between groups.

UpperRatio)
adds group ratio constraints for the portfolio weights to existing group ratio constraints with an additional option for UpperRatio.

Given base and comparison group matrices GroupA and GroupB and, either LowerRatio, or UpperRatio bounds, group ratio constraints require any portfolio in Port to satisfy the following:

`(GroupB * Port) .* LowerRatio <= GroupA * Port <= (GroupB * Port) .* UpperRatio`
 Caution   This collection of constraints usually requires that portfolio weights be nonnegative and that the products GroupA * Port and GroupB * Port are always nonnegative. Although negative portfolio weights and non-Boolean group ratio matrices are supported, use with caution.

## Tips

• You can also use dot notation to add group ratio constraints for the portfolio weights to existing group ratio constraints.

`obj = obj.addGroupRatio(GroupA, GroupB, LowerRatio, UpperRatio)`
• To remove group ratio constraints from a CVaR portfolio object using dot notation, enter empty arrays for the corresponding arrays.

## Input Arguments

obj

CVaR portfolio object [PortfolioCVaR].

GroupA

Matrix that forms base groups for comparison [matrix].

GroupB

Matrix that forms comparison groups [matrix].

 Note:   The group matrices GroupA and GroupB often indicate membership in groups, which means that their elements are usually either 0 or 1. Because of this interpretation, the GroupA and GroupB matrices can be logical or numerical arrays.

LowerRatio

Lower bound for ratio of GroupB groups to GroupA groups [vector].

 Note:   If input is scalar, LowerRatio undergoes scalar expansion to conform with the group matrices.

UpperRatio

(Optional) Upper bound for ratio of GroupB groups to GroupA groups [vector].

 Note:   If input is scalar, UpperRatio undergoes scalar expansion to conform with the group matrices.

## Output Arguments

 obj Updated CVaR portfolio object [PortfolioCVaR].

## Attributes

 Access public Static false Hidden false

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

## Examples

expand all

Set a group ratio constraint to ensure that the weight in financial assets does not exceed 50% of the weight in nonfinancial assets. Then add another group ratio constraint to ensure that the weight in financial assets constitute at least 20% of the weight in nonfinancial assets of the portfolio.

```p = PortfolioCVaR;
GA = [ true true true false false false ];    % financial companies
GB = [ false false false true true true ];    % nonfinancial companies
p = setGroupRatio(p, GA, GB, [], 0.5);

GA = [ true false true false true false ];    % odd-numbered companies
GB = [ false false false true true true ];    % nonfinancial companies
p = addGroupRatio(p, GA, GB, 0.2);

disp(p.NumAssets);
disp(p.GroupA);
disp(p.GroupB);
disp(p.LowerRatio);
disp(p.UpperRatio);
```
```     6

1     1     1     0     0     0
1     0     1     0     1     0

0     0     0     1     1     1
0     0     0     1     1     1

-Inf
0.2000

0.5000
Inf

```