\HeaderA{TrackingError}{Calculate Tracking Error of returns against a benchmark}{TrackingError}
\keyword{ts}{TrackingError}
\keyword{multivariate}{TrackingError}
\keyword{distribution}{TrackingError}
\keyword{models}{TrackingError}
\begin{Description}\relax
A measure of the unexplained portion of performance relative to a benchmark.
\end{Description}
\begin{Usage}
\begin{verbatim}
TrackingError(Ra, Rb, scale = NA)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Ra}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{Rb}] return vector of the benchmark asset 
\item[\code{scale}] number of periods in a year (daily scale = 252, monthly scale = 12, quarterly scale = 4) 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Tracking error is calculated by taking the square root of the average of the squared deviations between the investment's returns and the benchmark's returns, then multiplying the result by the square root of the scale of the returns.

\deqn{ TrackingError = \sqrt{\sum\frac{(R_{a}-R_{b})^{2}}{len(R_{a})\sqrt{scale}}} }{}
\end{Details}
\begin{Value}
Tracking Error (number)
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{References}\relax
Sharpe, W.F. The Sharpe Ratio,\emph{Journal of Portfolio Management},Fall 1994, 49-58.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{InformationRatio}{InformationRatio}}
\code{\LinkA{TrackingError}{TrackingError}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(managers)
TrackingError(managers[,1,drop=FALSE], managers[,8,drop=FALSE]) 
TrackingError(managers[,1:6], managers[,8,drop=FALSE]) 
TrackingError(managers[,1:6], managers[,8:7,drop=FALSE])
\end{ExampleCode}
\end{Examples}

