martinratio(): number
Martin Ratio.
A risk-adjusted performance measure that uses the Ulcer Index to adjust for risk. Martin Ratio = (Portfolio Return - RiskFree) / Ulcer Index
Martin ratio for a single asset
Martin ratio for a single asset
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(martinratio(x, 0, 12), 44.42545597931942);
Martin ratio for multiple assets
Martin ratio for multiple assets
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 y = [-0.005, 0.081, 0.04, -0.037, -0.061, 0.058, -0.049, -0.021, 0.062, 0.058]; assertEquals(martinratio(x, 0, 12), 44.42545597931942); assertEquals(martinratio(y, 0, 12), 2.438364078885411);
x: array
Asset/portfolio returns
Frequency of data. 1: yearly, 4: quarterly, 12: monthly, 52: weekly, 252: daily (defaults to 252)
Drawdown calculation mode: 'return' or 'geometric' (defaults to 'return')
martinratio(): array | matrix
Martin Ratio.
A risk-adjusted performance measure that uses the Ulcer Index to adjust for risk. Martin Ratio = (Portfolio Return - RiskFree) / Ulcer Index
Martin ratio for a single asset
Martin ratio for a single asset
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(martinratio(x, 0, 12), 44.42545597931942);
Martin ratio for multiple assets
Martin ratio for multiple assets
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 y = [-0.005, 0.081, 0.04, -0.037, -0.061, 0.058, -0.049, -0.021, 0.062, 0.058]; assertEquals(martinratio(x, 0, 12), 44.42545597931942); assertEquals(martinratio(y, 0, 12), 2.438364078885411);
x: matrix
Asset/portfolio returns
Frequency of data. 1: yearly, 4: quarterly, 12: monthly, 52: weekly, 252: daily (defaults to 252)
Drawdown calculation mode: 'return' or 'geometric' (defaults to 'return')