%% Use Information Ratio to Compute Tracking Error
% This example show how to calculate the tracking error using inforatio with example data, where the mean return of the market series is used as the return of the benchmark.
% Given an asset or portfolio of assets and a benchmark, the relative standard deviation of returns between the asset or portfolio of assets and the benchmark is called tracking error.

load FundMarketCash 
Returns = tick2ret(TestData);
Benchmark = Returns(:,2);
[InfoRatio, TrackingError] = inforatio(Returns, Benchmark)

% Tracking error, also know as active risk, measures the volatility of active returns. Tracking error is a useful measure of performance relative to a benchmark since it is in units of asset returns. For example, the tracking error of 1.87% for the fund relative to the market in this example is reasonable for an actively managed, large-cap value fund.
% Copyright 2020 The MathWorks, Inc.