File Exchange

image thumbnail

Sortino Ratio

version 1.0.0.0 (1.29 KB) by Lorenzo Brancali
This file calculates the Sortino ratio of an investment asset, portfolio or strategy.

2 Downloads

Updated 12 Mar 2012

View License

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 .

Comments and Ratings (6)

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

Yair Altman

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

argh with the editor here... :-)

Yair Altman

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

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

See for example http://www.redrockcapital.com/Sortino__A__Sharper__Ratio_Red_Rock_Capital.pdf

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