import type { array, matrix } from "../types"; /** * Pain Ratio. * * A risk-adjusted measure with free risk and Pain index. * Pain Ratio = (Portfolio Return - RiskFree) / Pain Index * * It measures how much return is earned for each unit of pain (drawdown) experienced. * * @param x asset/portfolio returns * @param frisk annual free-risk rate (def: 0) * @param t frequency of data. 1: yearly, 4: quarterly, 12: monthly, 52: weekly, 252: daily (def: 252) * @param mode drawdown calculation. 'return','geometric' (def: 'return') * @param dim dimension 0: row, 1: column (def: 0) * @return Pain Ratio value(s) * * @example Single array of returns * ```ts * import { assertEquals } from "jsr:@std/assert"; * * var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; * assertEquals(painratio(x,0,12), 101.04495520047377); * * ``` * * @example Multiple arrays * ```ts * import { assertEquals } from "jsr:@std/assert"; * * var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; * * var y = [-0.005,0.081,0.04,-0.037,-0.061,0.058,-0.049,-0.021,0.062,0.058]; * assertEquals(painratio(x,0,12), 101.04495520047377); * assertEquals(painratio(y,0,12), 3.235687223114222); * ``` */ export default function painratio(x: array, frisk?: number, t?: number, mode?: string, dim?: 0 | 1): number; /** * Pain Ratio. * * A risk-adjusted measure with free risk and Pain index. * Pain Ratio = (Portfolio Return - RiskFree) / Pain Index * * It measures how much return is earned for each unit of pain (drawdown) experienced. * * @param x asset/portfolio returns * @param frisk annual free-risk rate (def: 0) * @param t frequency of data. 1: yearly, 4: quarterly, 12: monthly, 52: weekly, 252: daily (def: 252) * @param mode drawdown calculation. 'return','geometric' (def: 'return') * @param dim dimension 0: row, 1: column (def: 0) * @return Pain Ratio value(s) * * @example Single array of returns * ```ts * import { assertEquals } from "jsr:@std/assert"; * * var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; * assertEquals(painratio(x,0,12), 101.04495520047377); * * ``` * * @example Multiple arrays * ```ts * import { assertEquals } from "jsr:@std/assert"; * * var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; * * var y = [-0.005,0.081,0.04,-0.037,-0.061,0.058,-0.049,-0.021,0.062,0.058]; * assertEquals(painratio(x,0,12), 101.04495520047377); * assertEquals(painratio(y,0,12), 3.235687223114222); * ``` */ export default function painratio(x: matrix, frisk?: number, t?: number, mode?: string, dim?: 0 | 1): array | matrix; //# sourceMappingURL=painratio.d.ts.map