# estimateFrontierByReturn

Estimate optimal portfolios with targeted portfolio returns

## Syntax

``````[pwgt,pbuy,psell] = estimateFrontierByReturn(obj,TargetReturn)``````

## Description

example

``````[pwgt,pbuy,psell] = estimateFrontierByReturn(obj,TargetReturn)``` estimates optimal portfolios with targeted portfolio returns for `Portfolio`, `PortfolioCVaR`, or `PortfolioMAD` objects. For details on the respective workflows when using these different objects, see Portfolio Object Workflow, PortfolioCVaR Object Workflow, and PortfolioMAD Object Workflow.```

## Examples

collapse all

To obtain efficient portfolios that have targeted portfolio returns, the `estimateFrontierByReturn` function accepts one or more target portfolio returns and obtains efficient portfolios with the specified returns. Assume you have a universe of four assets where you want to obtain efficient portfolios with target portfolio returns of 6%, 9%, and 12%.

```m = [ 0.05; 0.1; 0.12; 0.18 ]; C = [ 0.0064 0.00408 0.00192 0; 0.00408 0.0289 0.0204 0.0119; 0.00192 0.0204 0.0576 0.0336; 0 0.0119 0.0336 0.1225 ]; p = Portfolio; p = setAssetMoments(p, m, C); p = setDefaultConstraints(p); pwgt = estimateFrontierByReturn(p, [0.06, 0.09, 0.12]); display(pwgt);```
```pwgt = 4×3 0.8772 0.5032 0.1293 0.0434 0.2488 0.4541 0.0416 0.0780 0.1143 0.0378 0.1700 0.3022 ```

