function adjsharpe
adjsharpe(
x: array,
frisk?: number,
dim?: 0 | 1,
): number

Computes the Adjusted Sharpe Ratio.

The Adjusted Sharpe Ratio accounts for skewness and kurtosis with a penalty factor for negative skewness and excess kurtosis.

Adjusted Sharpe Ratio formula: ASR = SR × [1 + (S / 6) × SR - ((K - 3) / 24) × SR²] where:

  • SR = Sharpe Ratio
  • S = Skewness
  • K = Kurtosis

Examples

Adjusted Sharpe 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(adjsharpe(x), 0.8309256847278014);

Adjusted Sharpe ratio with risk-free rate

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

assertEquals(adjsharpe([0.05, 0.03, 0.08, -0.02], 0.02), 0.3510454044056545);

Adjusted Sharpe ratio for matrix (row-wise)

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

const matrix = [[0.01, 0.02], [0.03, -0.01], [0.05, 0.04]];
assertEquals(adjsharpe(matrix, 0, 0), [2.9168154723945086, 0.3572362384119537, 27.84232950922034]);

Parameters

Asset/portfolio returns

optional
frisk: number

Annual risk-free rate (defaults to 0)

optional
dim: 0 | 1

Dimension to operate on (0: row-wise, 1: column-wise, defaults to 0)

Return Type

number

The computed Adjusted Sharpe Ratio

Throws

If the input is invalid

adjsharpe(
x: matrix,
frisk?: number,
dim?: 0 | 1,
): array | matrix

Computes the Adjusted Sharpe Ratio.

The Adjusted Sharpe Ratio accounts for skewness and kurtosis with a penalty factor for negative skewness and excess kurtosis.

Adjusted Sharpe Ratio formula: ASR = SR × [1 + (S / 6) × SR - ((K - 3) / 24) × SR²] where:

  • SR = Sharpe Ratio
  • S = Skewness
  • K = Kurtosis

Examples

Adjusted Sharpe 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(adjsharpe(x), 0.8309256847278014);

Adjusted Sharpe ratio with risk-free rate

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

assertEquals(adjsharpe([0.05, 0.03, 0.08, -0.02], 0.02), 0.3510454044056545);

Adjusted Sharpe ratio for matrix (row-wise)

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

const matrix = [[0.01, 0.02], [0.03, -0.01], [0.05, 0.04]];
assertEquals(adjsharpe(matrix, 0, 0), [2.9168154723945086, 0.3572362384119537, 27.84232950922034]);

Parameters

Asset/portfolio returns

optional
frisk: number

Annual risk-free rate (defaults to 0)

optional
dim: 0 | 1

Dimension to operate on (0: row-wise, 1: column-wise, defaults to 0)

Return Type

The computed Adjusted Sharpe Ratio

Throws

If the input is invalid