Module 11 · Financial Risk and Performance Statistics Lesson 109 of 120

Active Return and Tracking Error

Measuring benchmark-relative consistency on matched observations.

2:38 clip5:48:54–5:51:32 in the full courseWatch on YouTube

Transcript

19 sentences · select one to jump there

Check your understanding

Can tracking error be zero while the portfolio loses money?

Choose one answer

Code lab

Run it yourself

The lesson source in 7 languages. Edit it, run TypeScript and Python right here, and compare with the expected output.

109-active-return-and-tracking-error.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 109 of 120
 * Active Return and Tracking Error
 * Module 11: Financial Risk and Performance Statistics
 *
 * Scenario: Measuring benchmark-relative consistency on matched observations
 * Rule:     activeₜ=rₜ−bₜ; TE=sampleSD(active)
 *
 * Try it:   Can tracking error be zero while the portfolio loses money?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/financial-risk-and-performance-statistics/active-return-and-tracking-error/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson109() {
  const r=[.01,.02,-.01,.03],b=[.005,.015,-.005,.02];
  const active=r.map((v,i)=>v-b[i]);
  const mean=active.reduce((s,v)=>s+v,0)/active.length;
  const variance=active.reduce((s,v)=>s+(v-mean)**2,0)/(active.length-1);
  const te=Math.sqrt(variance);
  const result={active,mean,te,informationRatio:mean/te};
  return result;
}

export const checkedResult = {"active":[0.005,0.005000000000000001,-0.005,0.009999999999999998],"mean":0.00375,"te":0.006291528696058958,"informationRatio":0.5960395606792697};

// Run this file directly: npx tsx lessons/11-financial-risk-and-performance-statistics/109-active-return-and-tracking-error.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson109(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "active": [
    0.005,
    0.005000000000000001,
    -0.005,
    0.009999999999999998
  ],
  "mean": 0.00375,
  "te": 0.006291528696058958,
  "informationRatio": 0.5960395606792697
}

Prefer your own machine? Every file is in the course repository · open it in Codespaces.

Lesson notes

The rule

activeₜ=rₜ−bₜ; TE=sampleSD(active)