When any one, or any combination of the constraints from '`Conditional'` `BoundType`, `MinNumAssets`, and `MaxNumAssets` are active, the portfolio problem is formulated as mixed integer programming problem and the MINLP solver is used.

Create a `Portfolio` object for three assets.

```AssetMean = [ 0.0101110; 0.0043532; 0.0137058 ]; AssetCovar = [ 0.00324625 0.00022983 0.00420395; 0.00022983 0.00049937 0.00019247; 0.00420395 0.00019247 0.00764097 ]; p = Portfolio('AssetMean', AssetMean, 'AssetCovar', AssetCovar); p = setDefaultConstraints(p); ```

Use `setBounds` with semicontinuous constraints to set xi = `0` or `0.02` <= `xi` <= `0.5` for all i = `1`,...`NumAssets`.

`p = setBounds(p, 0.02, 0.7,'BoundType', 'Conditional', 'NumAssets', 3); `

When working with a `Portfolio` object, the `setMinMaxNumAssets` function enables you to set up the limits on the number of assets invested (as known as cardinality) constraints. This sets the total number of allocated assets satisfying the Bound constraints that are between `MinNumAssets` and `MaxNumAssets`. By setting `MinNumAssets` = `MaxNumAssets` = 2, only two of the three assets are invested in the portfolio.

`p = setMinMaxNumAssets(p, 2, 2); `

Use `estimateFrontierByReturn` to estimate optimal portfolios with targeted portfolio returns.

`[pwgt, pbuy, psell] = estimateFrontierByReturn(p,[ 0.0072321, 0.0119084 ])`
```pwgt = 3×2 0 0.5000 0.6922 0 0.3078 0.5000 ```
```pbuy = 3×2 0 0.5000 0.6922 0 0.3078 0.5000 ```
```psell = 3×2 0 0 0 0 0 0 ```

The `estimateFrontierByReturn` function uses the MINLP solver to solve this problem. Use the `setSolverMINLP` function to configure the `SolverType` and options.

`p.solverTypeMINLP`
```ans = 'OuterApproximation' ```
`p.solverOptionsMINLP`
```ans = struct with fields: MaxIterations: 1000 AbsoluteGapTolerance: 1.0000e-07 RelativeGapTolerance: 1.0000e-05 NonlinearScalingFactor: 1000 ObjectiveScalingFactor: 1000 Display: 'off' CutGeneration: 'basic' MaxIterationsInactiveCut: 30 ActiveCutTolerance: 1.0000e-07 IntMasterSolverOptions: [1x1 optim.options.Intlinprog] NumIterationsEarlyIntegerConvergence: 30 ```

To obtain efficient portfolios that have targeted portfolio returns, the `estimateFrontierByReturn` function accepts one or more target portfolio returns and obtains efficient portfolios with the specified returns. Assume you have a universe of four assets where you want to obtain efficient portfolios with target portfolio returns of 7%, 10%, and 13%.

```m = [ 0.05; 0.1; 0.12; 0.18 ]; C = [ 0.0064 0.00408 0.00192 0; 0.00408 0.0289 0.0204 0.0119; 0.00192 0.0204 0.0576 0.0336; 0 0.0119 0.0336 0.1225 ]; rng(11); p = PortfolioCVaR; p = simulateNormalScenariosByMoments(p, m, C, 2000); p = setDefaultConstraints(p); p = setProbabilityLevel(p, 0.95); pwgt = estimateFrontierByReturn(p, [0.07 0.10, 0.13]); display(pwgt);```
```pwgt = 4×3 0.7370 0.3067 0 0.1502 0.3937 0.4396 0.0290 0.0997 0.1360 0.0838 0.1999 0.4244 ```

The function `rng`($seed$) is used to reset the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

To obtain efficient portfolios that have targeted portfolio returns, the `estimateFrontierByReturn` function accepts one or more target portfolio returns and obtains efficient portfolios with the specified returns. Assume you have a universe of four assets where you want to obtain efficient portfolios with target portfolio returns of 7%, 10%, and 13%.

```m = [ 0.05; 0.1; 0.12; 0.18 ]; C = [ 0.0064 0.00408 0.00192 0; 0.00408 0.0289 0.0204 0.0119; 0.00192 0.0204 0.0576 0.0336; 0 0.0119 0.0336 0.1225 ]; rng(11); p = PortfolioMAD; p = simulateNormalScenariosByMoments(p, m, C, 2000); p = setDefaultConstraints(p); pwgt = estimateFrontierByReturn(p, [0.07 0.10, 0.13]); display(pwgt);```
```pwgt = 4×3 0.7437 0.3146 0 0.1357 0.3837 0.4425 0.0326 0.0939 0.1319 0.0881 0.2079 0.4255 ```

The function `rng`($seed$) is used to reset the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

## Input Arguments

collapse all

Object for portfolio, specified using `Portfolio`, `PortfolioCVaR`, or `PortfolioMAD` object. For more information on creating a portfolio object, see

Data Types: `object`

Target values for portfolio return, specified as a `NumPorts` vector.

Note

`TargetReturn` specifies target returns for portfolios on the efficient frontier. If any `TargetReturn` values are outside the range of returns for efficient portfolios, the `TargetReturn` is replaced with the minimum or maximum efficient portfolio return, depending upon whether the target return is below or above the range of efficient portfolio returns.

Data Types: `double`

## Output Arguments

collapse all

Optimal portfolios on the efficient frontier with specified target returns from `TargetReturn`, returned as a `NumAssets`-by-`NumPorts` matrix. `pwgt` is returned for a `Portfolio`, `PortfolioCVaR`, or `PortfolioMAD` input object (`obj`).

Purchases relative to an initial portfolio for optimal portfolios on the efficient frontier, returned as `NumAssets`-by-`NumPorts` matrix.

Note

If no initial portfolio is specified in `obj.InitPort`, that value is assumed to be `0` such that ```pbuy = max(0, pwgt)``` and ```psell = max(0, -pwgt)```.

`pbuy` is returned for a `Portfolio`, `PortfolioCVaR`, or `PortfolioMAD` input object (`obj`).

Sales relative to an initial portfolio for optimal portfolios on the efficient frontier, returned as a `NumAssets`-by-`NumPorts` matrix.

Note

If no initial portfolio is specified in `obj.InitPort`, that value is assumed to be `0` such that ```pbuy = max(0, pwgt)``` and ```psell = max(0, -pwgt)```.

`psell` is returned for `Portfolio`, `PortfolioCVaR`, or `PortfolioMAD` input object (`obj`).

## Tips

You can also use dot notation to estimate optimal portfolios with targeted portfolio returns.

```[pwgt, pbuy, psell] = obj.estimateFrontierByReturn(TargetReturn); ```

## Version History

Introduced in R2011a