sortino(): number
Sortino Ratio.
Calculates the Sortino ratio, a risk-adjusted performance measure that uses downside risk instead of standard deviation. It measures the return of an investment relative to the risk of negative returns.
Uses (mean(x) - frisk) / sqrt(mean(min(x - MAR, 0)^2)). frisk sets the numerator threshold; MAR sets the downside threshold.
Sortino ratio for a single asset
Sortino ratio for a single asset
import { assertEquals, assertAlmostEquals } 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]; assertAlmostEquals(sortino(x), 3.4010510161478655, 1.7005255080739327e-12);
x: array
Asset/portfolio returns
sortino(): array | matrix
Sortino Ratio.
Calculates the Sortino ratio, a risk-adjusted performance measure that uses downside risk instead of standard deviation. It measures the return of an investment relative to the risk of negative returns.
Uses (mean(x) - frisk) / sqrt(mean(min(x - MAR, 0)^2)). frisk sets the numerator threshold; MAR sets the downside threshold.
Sortino ratio for a single asset
Sortino ratio for a single asset
import { assertEquals, assertAlmostEquals } 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]; assertAlmostEquals(sortino(x), 3.4010510161478655, 1.7005255080739327e-12);
x: matrix
Asset/portfolio returns