treynor(): number
Treynor Ratio.
Computes the Treynor ratio, a risk-adjusted performance measure that uses beta (systematic risk) instead of standard deviation. It measures excess return per unit of systematic risk.
Treynor ratio for a single asset against benchmark
Treynor ratio for a single asset against benchmark
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; assertEquals(treynor(x, z, 0.01/12), -0.09568702060685172);
Treynor ratio for multiple assets against benchmark
Treynor ratio for multiple assets against benchmark
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; const y = [-0.005, 0.081, 0.04, -0.037, -0.061, 0.058, -0.049, -0.021, 0.062, 0.058]; assertEquals(treynor(x, z, 0.01/12), -0.09568702060685172); assertEquals(treynor(y, z, 0.01/12), 0.029862503769903546);
Treynor ratio with zero risk-free rate
Treynor ratio with zero risk-free rate
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; assertEquals(treynor(x, z), -0.10035923840992064);
treynor(): array | matrix
Treynor Ratio.
Computes the Treynor ratio, a risk-adjusted performance measure that uses beta (systematic risk) instead of standard deviation. It measures excess return per unit of systematic risk.
Treynor ratio for a single asset against benchmark
Treynor ratio for a single asset against benchmark
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; assertEquals(treynor(x, z, 0.01/12), -0.09568702060685172);
Treynor ratio for multiple assets against benchmark
Treynor ratio for multiple assets against benchmark
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; const y = [-0.005, 0.081, 0.04, -0.037, -0.061, 0.058, -0.049, -0.021, 0.062, 0.058]; assertEquals(treynor(x, z, 0.01/12), -0.09568702060685172); assertEquals(treynor(y, z, 0.01/12), 0.029862503769903546);
Treynor ratio with zero risk-free rate
Treynor ratio with zero risk-free rate
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; const z = [0.04, -0.022, 0.043, 0.028, -0.078, -0.011, 0.033, -0.049, 0.09, 0.087]; assertEquals(treynor(x, z), -0.10035923840992064);