function omegaratio
omegaratio(
x: array,
mar?: number,
dim?: 0 | 1,
): number

Omega Ratio.

The Omega ratio is a measure of risk-return performance that divides the upside potential (gains) by the downside risk (losses) relative to a minimum acceptable return threshold.

Examples

Omega 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(omegaratio(x), 10.978260869565217);

Omega ratio with custom threshold

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

assertEquals(omegaratio([0.05, 0.03, 0.08, -0.02], 0.02), 5.333333333333334);

Omega ratio with negative threshold

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(omegaratio(x, -0.01), 53.611111111111114);

Parameters

asset/portfolio returns

optional
mar: number

minimum acceptable return (def: 0)

optional
dim: 0 | 1

dimension 0: row, 1: column (def: 0)

Return Type

number

Omega Ratio

omegaratio(
x: matrix,
mar?: number,
dim?: 0 | 1,
): array | matrix

Omega Ratio.

The Omega ratio is a measure of risk-return performance that divides the upside potential (gains) by the downside risk (losses) relative to a minimum acceptable return threshold.

Examples

Omega 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(omegaratio(x), 10.978260869565217);

Omega ratio with custom threshold

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

assertEquals(omegaratio([0.05, 0.03, 0.08, -0.02], 0.02), 5.333333333333334);

Omega ratio with negative threshold

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(omegaratio(x, -0.01), 53.611111111111114);

Parameters

asset/portfolio returns

optional
mar: number

minimum acceptable return (def: 0)

optional
dim: 0 | 1

dimension 0: row, 1: column (def: 0)

Return Type

Omega Ratio