# estimatePortReturn

## 语法

``pret = estimatePortReturn(obj,pwgt)``

## 说明

``pret = estimatePortReturn(obj,pwgt)` 估计 `Portfolio`、`PortfolioCVaR` 或 `PortfolioMAD` 对象的投资组合收益均值（作为投资组合收益的代理）。有关使用这些不同对象时各自工作流的详细信息，请参阅 Portfolio 对象工作流、PortfolioCVaR 对象工作流和 PortfolioMAD 对象工作流。`

## 示例

```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 = estimateFrontierLimits(p); pret = estimatePortReturn(p, pwgt); disp(pret)```
``` 0.0590 0.1800 ```

```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); ```

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

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

```pwgt = estimateFrontierLimits(p); pret = estimatePortReturn(p, pwgt)```
```pret = 2×1 0.0072 0.0119 ```

`estimatePortReturn` 函数使用 MINLP 求解器来求解此问题。使用 `setSolverMINLP` 函数来配置 `SolverType` 和选项。

`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 IntMainSolverOptions: [1x1 optim.options.Intlinprog] NumIterationsEarlyIntegerConvergence: 30 ExtendedFormulation: 0 NumInnerCuts: 10 NumInitialOuterCuts: 10 ```

```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 ]; m = m/12; C = C/12; rng(11); AssetScenarios = mvnrnd(m, C, 20000); p = PortfolioCVaR; p = setScenarios(p, AssetScenarios); p = setDefaultConstraints(p); p = setProbabilityLevel(p, 0.95); pwgt = estimateFrontierLimits(p); pret = estimatePortReturn(p, pwgt); disp(pret)```
``` 0.0050 0.0154 ```

```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 ]; m = m/12; C = C/12; rng(11); AssetScenarios = mvnrnd(m, C, 20000); p = PortfolioMAD; p = setScenarios(p, AssetScenarios); p = setDefaultConstraints(p); pwgt = estimateFrontierLimits(p); pret = estimatePortReturn(p, pwgt); disp(pret)```
``` 0.0048 0.0154 ```

## 输出参量

`pwgt` 中的每个投资组合的投资组合收益均值估计，以 `NumPorts` 向量形式返回。

## 提示

`pret = obj.estimatePortReturn(pwgt);`