adjsharpe(): 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 RatioS= SkewnessK= Kurtosis
Adjusted Sharpe ratio for a single asset
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
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)
Adjusted Sharpe ratio for matrix (row-wise)
import { assertEquals, assertAlmostEquals } from "jsr:@std/assert"; const matrix = [[0.01, 0.02], [0.03, -0.01], [0.05, 0.04]]; const actual = adjsharpe(matrix, 0, 0) as number[]; const expected = [2.9168154723945086, 0.3572362384119537, 27.84232950922034]; assertEquals(actual.length, expected.length); actual.forEach((v, i) => assertAlmostEquals(v, expected[i], 1e-13));
x: array
Asset/portfolio returns
adjsharpe(): 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 RatioS= SkewnessK= Kurtosis
Adjusted Sharpe ratio for a single asset
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
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)
Adjusted Sharpe ratio for matrix (row-wise)
import { assertEquals, assertAlmostEquals } from "jsr:@std/assert"; const matrix = [[0.01, 0.02], [0.03, -0.01], [0.05, 0.04]]; const actual = adjsharpe(matrix, 0, 0) as number[]; const expected = [2.9168154723945086, 0.3572362384119537, 27.84232950922034]; assertEquals(actual.length, expected.length); actual.forEach((v, i) => assertAlmostEquals(v, expected[i], 1e-13));
x: matrix
Asset/portfolio returns