\HeaderA{Return.cumulative}{calculate a compounded (geometric) cumulative return}{Return.cumulative}
\keyword{ts}{Return.cumulative}
\keyword{multivariate}{Return.cumulative}
\keyword{distribution}{Return.cumulative}
\keyword{models}{Return.cumulative}
\begin{Description}\relax
This is a useful function for calculating cumulative return over a period of time, say a calendar year.  Can produce simple or geometric return.
\end{Description}
\begin{Usage}
\begin{verbatim}
Return.cumulative(R, geometric = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{R}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{geometric}] generate geometric (TRUE) or simple (FALSE) returns, default TRUE 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
product of all the individual period returns

\deqn{(1+r_{1})(1+r_{2})(1+r_{3})\ldots(1+r_{n})-1=prod(1+R)-1}{}
\end{Details}
\begin{Value}
cumulative simple or geometric return
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{References}\relax
Bacon, Carl. \emph{Practical Portfolio Performance Measurement and Attribution}. Wiley. 2004. p. 6
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Return.annualized}{Return.annualized}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(managers)
Return.cumulative(managers[,1,drop=FALSE])
Return.cumulative(managers[,1:8])
Return.cumulative(managers[,1:8],geometric=FALSE)
\end{ExampleCode}
\end{Examples}

