Main Content

# estimatePortSharpeRatio

Estimate Sharpe ratio of given portfolio weights for Portfolio object

## Syntax

``````psharpe = estimatePortSharpeRatio(obj,pwgt)``````

## Description

example

``````psharpe = estimatePortSharpeRatio(obj,pwgt)``` estimates the Sharpe ratio of given portfolio weights for a `Portfolio` object. For details on the workflow, see Portfolio Object Workflow.```

## Examples

collapse all

This example shows how to find efficient portfolios that satisfy the target returns and then find the Sharpe ratios corresponding to each of the portfolios.

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%. Use `estimatePortSharpeRatio` to obtain the Sharpe ratio for the collection of portfolios (`pwgt`).

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

`pwgt` is a `NumAssets`-by-`NumPorts` matrix where `NumAssets` is the number of asset in the universe and `NumPorts` is the number of portfolios in the collection of portfolios.

`psharpe = estimatePortSharpeRatio(p,pwgt) `
```psharpe = 3×1 0.7796 0.8519 0.7406 ```

`psharpe` is a `NumPorts`-by-`1` vector, where `NumPorts` is the number of portfolios in the collection of portfolios.

## Input Arguments

collapse all

Object for portfolio, specified using a `Portfolio` object.

Note

The risk-free rate is obtained from the property `RiskFreeRate` in the Portfolio object. If you leave the `RiskFreeRate` unset, it is assumed to be `0`. For more information on creating a portfolio object, see `Portfolio`.

Data Types: `object`

Collection of portfolios, specified as a `NumAssets`-by- `NumPorts` matrix where `NumAssets` is the number of assets in the universe and `NumPorts` is the number of portfolios in the collection of portfolios.

Data Types: `double`

## Output Arguments

collapse all

Sharpe ratios of the given portfolios, returned as a `NumPorts`-by-`1` vector.

## More About

collapse all

### Sharpe Ratio

The Sharpe ratio is the ratio of the difference between the mean of portfolio returns and the risk-free rate divided by the standard deviation of portfolio returns for each portfolio in `pwgt`.

`estimatePortSharpeRatio` computes the Sharpe ratio with mean and standard deviation (which is the square-root of variance) of portfolio returns.

## Tips

You can also use dot notation to estimate the Sharpe ratio of given portfolio weights.

`psharpe = obj.estimatePortSharpeRatio(pwgt);`

Introduced in R2018a

Download ebook