File Exchange

## Sortino Ratio

version 1.0.0.0 (1.29 KB) by Lorenzo Brancali

### Lorenzo Brancali (view profile)

This file calculates the Sortino ratio of an investment asset, portfolio or strategy.

Updated 12 Mar 2012

The Sortino ratio measures the risk-adjusted return of an investment asset, portfolio or strategy. It is a modification of the Sharpe ratio but penalizes only those returns falling below a user-specified target. The Sortino ratio is similar to the Sharpe ratio, except it uses downside deviation for the denominator instead of standard deviation, the use of which doesn't discriminate between upside and downside volatility.

### Cite As

Lorenzo Brancali (2020). Sortino Ratio (https://www.mathworks.com/matlabcentral/fileexchange/35599-sortino-ratio), MATLAB Central File Exchange. Retrieved .

Christian Dandre

### Christian Dandre (view profile)

The code should be re-written as follows:

for j=1:size(R,2)

F=R(:,j);
F2=F-MAR;
F2(F2>=0)=0;

DD(:,j)=sqrt(sum(F2.^2)/length(F2));
S(:,j)=(mean(F)-MAR)/DD(:,j);

end

Gioia Gianmarco

Yair Altman

### Yair Altman (view profile)

DD = sqrt( sum((F3-MAR).^2) / length(F) )

argh with the editor here... :-)

Yair Altman

### Yair Altman (view profile)

Minor correction:

DD should be sqrt( sum(F3-MAR).^2 / length(F) )

i.e., divide by number of all returns, not just the number of downside returns.

Yair Altman

### Yair Altman (view profile)

Incorrect calculation of the Downside Deviation (DD) and therefore of the Sortino ratio!

It should be sqrt( sum(F3-MAR).^2 / length(F3) ) and *NOT* sqrt(sum(F3).^2) / length(F3), where F3=nonzeros(F(F<MAR))

Harry Lindner

### Harry Lindner (view profile)

##### MATLAB Release Compatibility
Created with R2008a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux