The benchmark calculator creates a daily time series of returns as well as a benchmark value from a date range and index weights.

The benchmark calculation generates differences using natural logs and back-fills data to produce a gapless, smooth daily series for each individual index. When generating a blended benchmark, the returns of each index are weighted according to the coefficient input.

# Why Log Returns?

There are many reasons to use logarithmic returns rather than simple percentage returns. Consider this example data of a price index:

Each of the two return calculations is shown below. First, notice how the log return calculation allows for mathematical (and programmatic) ease. While the percent change formula allows for potential division by 0, the log return formula is a simple subtraction.

In the table below, it is illustrated how log returns are additive over time. The sum of the returns at day 1 and 2 is equal to the return between day 1 and 3 (calculated in the last row of the table above). Percent returns are not additive over time.

# Data Back-Filling

Input data may not always be complete. A major cause of this is the inconsistent reporting of various market indexes. Consider that the CPI is reported once per month while the S&P 500 is reported almost every market date. Simply blending these two indexes on reports will see inconsistent spikes on days when the CPI is reported and will present a misleading time series of the blended benchmark, especially if the reported changes are at all significant. Instead, the benchmark calculator smooths out these changes over days in which data is not reported. Consider the following example data:

In the given date range, the S&P 500 is reported 16 times while the CPI is only reported twice. The "days" column shows the number of days since the last reported value.

The calculated returns are distributed evenly over days without reported values, thus smoothing out changes over time. The given date range with "back-filled" data is shown below. Notice the repetition of values throughout the series.

All indexes will have a functional reported value for every calendar day, allowing the blended benchmark value to exist on a continuous, uninterrupted time series.

It is easiest to see by looking at the CPI return time series. Because only two values were reported, the CPI saw a return of 0.005461 over 33 days.

(0.005461 / 33) = 0.000165

Recall that log returns are time additive. Thus, the functional return of the CPI on every one of these 33 days is 0.000165!

Also note that the CPI has no return value on 2017-12-29 as no market value data had been previously reported within the given date range. This may also occur if the date range begins before the inception of a component index. The benchmark calculation is built to handle these data gaps as well.

# Index Weighting

Each input index will be weighted based on chosen coefficients. The above data could have been generated using the following parameters:

Start Date: 2017-12-28

End Date: 2018-01-31

Coefficients:

S&P 500: 70%

CPI: 30%

The following tables show how the indexes are weighted.

The weighting is robust to missing data. In a more complex blending of indexes, the component indexes will all be normalized relative to whichever indexes have data on a given day. An example of this normalization is represented below.

*Only a slice of the previous data is represented for brevity.*

Notice how the total weight is divided from the component weighted returns. For most days, this division has no effect as the total weight is 1.0. However on 2017-12-29, the total weight is only 0.7 because the CPI has no data. Therefore, dividing out the total weight maintains the original unweighted return value of the S&P.

A time series of blended benchmark returns has been calculated!

From this, we can generate market values of this blended benchmark. This is far more useful when comparing the value over time (just like the market indexes we started with!)

## A break to review some concepts...

Before the next calculation step, we will briefly return to percentage returns for purpose of example. Consider again the first data set.

Here again is the percent return calculation now depicted in a few slightly different ways.

Notice how the return value is calculated by subtracting 1 (as depicted in the third calculation). It follows that adding 1 back to the value will produce a coefficient for change

(e.g. 110 * 1.0909... = 120).

With log returns, a similar "reversing" calculation will be made.

# Market Value Time Series

A mathematical property of natural log will be used. The ^ denotes taking a power.

e^(ln(x)) = x

Therefore, taking e^return for each return will give a change multiplier. The following table shows this calculation:

Note that with values nearer to 0, the result is very close to simply adding 1. This is because e^0 = 1.

Finally, a cumulative product is calculated from this series of change rates to generate a time series.

The benchmark calculator multiplies each of these values by an initial benchmark value of 100. See the result below:

Below is shown the finished calculation, a return time series and a market value time series.