function burkeratio
burkeratio(
x: array,
frisk?: number,
t?: number,
mode?: "simple" | "modified",
dim?: 0 | 1,
): number

Computes the Burke Ratio.

The Burke Ratio is a risk-adjusted performance metric that accounts for drawdowns. In 'simple' mode, it calculates the excess return over the risk-free rate divided by the square root of the sum of squared drawdowns. In 'modified' mode, the result is scaled by the square root of the number of data points.

Examples

Burke ratio for a single asset with simple mode

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];
assertEquals(burkeratio(x, 0, 12), 8.282140961596584);

Burke ratio with modified mode

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];

assertEquals(burkeratio(x, 0, 12, "modified"), 26.190429341222337);

Burke ratio for multiple assets (matrix)

import { assertEquals } from "jsr:@std/assert";

const x1 = [0.003, 0.026, 0.015, -0.009, 0.014];
const x2 = [0.024, 0.015, 0.066, -0.014, 0.039];
assertEquals(burkeratio([x1, x2], 0, 12), [9.680557600757295, 17.94570045241343]);

Parameters

Asset or portfolio returns

optional
frisk: number

Annual risk-free rate

optional
t: number

Frequency: 252 (daily), 52 (weekly), 12 (monthly), 4 (quarterly)

optional
mode: "simple" | "modified"

Calculation mode: 'simple' or 'modified'

optional
dim: 0 | 1

Dimension: 0 (row-wise), 1 (column-wise)

Return Type

number

The computed Burke Ratio

Throws

If an invalid mode is provided or if input arguments are invalid

burkeratio(
x: matrix,
frisk?: number,
t?: number,
mode?: "simple" | "modified",
dim?: 0 | 1,
): array

Computes the Burke Ratio.

The Burke Ratio is a risk-adjusted performance metric that accounts for drawdowns. In 'simple' mode, it calculates the excess return over the risk-free rate divided by the square root of the sum of squared drawdowns. In 'modified' mode, the result is scaled by the square root of the number of data points.

Examples

Burke ratio for a single asset with simple mode

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];
assertEquals(burkeratio(x, 0, 12), 8.282140961596584);

Burke ratio with modified mode

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];

assertEquals(burkeratio(x, 0, 12, "modified"), 26.190429341222337);

Burke ratio for multiple assets (matrix)

import { assertEquals } from "jsr:@std/assert";

const x1 = [0.003, 0.026, 0.015, -0.009, 0.014];
const x2 = [0.024, 0.015, 0.066, -0.014, 0.039];
assertEquals(burkeratio([x1, x2], 0, 12), [9.680557600757295, 17.94570045241343]);

Parameters

Asset or portfolio returns

optional
frisk: number

Annual risk-free rate

optional
t: number

Frequency: 252 (daily), 52 (weekly), 12 (monthly), 4 (quarterly)

optional
mode: "simple" | "modified"

Calculation mode: 'simple' or 'modified'

optional
dim: 0 | 1

Dimension: 0 (row-wise), 1 (column-wise)

Return Type

The computed Burke Ratio

Throws

If an invalid mode is provided or if input arguments are invalid