\HeaderA{sortDrawdowns}{order list of drawdowns from worst to best}{sortDrawdowns}
\keyword{ts}{sortDrawdowns}
\keyword{multivariate}{sortDrawdowns}
\keyword{distribution}{sortDrawdowns}
\keyword{models}{sortDrawdowns}
\begin{Description}\relax
sortDrawdowns(findDrawdowns(R))
Gives the drawdowns in order of worst to best
\end{Description}
\begin{Usage}
\begin{verbatim}
sortDrawdowns(runs)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{runs}] pass in runs array from findDrawdowns to be sorted 
\end{ldescription}
\end{Arguments}
\begin{Value}
sorted list
\begin{ldescription}
\item[\code{return }] depth of drawdown
\item[\code{from }] starting period
\item[\code{to }] ending period
\item[\code{length }] length in periods
\end{ldescription}
\end{Value}
\begin{Author}\relax
Peter Carl \\
modified with permission from prototype function by Sankalp Upadhyay
\end{Author}
\begin{References}\relax
Bacon, C. \emph{Practical Portfolio Performance Measurement and Attribution}. Wiley. 2004. p. 88 \\
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{DownsideDeviation}{DownsideDeviation}}  \\
\code{\LinkA{maxDrawdown}{maxDrawdown}}   \\
\code{\LinkA{findDrawdowns}{findDrawdowns}} \\
\code{\LinkA{sortDrawdowns}{sortDrawdowns}} \\
\code{\LinkA{chart.Drawdown}{chart.Drawdown}} \\
\code{\LinkA{table.Drawdowns}{table.Drawdowns}} \\
\code{\LinkA{table.DownsideRisk}{table.DownsideRisk}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(edhec)
findDrawdowns(edhec[,"Funds of Funds", drop=FALSE])
sortDrawdowns(findDrawdowns(edhec[,"Funds of Funds", drop=FALSE]))
\end{ExampleCode}
\end{Examples}

