## Working with Other Portfolio Objects

The `PortfolioMAD` object is for MAD portfolio optimization. The `PortfolioCVaR` object is for CVaR portfolio optimization. The `Portfolio` object is for mean-variance portfolio optimization. Sometimes, you might want to examine portfolio optimization problems according to different combinations of return and risk proxies. A common example is that you want to do a MAD portfolio optimization and then want to work primarily with moments of portfolio returns. Suppose that you set up a MAD portfolio optimization problem with:

```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 ]; pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ]; p = PortfolioMAD; p = setAssetList(p, 'Bonds','Large-Cap Equities','Small-Cap Equities','Emerging Equities'); p = setInitPort(p, pwgt0); p = simulateNormalScenariosByMoments(p, m, C, 20000); p = setDefaultConstraints(p); ```

To work with the same problem in a mean-variance framework, you can use the scenarios from the `PortfolioMAD` object to set up a Portfolio object so that `p` contains a MAD optimization problem and `q` contains a mean-variance optimization problem based on the same data.

```q = Portfolio('AssetList', p.AssetList); q = estimateAssetMoments(q, p.getScenarios); q = setDefaultConstraints(q); pwgt = estimateFrontier(p); qwgt = estimateFrontier(q); ```

Since each object has a different risk proxy, it is not possible to compare results side by side. To obtain means and standard deviations of portfolio returns, you can use the functions associated with each object to obtain:

```pret = estimatePortReturn(p, pwgt); pstd = estimatePortStd(p, pwgt); qret = estimatePortReturn(q, qwgt); qstd = estimatePortStd(q, qwgt); [pret, qret] [pstd, qstd]```
```ans = 0.0592 0.0590 0.0730 0.0728 0.0868 0.0867 0.1006 0.1005 0.1145 0.1143 0.1283 0.1282 0.1421 0.1420 0.1559 0.1558 0.1697 0.1697 0.1835 0.1835 ans = 0.0767 0.0767 0.0829 0.0828 0.0989 0.0987 0.1208 0.1206 0.1461 0.1459 0.1732 0.1730 0.2042 0.2040 0.2453 0.2452 0.2929 0.2928 0.3458 0.3458```

To produce comparable results, you can use the returns or risks from one portfolio optimization as target returns or risks for the other portfolio optimization.

```qwgt = estimateFrontierByReturn(q, pret); qret = estimatePortReturn(q, qwgt); qstd = estimatePortStd(q, qwgt); [pret, qret] [pstd, qstd]```
```ans = 0.0592 0.0592 0.0730 0.0730 0.0868 0.0868 0.1006 0.1006 0.1145 0.1145 0.1283 0.1283 0.1421 0.1421 0.1559 0.1559 0.1697 0.1697 0.1835 0.1835 ans = 0.0767 0.0767 0.0829 0.0829 0.0989 0.0989 0.1208 0.1208 0.1461 0.1461 0.1732 0.1732 0.2042 0.2042 0.2453 0.2453 0.2929 0.2929 0.3458 0.3458```
Now it is possible to compare standard deviations of portfolio returns from either type of portfolio optimization.