@mojir/lits 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -8
- package/dist/cli/cli.js +1264 -909
- package/dist/cli/src/Lits/Lits.d.ts +8 -2
- package/dist/cli/src/builtin/bindingNode.d.ts +2 -1
- package/dist/cli/src/builtin/interface.d.ts +3 -2
- package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/cli/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/cli/src/evaluator/index.d.ts +3 -2
- package/dist/cli/src/evaluator/interface.d.ts +3 -2
- package/dist/cli/src/utils/maybePromise.d.ts +54 -0
- package/dist/full.esm.js +1 -1
- package/dist/full.esm.js.map +1 -1
- package/dist/full.js +1 -1
- package/dist/full.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +1 -1
- package/dist/lits.iife.js.map +1 -1
- package/dist/modules/assert.esm.js +1 -1
- package/dist/modules/assert.esm.js.map +1 -1
- package/dist/modules/assert.js +1 -1
- package/dist/modules/assert.js.map +1 -1
- package/dist/modules/collection.esm.js +1 -1
- package/dist/modules/collection.esm.js.map +1 -1
- package/dist/modules/collection.js +1 -1
- package/dist/modules/collection.js.map +1 -1
- package/dist/modules/grid.esm.js +1 -1
- package/dist/modules/grid.esm.js.map +1 -1
- package/dist/modules/grid.js +1 -1
- package/dist/modules/grid.js.map +1 -1
- package/dist/modules/number-theory.esm.js +1 -1
- package/dist/modules/number-theory.esm.js.map +1 -1
- package/dist/modules/number-theory.js +1 -1
- package/dist/modules/number-theory.js.map +1 -1
- package/dist/modules/sequence.esm.js +1 -1
- package/dist/modules/sequence.esm.js.map +1 -1
- package/dist/modules/sequence.js +1 -1
- package/dist/modules/sequence.js.map +1 -1
- package/dist/modules/src/Lits/Lits.d.ts +8 -2
- package/dist/modules/src/builtin/bindingNode.d.ts +2 -1
- package/dist/modules/src/builtin/interface.d.ts +3 -2
- package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/modules/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/modules/src/evaluator/index.d.ts +3 -2
- package/dist/modules/src/evaluator/interface.d.ts +3 -2
- package/dist/modules/src/utils/maybePromise.d.ts +54 -0
- package/dist/modules/vector.esm.js +1 -1
- package/dist/modules/vector.esm.js.map +1 -1
- package/dist/modules/vector.js +1 -1
- package/dist/modules/vector.js.map +1 -1
- package/dist/src/Lits/Lits.d.ts +8 -2
- package/dist/src/builtin/bindingNode.d.ts +2 -1
- package/dist/src/builtin/interface.d.ts +3 -2
- package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/src/evaluator/index.d.ts +3 -2
- package/dist/src/evaluator/interface.d.ts +3 -2
- package/dist/src/utils/maybePromise.d.ts +54 -0
- package/dist/testFramework.esm.js +1 -1
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +1 -1
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.esm.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/number.ts","../../src/typeGuards/annotatedArrays.ts","../../src/typeGuards/litsFunction.ts","../../src/typeGuards/lits.ts","../../src/utils/getAssertionError.ts","../../src/utils/arity.ts","../../src/builtin/modules/vector/docs.ts","../../src/builtin/modules/vector/outliers.ts","../../src/builtin/modules/vector/percentile.ts","../../src/builtin/modules/vector/quartiles.ts","../../src/builtin/modules/vector/calcMean.ts","../../src/builtin/modules/vector/reductionFunctions/mean.ts","../../src/builtin/modules/vector/calcMedian.ts","../../src/builtin/modules/vector/reductionFunctions/median.ts","../../src/builtin/modules/vector/calcVariance.ts","../../src/builtin/modules/vector/reductionFunctions/variance.ts","../../src/builtin/modules/vector/calcStdDev.ts","../../src/builtin/modules/vector/reductionFunctions/standardDeviation.ts","../../src/builtin/modules/vector/reductionFunctions/iqr.ts","../../src/builtin/modules/vector/reductionFunctions/span.ts","../../src/builtin/modules/vector/reductionFunctions/skewness.ts","../../src/builtin/modules/vector/reductionFunctions/kurtosis.ts","../../src/builtin/modules/vector/reductionFunctions/rms.ts","../../src/builtin/modules/vector/reductionFunctions/mad.ts","../../src/builtin/modules/vector/calcMad.ts","../../src/builtin/modules/vector/reductionFunctions/medad.ts","../../src/builtin/modules/vector/calcMedad.ts","../../src/builtin/modules/vector/reductionFunctions/giniCoefficient.ts","../../src/builtin/modules/vector/reductionFunctions/entropy.ts","../../src/builtin/modules/vector/entropy.ts","../../src/builtin/modules/vector/reductionFunctions/index.ts","../../src/builtin/modules/vector/reductionFunctions/sum.ts","../../src/builtin/modules/vector/reductionFunctions/prod.ts","../../src/builtin/modules/vector/index.ts","../../src/builtin/modules/vector/mode.ts","../../src/builtin/modules/vector/histogram.ts","../../src/builtin/modules/vector/bincount.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getLitsErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class LitsError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getLitsErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, LitsError.prototype)\n this.name = 'LitsError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends LitsError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends LitsError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends LitsError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isLitsError(error: unknown): error is LitsError {\n return error instanceof LitsError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, LitsFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isLitsFunction(func: unknown): func is LitsFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isLitsFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new LitsError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import { LitsError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new LitsError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new LitsError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new LitsError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new LitsError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new LitsError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new LitsError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { LitsFunction, NativeJsFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isLitsFunction(value: unknown): value is LitsFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as LitsFunction)[FUNCTION_SYMBOL]\n}\nexport function asLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsFunction {\n assertLitsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is LitsFunction {\n if (!isLitsFunction(value))\n throw getAssertionError('LitsFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isLitsFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isNativeJsFunction(value: unknown): value is NativeJsFunction {\n return isLitsFunction(value) && value.functionType === 'NativeJsFunction'\n}\nexport function asNativeJsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): NativeJsFunction {\n assertNativeJsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertNativeJsFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is NativeJsFunction {\n if (!isNativeJsFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { REGEXP_SYMBOL } from '../utils/symbols'\nimport { isLitsFunction } from './litsFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isLitsFunction(value)\n || isRegularExpression(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nfunction isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isLitsFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsError {\n return new LitsError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { Arity } from '../builtin/interface'\nimport { LitsError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/lits'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new LitsError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new LitsError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'mean': {\n category: 'vector',\n description: 'Returns the **mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'mean([1, 2, 3])',\n 'mean([1, 2, -3])',\n ],\n seeAlso: ['mean', 'vector.moving-mean', 'vector.centered-moving-mean', 'vector.running-mean', 'vector.geometric-mean', 'vector.harmonic-mean', 'vector.median', 'vector.mode', 'vector.sum', 'vector.rms'],\n },\n 'moving-mean': {\n category: 'vector',\n description: 'Returns the **moving mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-mean } = import(\"vector\");\\nmoving-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-mean } = import(\"vector\");\\nmoving-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['moving-fn', 'vector.mean', 'vector.centered-moving-mean', 'vector.running-mean'],\n },\n 'centered-moving-mean': {\n category: 'vector',\n description: 'Returns the **centered moving mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.mean', 'vector.moving-mean', 'vector.running-mean'],\n },\n 'running-mean': {\n category: 'vector',\n description: 'Returns the **running mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-mean } = import(\"vector\");\\nrunning-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['running-fn', 'vector.mean', 'vector.moving-mean', 'vector.centered-moving-mean'],\n },\n 'geometric-mean': {\n category: 'vector',\n description: 'Returns the **geometric mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **geometric mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { geometric-mean } = import(\"vector\");\\ngeometric-mean([1, 2, 3])',\n 'let { geometric-mean } = import(\"vector\");\\ngeometric-mean([1, 2, 9])',\n ],\n seeAlso: ['vector.moving-geometric-mean', 'vector.centered-moving-geometric-mean', 'vector.running-geometric-mean', 'vector.mean', 'vector.harmonic-mean'],\n },\n 'moving-geometric-mean': {\n category: 'vector',\n description: 'Returns the **moving geometric mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving geometric mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-geometric-mean } = import(\"vector\");\\nmoving-geometric-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-geometric-mean } = import(\"vector\");\\nmoving-geometric-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.centered-moving-geometric-mean', 'vector.running-geometric-mean'],\n },\n 'centered-moving-geometric-mean': {\n category: 'vector',\n description: 'Returns the **centered moving geometric mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving geometric mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.moving-geometric-mean', 'vector.running-geometric-mean'],\n },\n 'running-geometric-mean': {\n category: 'vector',\n description: 'Returns the **running geometric mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running geometric mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-geometric-mean } = import(\"vector\");\\nrunning-geometric-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.moving-geometric-mean', 'vector.centered-moving-geometric-mean'],\n },\n 'harmonic-mean': {\n category: 'vector',\n description: 'Returns the **harmonic mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **harmonic mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { harmonic-mean } = import(\"vector\");\\nharmonic-mean([1, 2, 3])',\n 'let { harmonic-mean } = import(\"vector\");\\nharmonic-mean([1, 2, 9])',\n ],\n seeAlso: ['vector.moving-harmonic-mean', 'vector.centered-moving-harmonic-mean', 'vector.running-harmonic-mean', 'vector.mean', 'vector.geometric-mean'],\n },\n 'moving-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **moving harmonic mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving harmonic mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-harmonic-mean } = import(\"vector\");\\nmoving-harmonic-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-harmonic-mean } = import(\"vector\");\\nmoving-harmonic-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.centered-moving-harmonic-mean', 'vector.running-harmonic-mean'],\n },\n 'centered-moving-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **centered moving harmonic mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving harmonic mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.moving-harmonic-mean', 'vector.running-harmonic-mean'],\n },\n 'running-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **running harmonic mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running harmonic mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-harmonic-mean } = import(\"vector\");\\nrunning-harmonic-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.moving-harmonic-mean', 'vector.centered-moving-harmonic-mean'],\n },\n 'median': {\n category: 'vector',\n description: 'Returns the median of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the median of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'median([1, 2, 3])',\n 'median([1, 2, -3])',\n 'median([1, 2, 3, 4])',\n 'median([1, 2, -3, 4])',\n ],\n seeAlso: ['median', 'vector.moving-median', 'vector.centered-moving-median', 'vector.running-median', 'vector.mean', 'vector.mode', 'vector.quartiles', 'vector.percentile', 'vector.iqr', 'vector.medad'],\n },\n 'moving-median': {\n category: 'vector',\n description: 'Returns the **moving median** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving median** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-median } = import(\"vector\");\\nmoving-median([1, 2, 3, 4, 5], 3)',\n 'let { moving-median } = import(\"vector\");\\nmoving-median([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.median', 'vector.centered-moving-median', 'vector.running-median'],\n },\n 'centered-moving-median': {\n category: 'vector',\n description: 'Returns the **centered moving median** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving median** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.median', 'vector.moving-median', 'vector.running-median'],\n },\n 'running-median': {\n category: 'vector',\n description: 'Returns the **running median** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running median** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-median } = import(\"vector\");\\nrunning-median([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.median', 'vector.moving-median', 'vector.centered-moving-median'],\n },\n 'variance': {\n category: 'vector',\n description: 'Returns the **variance** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **variance** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { variance } = import(\"vector\");\\nvariance([1, 2, 3])',\n 'let { variance } = import(\"vector\");\\nvariance([1, 2, -3])',\n ],\n seeAlso: ['linear-algebra.cov', 'vector.moving-variance', 'vector.centered-moving-variance', 'vector.running-variance', 'vector.stdev', 'vector.sample-variance', 'vector.mad'],\n },\n 'moving-variance': {\n category: 'vector',\n description: 'Returns the **moving variance** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-variance } = import(\"vector\");\\nmoving-variance([1, 2, 3, 4, 5], 3)',\n 'let { moving-variance } = import(\"vector\");\\nmoving-variance([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.variance', 'vector.centered-moving-variance', 'vector.running-variance'],\n },\n 'centered-moving-variance': {\n category: 'vector',\n description: 'Returns the **centered moving variance** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.variance', 'vector.moving-variance', 'vector.running-variance'],\n },\n 'running-variance': {\n category: 'vector',\n description: 'Returns the **running variance** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running variance** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-variance } = import(\"vector\");\\nrunning-variance([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.variance', 'vector.moving-variance', 'vector.centered-moving-variance'],\n },\n 'sample-variance': {\n category: 'vector',\n description: 'Returns the sample variance of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sample variance of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, -3])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3, 4])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, -3, 4])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-sample-variance', 'vector.centered-moving-sample-variance', 'vector.running-sample-variance', 'vector.variance', 'vector.sample-stdev'],\n },\n 'moving-sample-variance': {\n category: 'vector',\n description: 'Returns the **moving sample variance** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-variance } = import(\"vector\");\\nmoving-sample-variance([1, 2, 3, 4, 5], 3)',\n 'let { moving-sample-variance } = import(\"vector\");\\nmoving-sample-variance([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sample-variance', 'vector.centered-moving-sample-variance', 'vector.running-sample-variance'],\n },\n 'centered-moving-sample-variance': {\n category: 'vector',\n description: 'Returns the **centered moving sample variance** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.sample-variance', 'vector.moving-sample-variance', 'vector.running-sample-variance'],\n },\n 'running-sample-variance': {\n category: 'vector',\n description: 'Returns the **running sample variance** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample variance** of. First element in result is `null` since **sample variance** is not defined for a single element.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-variance } = import(\"vector\");\\nrunning-sample-variance([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.sample-variance', 'vector.moving-sample-variance', 'vector.centered-moving-sample-variance'],\n },\n 'stdev': {\n category: 'vector',\n description: 'Returns the standard deviation of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the standard deviation of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, -3])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3, 4])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, -3, 4])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-stdev', 'vector.centered-moving-stdev', 'vector.running-stdev', 'vector.variance', 'vector.sample-stdev', 'vector.rms', 'vector.mad'],\n },\n 'moving-stdev': {\n category: 'vector',\n description: 'Returns the **moving standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-stdev } = import(\"vector\");\\nmoving-stdev([1, 2, 3, 4, 5], 3)',\n 'let { moving-stdev } = import(\"vector\");\\nmoving-stdev([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.stdev', 'vector.centered-moving-stdev', 'vector.running-stdev'],\n },\n 'centered-moving-stdev': {\n category: 'vector',\n description: 'Returns the **centered moving standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.stdev', 'vector.moving-stdev', 'vector.running-stdev'],\n },\n 'running-stdev': {\n category: 'vector',\n description: 'Returns the **running standard deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running standard deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-stdev } = import(\"vector\");\\nrunning-stdev([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.stdev', 'vector.moving-stdev', 'vector.centered-moving-stdev'],\n },\n 'sample-stdev': {\n category: 'vector',\n description: 'Returns the sample standard deviation of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sample standard deviation of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, -3])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3, 4])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, -3, 4])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-sample-stdev', 'vector.centered-moving-sample-stdev', 'vector.running-sample-stdev', 'vector.stdev', 'vector.sample-variance'],\n },\n 'moving-sample-stdev': {\n category: 'vector',\n description: 'Returns the **moving sample standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-stdev } = import(\"vector\");\\nmoving-sample-stdev([1, 2, 3, 4, 5], 3)',\n 'let { moving-sample-stdev } = import(\"vector\");\\nmoving-sample-stdev([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.centered-moving-sample-stdev', 'vector.running-sample-stdev'],\n },\n 'centered-moving-sample-stdev': {\n category: 'vector',\n description: 'Returns the **centered moving sample standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.moving-sample-stdev', 'vector.running-sample-stdev'],\n },\n 'running-sample-stdev': {\n category: 'vector',\n description: 'Returns the **running sample standard deviation** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample standard deviation** of. First element in result is `null` since **sample standard deviation** is not defined for a single element.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-stdev } = import(\"vector\");\\nrunning-sample-stdev([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.moving-sample-stdev', 'vector.centered-moving-sample-stdev'],\n },\n 'iqr': {\n category: 'vector',\n description: 'Calculates the **interquartile range** of a `vector`. Returns the difference between the third and first quartiles.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **interquartile range** of. Minimum length is 4.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { iqr } = import(\"vector\");\\niqr([1, 2, 3, 4])',\n 'let { iqr } = import(\"vector\");\\niqr([5, 4, 3, 2, 1, 2, 3, 4, 5])',\n 'let { iqr } = import(\"vector\");\\niqr(range(1, 1000))',\n 'let { iqr, generate } = import(\"vector\");\\niqr(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { iqr, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\niqr(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.moving-iqr', 'vector.centered-moving-iqr', 'vector.running-iqr', 'vector.quartiles', 'vector.median', 'vector.mad', 'vector.medad', 'vector.outliers?', 'vector.outliers'],\n },\n 'moving-iqr': {\n category: 'vector',\n description: 'Calculates the **moving interquartile range** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving interquartile range** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.iqr', 'vector.centered-moving-iqr', 'vector.running-iqr'],\n },\n 'centered-moving-iqr': {\n category: 'vector',\n description: 'Calculates the **centered moving interquartile range** of a `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving interquartile range** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-iqr } = import(\"vector\");\\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-iqr } = import(\"vector\");\\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.iqr', 'vector.moving-iqr', 'vector.running-iqr'],\n },\n 'running-iqr': {\n category: 'vector',\n description: 'Calculates the **running interquartile range** of a `vector`. First three element in result is `null` since **running interquartile range** is not defined for less than four elements.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running interquartile range** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-iqr } = import(\"vector\");\\nrunning-iqr([1, 2, 3, 4, 5, 6])',\n 'let { running-iqr } = import(\"vector\");\\nrunning-iqr([-1, -2, -3, 1, 2, 3])',\n ],\n seeAlso: ['vector.iqr', 'vector.moving-iqr', 'vector.centered-moving-iqr'],\n },\n 'sum': {\n category: 'vector',\n description: 'Returns the sum of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to sum.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'sum([1, 2, 3])',\n 'sum([1, 2, -3])',\n ],\n seeAlso: ['sum', 'vector.moving-sum', 'vector.centered-moving-sum', 'vector.running-sum', 'vector.prod', 'vector.cumsum', 'vector.mean'],\n },\n 'moving-sum': {\n category: 'vector',\n description: 'Returns the **moving sum** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sum** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sum } = import(\"vector\");\\nmoving-sum([1, 2, 3, 4, 5], 3)',\n 'let { moving-sum } = import(\"vector\");\\nmoving-sum([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sum', 'vector.centered-moving-sum', 'vector.running-sum'],\n },\n 'centered-moving-sum': {\n category: 'vector',\n description: 'Returns the **centered moving sum** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sum** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 0, 0)',\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.sum', 'vector.moving-sum', 'vector.running-sum'],\n },\n 'running-sum': {\n category: 'vector',\n description: 'Returns the **running sum** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sum** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sum } = import(\"vector\");\\nrunning-sum([1, 2, 3])',\n 'let { running-sum } = import(\"vector\");\\nrunning-sum([1, -2, -3])',\n ],\n seeAlso: ['vector.sum', 'vector.moving-sum', 'vector.centered-moving-sum', 'vector.cumsum'],\n },\n 'prod': {\n category: 'vector',\n description: 'Returns the **product** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **product** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'prod([1, 2, 3])',\n 'prod([1, 2, -3])',\n ],\n seeAlso: ['prod', 'vector.moving-prod', 'vector.centered-moving-prod', 'vector.running-prod', 'vector.sum', 'vector.cumprod'],\n },\n 'moving-prod': {\n category: 'vector',\n description: 'Returns the **moving product** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving product** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-prod } = import(\"vector\");\\nmoving-prod([1, 2, 3, 4, 5], 3)',\n 'let { moving-prod } = import(\"vector\");\\nmoving-prod([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.prod', 'vector.centered-moving-prod', 'vector.running-prod'],\n },\n 'centered-moving-prod': {\n category: 'vector',\n description: 'Returns the **centered moving product** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving product** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-prod } = import(\"vector\");\\ncentered-moving-prod([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-prod } = import(\"vector\");\\ncentered-moving-prod([1, 2, 3, 4, 5], 3, 0, 0)',\n ],\n seeAlso: ['vector.prod', 'vector.moving-prod', 'vector.running-prod'],\n },\n 'running-prod': {\n category: 'vector',\n description: 'Returns the **running product** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running product** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-prod } = import(\"vector\");\\nrunning-prod([1, 2, 3, 4, 5])',\n 'let { running-prod } = import(\"vector\");\\nrunning-prod([1, -2, -3])',\n ],\n seeAlso: ['vector.prod', 'vector.moving-prod', 'vector.centered-moving-prod', 'vector.cumprod'],\n },\n 'span': {\n category: 'vector',\n description: 'Returns the difference between the maximum and minimum values in a vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the span of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { span } = import(\"vector\");\\nspan([1, 2, 3])',\n 'let { span } = import(\"vector\");\\nspan([1, 1, 2, 3, 3])',\n 'let { span } = import(\"vector\");\\nspan([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-span', 'vector.centered-moving-span', 'vector.running-span', 'min', 'max'],\n },\n 'moving-span': {\n category: 'vector',\n description: 'Calculates the **moving span** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving span** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.span', 'vector.centered-moving-span', 'vector.running-span'],\n },\n 'centered-moving-span': {\n category: 'vector',\n description: 'Calculates the **centered moving span** of a `vector` with a given window size. The result is padded with `leftPadding` on the left and right.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving span** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'The value to pad the result with on the left.',\n },\n rightPadding: {\n type: 'number',\n description: 'The value to pad the result with on the right.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-span } = import(\"vector\");\\ncentered-moving-span([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-span } = import(\"vector\");\\ncentered-moving-span([1, 2, 4, 7, 11, 16], 3, 0, 100)',\n ],\n seeAlso: ['vector.span', 'vector.moving-span', 'vector.running-span'],\n },\n 'running-span': {\n category: 'vector',\n description: 'Calculates the **running span** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running span** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-span } = import(\"vector\");\\nrunning-span([1, 2, 4])',\n ],\n seeAlso: ['vector.span', 'vector.moving-span', 'vector.centered-moving-span'],\n },\n 'skewness': {\n category: 'vector',\n description: 'Calculates the **skewness** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **skewness** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { skewness } = import(\"vector\");\\nskewness([1, 2, 3, 6, 20])',\n 'let { skewness } = import(\"vector\");\\nskewness([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-skewness', 'vector.centered-moving-skewness', 'vector.running-skewness', 'vector.kurtosis', 'vector.sample-skewness', 'vector.excess-kurtosis'],\n },\n 'moving-skewness': {\n category: 'vector',\n description: 'Calculates the **moving skewness** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-skewness } = import(\"vector\");\\nmoving-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-skewness } = import(\"vector\");\\nmoving-skewness([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.skewness', 'vector.centered-moving-skewness', 'vector.running-skewness'],\n },\n 'centered-moving-skewness': {\n category: 'vector',\n description: 'Calculates the **centered moving skewness** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-skewness } = import(\"vector\");\\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-skewness } = import(\"vector\");\\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.skewness', 'vector.moving-skewness', 'vector.running-skewness'],\n },\n 'running-skewness': {\n category: 'vector',\n description: 'Calculates the **running skewness** of a `vector` with a given window size. First two element in result is `null` since **running skewness** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running skewness** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-skewness } = import(\"vector\");\\nrunning-skewness([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.skewness', 'vector.moving-skewness', 'vector.centered-moving-skewness'],\n },\n 'sample-skewness': {\n category: 'vector',\n description: 'Calculates the **sample skewness** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample skewness** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-skewness } = import(\"vector\");\\nsample-skewness([1, 2, 3, 6, 20])',\n 'let { sample-skewness } = import(\"vector\");\\nsample-skewness([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-skewness', 'vector.centered-moving-sample-skewness', 'vector.running-sample-skewness', 'vector.skewness', 'vector.sample-kurtosis'],\n },\n 'moving-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **moving sample skewness** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-skewness } = import(\"vector\");\\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-skewness } = import(\"vector\");\\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.centered-moving-sample-skewness', 'vector.running-sample-skewness'],\n },\n 'centered-moving-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **centered moving sample skewness** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-skewness } = import(\"vector\");\\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-skewness } = import(\"vector\");\\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 3, 0, 100)',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.moving-sample-skewness', 'vector.running-sample-skewness'],\n },\n 'running-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **running sample skewness** of a `vector` with a given window size. First two element in result is `null` since **running sample skewness** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample skewness** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-skewness } = import(\"vector\");\\nrunning-sample-skewness([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.moving-sample-skewness', 'vector.centered-moving-sample-skewness'],\n },\n 'excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **excess kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **excess kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { excess-kurtosis } = import(\"vector\");\\nexcess-kurtosis([1, 2, 3, 6, 20])',\n 'let { excess-kurtosis } = import(\"vector\");\\nexcess-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-excess-kurtosis', 'vector.centered-moving-excess-kurtosis', 'vector.running-excess-kurtosis', 'vector.kurtosis', 'vector.sample-excess-kurtosis', 'vector.skewness'],\n },\n 'moving-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving excess kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-excess-kurtosis } = import(\"vector\");\\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-excess-kurtosis } = import(\"vector\");\\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.centered-moving-excess-kurtosis', 'vector.running-excess-kurtosis'],\n },\n 'centered-moving-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving excess kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-excess-kurtosis } = import(\"vector\");\\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-excess-kurtosis } = import(\"vector\");\\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.moving-excess-kurtosis', 'vector.running-excess-kurtosis'],\n },\n 'running-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running excess kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running excess kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running excess kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-excess-kurtosis } = import(\"vector\");\\nrunning-excess-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.moving-excess-kurtosis', 'vector.centered-moving-excess-kurtosis'],\n },\n 'kurtosis': {\n category: 'vector',\n description: 'Calculates the **kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { kurtosis } = import(\"vector\");\\nkurtosis([1, 2, 3, 6, 20])',\n 'let { kurtosis } = import(\"vector\");\\nkurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-kurtosis', 'vector.centered-moving-kurtosis', 'vector.running-kurtosis', 'vector.excess-kurtosis', 'vector.sample-kurtosis', 'vector.skewness'],\n },\n 'moving-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-kurtosis } = import(\"vector\");\\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-kurtosis } = import(\"vector\");\\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.kurtosis', 'vector.centered-moving-kurtosis', 'vector.running-kurtosis'],\n },\n 'centered-moving-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-kurtosis } = import(\"vector\");\\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-kurtosis } = import(\"vector\");\\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.kurtosis', 'vector.moving-kurtosis', 'vector.running-kurtosis'],\n },\n 'running-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-kurtosis } = import(\"vector\");\\nrunning-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.kurtosis', 'vector.moving-kurtosis', 'vector.centered-moving-kurtosis'],\n },\n 'sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **sample excess kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample excess kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-excess-kurtosis } = import(\"vector\");\\nsample-excess-kurtosis([1, 2, 3, 6, 20])',\n 'let { sample-excess-kurtosis } = import(\"vector\");\\nsample-excess-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis', 'vector.sample-kurtosis', 'vector.excess-kurtosis'],\n },\n 'moving-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving sample excess kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-excess-kurtosis } = import(\"vector\");\\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-excess-kurtosis } = import(\"vector\");\\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis'],\n },\n 'centered-moving-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving sample excess kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-excess-kurtosis } = import(\"vector\");\\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-excess-kurtosis } = import(\"vector\");\\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis'],\n },\n 'running-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running sample excess kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running sample excess kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample excess kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-excess-kurtosis } = import(\"vector\");\\nrunning-sample-excess-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.moving-sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis'],\n },\n 'sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **sample kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-kurtosis } = import(\"vector\");\\nsample-kurtosis([1, 2, 3, 6, 20])',\n 'let { sample-kurtosis } = import(\"vector\");\\nsample-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-kurtosis', 'vector.centered-moving-sample-kurtosis', 'vector.running-sample-kurtosis', 'vector.sample-excess-kurtosis', 'vector.kurtosis', 'vector.sample-skewness'],\n },\n 'moving-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving sample kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-kurtosis } = import(\"vector\");\\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-kurtosis } = import(\"vector\");\\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.centered-moving-sample-kurtosis', 'vector.running-sample-kurtosis'],\n },\n 'centered-moving-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving sample kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-kurtosis } = import(\"vector\");\\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-kurtosis } = import(\"vector\");\\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.moving-sample-kurtosis', 'vector.running-sample-kurtosis'],\n },\n 'running-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running sample kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running sample kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-kurtosis } = import(\"vector\");\\nrunning-sample-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.moving-sample-kurtosis', 'vector.centered-moving-sample-kurtosis'],\n },\n 'rms': {\n category: 'vector',\n description: 'Calculates the **root mean square** of a `vector`. Returns the square root of the average of the squares of the elements.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **root mean square** of. Minimum length is 1.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { rms } = import(\"vector\");\\nrms([1, 2, 3, 4])',\n 'let { rms } = import(\"vector\");\\nrms([5, 4, 3, 2, 1])',\n 'let { rms } = import(\"vector\");\\nrms(range(1, 1000))',\n 'let { rms, generate } = import(\"vector\");\\nrms(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { rms, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\nrms(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.moving-rms', 'vector.centered-moving-rms', 'vector.running-rms', 'vector.mean', 'vector.stdev'],\n },\n 'moving-rms': {\n category: 'vector',\n description: 'Calculates the **moving root mean square** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving root mean square** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.rms', 'vector.centered-moving-rms', 'vector.running-rms'],\n },\n 'centered-moving-rms': {\n category: 'vector',\n description: 'Calculates the **centered moving root mean square** of a `vector` with a given window size and padding value.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving root mean square** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 5, 0)',\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 6, 0, 0)',\n ],\n seeAlso: ['vector.rms', 'vector.moving-rms', 'vector.running-rms'],\n },\n 'running-rms': {\n category: 'vector',\n description: 'Calculates the **running root mean square** of a `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running root mean square** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([1, 2, 3, 4, 5, 6])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([1, -3, 2])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([-1, -2, -3])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([0])',\n ],\n seeAlso: ['vector.rms', 'vector.moving-rms', 'vector.centered-moving-rms'],\n },\n 'mad': {\n category: 'vector',\n description: 'Returns the **mean absolute deviation** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **mean absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { mad } = import(\"vector\");\\nmad([1, 2, 3])',\n 'let { mad } = import(\"vector\");\\nmad([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-mad', 'vector.centered-moving-mad', 'vector.running-mad', 'vector.medad', 'vector.stdev', 'vector.variance', 'vector.iqr'],\n },\n 'moving-mad': {\n category: 'vector',\n description: 'Returns the **moving mean absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving mean absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-mad } = import(\"vector\");\\nmoving-mad([1, 2, 3, 4, 5], 3)',\n 'let { moving-mad } = import(\"vector\");\\nmoving-mad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.mad', 'vector.centered-moving-mad', 'vector.running-mad'],\n },\n 'centered-moving-mad': {\n category: 'vector',\n description: 'Returns the **centered moving mean absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving mean absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-mad } = import(\"vector\");\\ncentered-moving-mad([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-mad } = import(\"vector\");\\ncentered-moving-mad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.mad', 'vector.moving-mad', 'vector.running-mad'],\n },\n 'running-mad': {\n category: 'vector',\n description: 'Returns the **running mean absolute deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running mean absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-mad } = import(\"vector\");\\nrunning-mad([1, 2, 3])',\n 'let { running-mad } = import(\"vector\");\\nrunning-mad([1, 2, -3])',\n ],\n seeAlso: ['vector.mad', 'vector.moving-mad', 'vector.centered-moving-mad'],\n },\n 'medad': {\n category: 'vector',\n description: 'Returns the **median absolute deviation** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **median absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { medad } = import(\"vector\");\\nmedad([1, 2, 3])',\n 'let { medad } = import(\"vector\");\\nmedad([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-medad', 'vector.centered-moving-medad', 'vector.running-medad', 'vector.mad', 'vector.median', 'vector.iqr'],\n },\n 'moving-medad': {\n category: 'vector',\n description: 'Returns the **moving median absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving median absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-medad } = import(\"vector\");\\nmoving-medad([1, 2, 3, 4, 5], 3)',\n 'let { moving-medad } = import(\"vector\");\\nmoving-medad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.medad', 'vector.centered-moving-medad', 'vector.running-medad'],\n },\n 'centered-moving-medad': {\n category: 'vector',\n description: 'Returns the **centered moving median absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving median absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-medad } = import(\"vector\");\\ncentered-moving-medad([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-medad } = import(\"vector\");\\ncentered-moving-medad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.medad', 'vector.moving-medad', 'vector.running-medad'],\n },\n 'running-medad': {\n category: 'vector',\n description: 'Returns the **running median absolute deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running median absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-medad } = import(\"vector\");\\nrunning-medad([1, 2, 3])',\n 'let { running-medad } = import(\"vector\");\\nrunning-medad([1, 2, -3])',\n ],\n seeAlso: ['vector.medad', 'vector.moving-medad', 'vector.centered-moving-medad'],\n },\n 'gini-coefficient': {\n category: 'vector',\n description: 'Returns the **gini coefficient** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **gini coefficient** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { gini-coefficient } = import(\"vector\");\\ngini-coefficient([1, 2, 3])',\n 'let { gini-coefficient } = import(\"vector\");\\ngini-coefficient([1, 1, 3])',\n ],\n seeAlso: ['vector.moving-gini-coefficient', 'vector.centered-moving-gini-coefficient', 'vector.running-gini-coefficient', 'vector.entropy'],\n },\n 'moving-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **moving gini coefficient** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving gini coefficient** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-gini-coefficient } = import(\"vector\");\\nmoving-gini-coefficient([1, 2, 3], 2)',\n 'let { moving-gini-coefficient } = import(\"vector\");\\nmoving-gini-coefficient([1, 1, 3], 2)',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.centered-moving-gini-coefficient', 'vector.running-gini-coefficient'],\n },\n 'centered-moving-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **centered moving gini coefficient** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving gini coefficient** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-gini-coefficient } = import(\"vector\");\\ncentered-moving-gini-coefficient([1, 2, 3], 2)',\n 'let { centered-moving-gini-coefficient } = import(\"vector\");\\ncentered-moving-gini-coefficient([1, 1, 3], 2)',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.moving-gini-coefficient', 'vector.running-gini-coefficient'],\n },\n 'running-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **running gini coefficient** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running gini coefficient** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-gini-coefficient } = import(\"vector\");\\nrunning-gini-coefficient([1, 2, 3])',\n 'let { running-gini-coefficient } = import(\"vector\");\\nrunning-gini-coefficient([1, 1, 3])',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.moving-gini-coefficient', 'vector.centered-moving-gini-coefficient'],\n },\n 'entropy': {\n category: 'vector',\n description: 'Calculates the **entropy** of a `vector`. The entropy is a measure of the uncertainty associated with a random variable.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **entropy** of. Minimum length is 1.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { entropy } = import(\"vector\");\\nentropy([1, 1, 2, 3, 3, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2, 2, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([0])',\n 'let { entropy } = import(\"vector\");\\nentropy([1])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2])',\n ],\n seeAlso: ['vector.moving-entropy', 'vector.centered-moving-entropy', 'vector.running-entropy', 'vector.gini-coefficient'],\n },\n 'moving-entropy': {\n category: 'vector',\n description: 'Calculates the **moving entropy** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving entropy** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 1, 2, 3, 3, 3], 4)',\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 1, 2, 3, 3, 3], 3)',\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 2], 2)',\n ],\n seeAlso: ['vector.entropy', 'vector.centered-moving-entropy', 'vector.running-entropy'],\n },\n 'centered-moving-entropy': {\n category: 'vector',\n description: 'Calculates the **centered moving entropy** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving entropy** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 4)',\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 3)',\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 2], 2)',\n ],\n seeAlso: ['vector.entropy', 'vector.moving-entropy', 'vector.running-entropy'],\n },\n 'running-entropy': {\n category: 'vector',\n description: 'Calculates the **running entropy** of a `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running entropy** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-entropy } = import(\"vector\");\\nrunning-entropy([1, 1, 2, 3, 3, 3])',\n 'let { running-entropy } = import(\"vector\");\\nrunning-entropy([1, 2])',\n ],\n seeAlso: ['vector.entropy', 'vector.moving-entropy', 'vector.centered-moving-entropy'],\n },\n 'monotonic?': {\n category: 'vector',\n description: 'Checks if a vector is monotonic.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1, 2, 3])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1, 2, 2, 3])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1, 1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1, 2])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([])',\n ],\n seeAlso: ['vector.strictly-monotonic?', 'vector.increasing?', 'vector.decreasing?'],\n },\n 'strictly-monotonic?': {\n category: 'vector',\n description: 'Checks if a vector is strictly monotonic.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1, 2, 3])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1, 2, 2, 3])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1, 1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1, 2])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([])',\n ],\n seeAlso: ['vector.monotonic?', 'vector.strictly-increasing?', 'vector.strictly-decreasing?'],\n },\n 'increasing?': {\n category: 'vector',\n description: 'Checks if a vector is increasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1, 2, 3])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1, 2, 2, 3])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1, 1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1, 2])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([])',\n ],\n seeAlso: ['vector.strictly-increasing?', 'vector.decreasing?', 'vector.strictly-decreasing?', 'vector.monotonic?'],\n },\n 'decreasing?': {\n category: 'vector',\n description: 'Checks if a vector is decreasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1, 2, 3])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1, 2, 2, 3])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1, 1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1, 2])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([])',\n ],\n seeAlso: ['vector.strictly-decreasing?', 'vector.increasing?', 'vector.strictly-increasing?', 'vector.monotonic?'],\n },\n 'strictly-increasing?': {\n category: 'vector',\n description: 'Checks if a vector is strictly increasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1, 2, 3])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1, 2, 2, 3])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1, 1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1, 2])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([])',\n ],\n seeAlso: ['vector.increasing?', 'vector.decreasing?', 'vector.strictly-decreasing?', 'vector.strictly-monotonic?'],\n },\n 'strictly-decreasing?': {\n category: 'vector',\n description: 'Checks if a vector is strictly decreasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1, 2, 3])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1, 2, 2, 3])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1, 1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1, 2])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([])',\n ],\n seeAlso: ['vector.increasing?', 'vector.strictly-increasing?', 'vector.decreasing?', 'vector.strictly-monotonic?'],\n },\n 'mode': {\n category: 'vector',\n description: 'Returns the mode of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the mode of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { mode } = import(\"vector\");\\nmode([1, 2, 3])',\n 'let { mode } = import(\"vector\");\\nmode([1, 2, -3, 1])',\n 'let { mode } = import(\"vector\");\\nmode([2, 2, 3, 3, 4])',\n 'let { mode } = import(\"vector\");\\nmode([2, 2, 3, 3])',\n 'let { mode } = import(\"vector\");\\nmode([1, 2, 3, 2, 1, 2])',\n ],\n seeAlso: ['vector.mean', 'vector.median'],\n },\n 'min-index': {\n category: 'vector',\n description: 'Returns the index of the minimum value of all elements in the vector.',\n returns: {\n type: 'integer',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the minimum index of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, 3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 1, 2, 3, 3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, -3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, 3, 4])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, -3, 4])',\n ],\n seeAlso: ['vector.max-index', 'min'],\n },\n 'max-index': {\n category: 'vector',\n description: 'Returns the index of the maximum value of all elements in the vector.',\n returns: {\n type: 'integer',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the maximum index of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, 3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 1, 2, 3, 3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, -3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, 3, 4])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, -3, 4])',\n ],\n seeAlso: ['vector.min-index', 'max'],\n },\n 'sort-indices': {\n category: 'vector',\n description: 'Returns the indices of the elements in the vector sorted in ascending order.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sorted indices of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, 3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 1, 2, 3, 3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, -3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, 3, 4])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, -3, 4])',\n ],\n seeAlso: ['sort'],\n },\n 'count-values': {\n category: 'vector',\n description: 'Counts the number of occurrences of each value in the vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Vector to count the values of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, 3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 1, 2, 3, 3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, -3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, 2, 1, 3, 2, 4, 2, 1, 2, 2, 1, 3, 2, 4])',\n ],\n seeAlso: ['sequence.frequencies', 'vector.bincount'],\n },\n 'linspace': {\n category: 'vector',\n description: 'Generates a vector of evenly spaced numbers between two values.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n start: {\n type: 'number',\n description: 'The starting value.',\n },\n stop: {\n type: 'number',\n description: 'The ending value.',\n },\n n: {\n type: 'integer',\n description: 'The number of values to generate.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'start',\n 'stop',\n 'n',\n ],\n },\n ],\n examples: [\n 'let { linspace } = import(\"vector\");\\nlinspace(0, 10, 6)',\n 'let { linspace } = import(\"vector\");\\nlinspace(10, 20, 25)',\n ],\n seeAlso: [\n 'range',\n 'vector.ones',\n 'vector.zeros',\n 'vector.fill',\n 'vector.generate',\n ],\n },\n 'ones': {\n category: 'vector',\n description: 'Generates a vector of ones.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n ],\n },\n ],\n examples: [\n 'let { ones } = import(\"vector\");\\nones(5)',\n 'let { ones } = import(\"vector\");\\nones(10)',\n 'let { ones } = import(\"vector\");\\nones(0)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.zeros',\n 'vector.fill',\n 'vector.generate',\n 'vector.linspace',\n ],\n },\n 'zeros': {\n category: 'vector',\n description: 'Generates a vector of zeros.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n ],\n },\n ],\n examples: [\n 'let { zeros } = import(\"vector\");\\nzeros(5)',\n 'let { zeros } = import(\"vector\");\\nzeros(10)',\n 'let { zeros } = import(\"vector\");\\nzeros(0)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.fill',\n 'vector.generate',\n 'vector.linspace',\n ],\n },\n 'fill': {\n category: 'vector',\n description: 'Generates a vector filled with a number.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n value: {\n type: 'number',\n description: 'The value to fill the vector with.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n 'value',\n ],\n },\n ],\n examples: [\n 'let { fill } = import(\"vector\");\\nfill(5, PI)',\n 'let { fill } = import(\"vector\");\\nfill(10, -1)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.zeros',\n 'vector.generate',\n 'vector.linspace',\n 'grid.fill',\n ],\n },\n 'generate': {\n category: 'vector',\n description: 'Generates a vector of numbers based on a function.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n func: {\n type: 'function',\n description: 'A function that takes an index and returns a number.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n 'func',\n ],\n },\n ],\n examples: [\n 'let { generate } = import(\"vector\");\\ngenerate(5, -> $ * 2)',\n 'let { generate } = import(\"vector\");\\ngenerate(10, -> $ + 1)',\n 'let { generate } = import(\"vector\");\\ngenerate(0, -> $ + 1)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.zeros',\n 'vector.fill',\n 'vector.linspace',\n 'grid.generate',\n ],\n },\n 'cumsum': {\n category: 'vector',\n description: 'Calculates the cumulative sum of a vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the cumulative sum of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { cumsum } = import(\"vector\");\\ncumsum([1, 2, 3])',\n 'let { cumsum } = import(\"vector\");\\ncumsum([1, 2, -3])',\n 'let { cumsum } = import(\"vector\");\\ncumsum([])',\n ],\n seeAlso: ['vector.cumprod', 'vector.sum', 'vector.running-sum'],\n },\n 'cumprod': {\n category: 'vector',\n description: 'Calculates the cumulative product of a vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the cumulative product of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { cumprod } = import(\"vector\");\\ncumprod([1, 2, 3])',\n 'let { cumprod } = import(\"vector\");\\ncumprod([1, 2, -3, 0, 10])',\n 'let { cumprod } = import(\"vector\");\\ncumprod([])',\n ],\n seeAlso: ['vector.cumsum', 'vector.prod', 'vector.running-prod'],\n },\n 'quartiles': {\n category: 'vector',\n description: 'Calculates the quartiles of a vector. Returns an array containing the first, second (median), and third quartiles.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the quartiles of. Minimum length is 4.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { quartiles } = import(\"vector\");\\nquartiles([1, 2, 3, 4])',\n 'let { quartiles } = import(\"vector\");\\nquartiles([5, 4, 3, 2, 1, 2, 3, 4, 5])',\n 'let { quartiles } = import(\"vector\");\\nquartiles(range(1, 1000))',\n 'let { quartiles, generate } = import(\"vector\");\\nquartiles(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { quartiles, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\nquartiles(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.percentile', 'vector.quantile', 'vector.median', 'vector.iqr'],\n },\n 'percentile': {\n category: 'vector',\n description: 'Calculates the percentile of a vector. Returns the value at the specified percentile.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The non empty vector to calculate the percentile of.',\n },\n percentile: {\n type: 'number',\n description: 'The percentile to calculate. Must be between 0 and 1.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'percentile',\n ],\n },\n ],\n examples: [\n 'let { percentile } = import(\"vector\");\\npercentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 35)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 0)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 10)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 20)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 30)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 40)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 50)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 60)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 70)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 80)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 90)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 100)',\n ],\n seeAlso: ['vector.quantile', 'vector.quartiles', 'vector.median', 'vector.ecdf', 'vector.winsorize'],\n },\n 'quantile': {\n category: 'vector',\n description: 'Calculates the quantile of a vector. Returns the value at the specified quantile.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The non empty vector to calculate the quantile of.',\n },\n quantile: {\n type: 'number',\n description: 'The quantile to calculate. Must be between 0 and 1.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'quantile',\n ],\n },\n ],\n examples: [\n 'let { quantile } = import(\"vector\");\\nquantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0.35)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.1)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.2)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.3)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.4)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.5)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.6)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.7)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.8)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.9)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 1)',\n ],\n seeAlso: ['vector.percentile', 'vector.quartiles', 'vector.ecdf'],\n },\n 'histogram': {\n category: 'vector',\n description: 'Creates a histogram from a numeric `array` by dividing the data range into the specified number of bins. Returns an `array` of `[binStart, binEnd, count]` tuples representing each bin\\'s range and the number of values within it. Handles empty arrays, identical values, and properly places maximum values in the last bin.',\n returns: {\n type: 'array',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The numeric array to create a histogram from.',\n },\n bins: {\n type: 'integer',\n description: 'The number of bins to divide the data range into.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'bins',\n ],\n },\n ],\n examples: [\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9], 3)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 5)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 10)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 1)',\n ],\n seeAlso: ['vector.bincount', 'vector.ecdf'],\n },\n 'ecdf': {\n category: 'vector',\n description: 'Calculates the empirical cumulative distribution function value for a given threshold in a non empty dataset. Returns the proportion of values in the `array` that are less than or equal to the specified threshold.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The numeric array to calculate the ECDF from.',\n },\n threshold: {\n type: 'number',\n description: 'The threshold value to calculate the ECDF for.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'threshold',\n ],\n },\n ],\n examples: [\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9, 10, 12], 5)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 3)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 0)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 10)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 2)',\n ],\n seeAlso: ['vector.histogram', 'vector.percentile', 'vector.quantile'],\n },\n 'outliers?': {\n category: 'vector',\n description: 'Checks if the `vector` contains outliers based on the interquartile range (IQR) method. Returns `true` if outliers are present, `false` otherwise.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to check for outliers.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, 3])',\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, -3])',\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, 3, 2, 4, 120])',\n ],\n seeAlso: ['vector.outliers', 'vector.winsorize', 'vector.iqr'],\n },\n 'outliers': {\n category: 'vector',\n description: 'Identifies outliers in the `vector` based on the interquartile range (IQR) method. Returns an array of outlier values.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to check for outliers.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, 3])',\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, -3])',\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, 3, 2, 4, 120])',\n ],\n seeAlso: ['vector.outliers?', 'vector.winsorize', 'vector.iqr'],\n },\n 'bincount': {\n category: 'vector',\n description: 'counts occurrences of each `integer` in a vector, returning an array where index `i` contains the count of value `i`, with optional **minimum size** and **weights parameters**.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to count occurrences in.',\n },\n minSize: {\n type: 'integer',\n description: 'Optional minimum size of the output array.',\n },\n weights: {\n type: 'number',\n array: true,\n description: 'Optional weights for each element in the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'minSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'minSize',\n 'weights',\n ],\n },\n ],\n examples: [\n 'let { bincount } = import(\"vector\");\\nbincount([1, 2, 3])',\n 'let { bincount } = import(\"vector\");\\nbincount([1, 2, 2, 3, 3])',\n ],\n seeAlso: ['vector.count-values', 'vector.histogram'],\n hideOperatorForm: true,\n },\n 'winsorize': {\n category: 'vector',\n description: 'Limits extreme values in a `vector` by replacing values below the **lower quantile** and above the **upper quantile** with the values at those quantiles. The function takes a `vector` of values and **quantile thresholds** (between 0 and 1), with the upper quantile. Winsorization reduces the influence of outliers while preserving the overall distribution shape, making statistical analyses more robust.',\n returns: {\n type: 'vector',\n },\n args: {\n 'vector': {\n type: 'vector',\n description: 'The vector to winsorize.',\n },\n 'lower-quantile': {\n type: 'number',\n description: 'The lower quantile threshold (between 0 and 1).',\n },\n 'upper-quantile': {\n type: 'number',\n description: 'Optional Upper quantile threshold (between 0 and 1). Defaults to `(1 - lower-quantile)` if `lower-quantile <= 0.5` otherwise `1`.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'lower-quantile',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'lower-quantile',\n 'upper-quantile',\n ],\n },\n ],\n examples: [\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25)',\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.75)',\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.5)',\n ],\n seeAlso: ['vector.outliers', 'vector.outliers?', 'vector.percentile'],\n hideOperatorForm: true,\n },\n 'mse': {\n category: 'vector',\n description: 'Calculates the **Mean Squared Error (MSE)** between two vectors. Returns the average of the squared differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [1, 2, 3])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [4, 5, 6])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [2, 2, 2])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2], [3, 3])',\n 'let { mse } = import(\"vector\");\\nmse([1], [3])',\n ],\n seeAlso: ['vector.rmse', 'vector.mae', 'vector.smape'],\n },\n 'rmse': {\n category: 'vector',\n description: 'Calculates the **Root Mean Squared Error (RMSE)** between two vectors. Returns the square root of the average of the squared differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [1, 2, 3])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [4, 5, 6])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [2, 2, 2])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2], [3, 3])',\n 'let { rmse } = import(\"vector\");\\nrmse([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.mae', 'vector.smape'],\n },\n 'mae': {\n category: 'vector',\n description: 'Calculates the **Mean Absolute Error (MAE)** between two vectors. Returns the average of the absolute differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [1, 2, 3])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [4, 5, 6])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [2, 2, 2])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2], [3, 3])',\n 'let { mae } = import(\"vector\");\\nmae([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.rmse', 'vector.smape'],\n },\n 'smape': {\n category: 'vector',\n description: 'Calculates the **Symmetric Mean Absolute Percentage Error (SMAPE)** between two vectors. Returns the average of the absolute percentage differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [1, 2, 3])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [4, 5, 6])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [2, 2, 2])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2], [3, 3])',\n 'let { smape } = import(\"vector\");\\nsmape([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.rmse', 'vector.mae'],\n },\n}\n","/**\n * Checks if a vector has no extreme outliers using the IQR method\n * @param vector An array of numbers to check for extreme outliers\n * @returns true if there are no extreme outliers, false otherwise\n */\nexport function hasOutliers(vector: number[]): boolean {\n return outliers(vector).length > 0\n}\n\nexport function outliers(vector: number[]): number[] {\n // Handle edge cases\n if (vector.length <= 1)\n return []\n\n // Sort the vector to calculate quartiles\n const sorted = [...vector].sort((a, b) => a - b)\n\n // Calculate Q1 (25th percentile)\n const q1Index = Math.floor(sorted.length * 0.25)\n const q1 = sorted.length % 4 === 0\n ? (sorted[q1Index - 1]! + sorted[q1Index]!) / 2\n : sorted[q1Index]!\n\n // Calculate Q3 (75th percentile)\n const q3Index = Math.floor(sorted.length * 0.75)\n const q3 = sorted.length % 4 === 0\n ? (sorted[q3Index - 1]! + sorted[q3Index]!) / 2\n : sorted[q3Index]!\n\n // Calculate IQR (Interquartile Range)\n const iqr = q3 - q1\n\n // Define bounds for outliers (using 1.5*IQR for mild outliers and 3*IQR for extreme outliers)\n const lowerBound = q1 - iqr * 1.5\n const upperBound = q3 + iqr * 1.5\n\n // Filter the vector to find outliers\n return vector.filter(val => val < lowerBound || val > upperBound)\n}\n","/**\n * Calculate the percentile value from an array of numbers\n * @param data Array of numbers to calculate percentile from\n * @param percentile The percentile to calculate (0-100)\n * @returns The value at the specified percentile\n */\nexport function calcPercentile(data: number[], percentile: number): number {\n // Sort the data in ascending order\n const sortedData = [...data].sort((a, b) => a - b)\n\n // If percentile is 0, return the minimum value\n if (percentile === 0) {\n return sortedData[0]!\n }\n\n // If percentile is 100, return the maximum value\n if (percentile === 100) {\n return sortedData[sortedData.length - 1]!\n }\n\n // Calculate the index\n const index = (percentile / 100) * (sortedData.length - 1)\n\n // If index is an integer, return the value at that index\n if (Number.isInteger(index)) {\n return sortedData[index]!\n }\n\n // Otherwise, interpolate between the two adjacent values\n const lowerIndex = Math.floor(index)\n const upperIndex = Math.ceil(index)\n const weight = index - lowerIndex\n\n return sortedData[lowerIndex]! * (1 - weight) + sortedData[upperIndex]! * weight\n}\n","export function quartiles(vector: number[]): [number, number, number] {\n const sorted = [...vector].sort((a, b) => a - b)\n\n // Median calculation (Q2)\n const midIndex = sorted.length / 2\n let q2: number\n if (sorted.length % 2 === 0) {\n // Even length - average the two middle values\n q2 = (sorted[midIndex - 1]! + sorted[midIndex]!) / 2\n }\n else {\n // Odd length - take the middle value\n q2 = sorted[Math.floor(midIndex)]!\n }\n\n // Lower half for Q1\n const lowerHalf = sorted.slice(0, Math.floor(sorted.length / 2))\n // Upper half for Q3\n const upperHalf = sorted.slice(Math.ceil(sorted.length / 2))\n\n // Calculate Q1 and Q3 using the same median logic on the halves\n let q1: number, q3: number\n\n if (lowerHalf.length % 2 === 0) {\n const midLower = lowerHalf.length / 2\n q1 = (lowerHalf[midLower - 1]! + lowerHalf[midLower]!) / 2\n }\n else {\n q1 = lowerHalf[Math.floor(lowerHalf.length / 2)]!\n }\n\n if (upperHalf.length % 2 === 0) {\n const midUpper = upperHalf.length / 2\n q3 = (upperHalf[midUpper - 1]! + upperHalf[midUpper]!) / 2\n }\n else {\n q3 = upperHalf[Math.floor(upperHalf.length / 2)]!\n }\n\n return [q1, q2, q3]\n}\n","export function calcMean(vector: number[]): number {\n if (vector.length === 0) {\n return 0\n }\n\n const sum = vector.reduce((acc, val) => acc + val, 0)\n return sum / vector.length\n}\n","import { calcMean } from '../calcMean'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const meanReductionFunction: ReductionFunctionDefinition<'mean'> = {\n mean: vector => calcMean(vector),\n}\n\nexport const geometricMeanReductionFunction: ReductionFunctionDefinition<'geometric-mean'> = {\n 'geometric-mean': (vector) => {\n if (vector.some(val => val < 0)) {\n throw new Error('Geometric mean is not defined for non-positive numbers')\n }\n return Math.exp(vector.reduce((acc, val) => acc + Math.log(val), 0) / vector.length)\n },\n}\n\nexport const harmonicMeanReductionFunction: ReductionFunctionDefinition<'harmonic-mean'> = {\n 'harmonic-mean': vector => vector.length / vector.reduce((acc, val) => acc + 1 / val, 0),\n}\n","export function calcMedian(vector: number[]): number {\n const sorted = [...vector].sort((a, b) => a - b)\n const mid = Math.floor(sorted.length / 2)\n\n return sorted.length % 2 === 0\n ? (sorted[mid - 1]! + sorted[mid]!) / 2\n : sorted[mid]!\n}\n","import { calcMedian } from '../calcMedian'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const medianReductionFunction: ReductionFunctionDefinition<'median'> = {\n median: vector => calcMedian(vector),\n}\n","import { calcMean } from './calcMean'\n\nexport function calcVariance(vector: number[], optionalMean?: number): number {\n const mean = optionalMean ?? calcMean(vector)\n return vector.reduce((acc, val) => acc + (val - mean) ** 2, 0) / vector.length\n}\n\nexport function calcSampleVariance(vector: number[], optionalMean?: number): number {\n const mean = optionalMean ?? calcMean(vector)\n return vector.reduce((acc, val) => acc + (val - mean) ** 2, 0) / (vector.length - 1)\n}\n","import { calcSampleVariance, calcVariance } from '../calcVariance'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const varianceReductionFunction: ReductionFunctionDefinition<'variance'> = {\n variance: vector => calcVariance(vector),\n}\n\nexport const sampleVarianceReductionFunction: ReductionFunctionDefinition<'sample-variance'> = {\n 'sample-variance': vector => calcSampleVariance(vector),\n 'minLength': 2,\n}\n","import { calcVariance } from './calcVariance'\n\nexport function calcStdDev(vector: number[], optionalMean?: number): number {\n const variance = calcVariance(vector, optionalMean)\n return Math.sqrt(variance)\n}\n\nexport function calcSampleStdDev(vector: number[], optionalMean?: number): number {\n const variance = calcVariance(vector, optionalMean)\n return Math.sqrt(variance * (vector.length / (vector.length - 1)))\n}\n","import { calcSampleStdDev, calcStdDev } from '../calcStdDev'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const stdevReductionFunction: ReductionFunctionDefinition<'stdev'> = {\n stdev: vector => calcStdDev(vector),\n}\n\nexport const sampleStdevReductionFunction: ReductionFunctionDefinition<'sample-stdev'> = {\n 'sample-stdev': vector => calcSampleStdDev(vector),\n 'minLength': 2,\n}\n","import { quartiles } from '../quartiles'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const iqrReductionFunction: ReductionFunctionDefinition<'iqr'> = {\n iqr: (vector) => {\n const [q1, , q3] = quartiles(vector)\n return q3 - q1\n },\n minLength: 4,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const spanReductionFunction: ReductionFunctionDefinition<'span'> = {\n span: vector => vector.length === 0 ? 0 : Math.max(...vector) - Math.min(...vector),\n minLength: 0,\n}\n","import { calcMean } from '../calcMean'\nimport { calcStdDev } from '../calcStdDev'\nimport type { ReductionFunctionDefinition } from '.'\n\nfunction skewness(vector: number[]): number {\n const mean = calcMean(vector)\n const stdDev = calcStdDev(vector)\n if (stdDev === 0) {\n throw new Error('Standard deviation is zero, skewness is undefined')\n }\n return vector.reduce((acc, val) => acc + ((val - mean) ** 3), 0) / (vector.length * stdDev ** 3)\n}\n\nfunction sampleSkewness(vector: number[]): number {\n const n = vector.length\n\n // Calculate the mean\n const mean = vector.reduce((acc, val) => acc + val, 0) / n\n\n // Calculate sum of squared differences and sum of cubed differences\n let sumSquaredDiffs = 0\n let sumCubedDiffs = 0\n\n for (const val of vector) {\n const diff = val - mean\n sumSquaredDiffs += diff * diff\n sumCubedDiffs += diff * diff * diff\n }\n\n // Calculate sample standard deviation (using n-1)\n const sampleVariance = sumSquaredDiffs / (n - 1)\n const sampleStdDev = Math.sqrt(sampleVariance)\n\n // If standard deviation is 0, skewness is undefined\n if (sampleStdDev === 0) {\n throw new Error('Cannot calculate sample skewness when standard deviation is 0')\n }\n\n // Calculate sample skewness with Fisher's adjustment\n return (n / ((n - 1) * (n - 2))) * sumCubedDiffs / sampleStdDev ** 3\n}\n\nexport const skewnessReductionFunction: ReductionFunctionDefinition<'skewness'> = {\n skewness: vector => skewness(vector),\n minLength: 3,\n}\n\nexport const sampleSkewnessReductionFunction: ReductionFunctionDefinition<'sample-skewness'> = {\n 'sample-skewness': vector => sampleSkewness(vector),\n 'minLength': 3,\n}\n","import { calcMean } from '../calcMean'\nimport { calcStdDev } from '../calcStdDev'\n\nimport type { ReductionFunctionDefinition } from '.'\n\nfunction kurtosis(vector: number[]): number {\n const mean = calcMean(vector)\n const stdDev = calcStdDev(vector)\n if (stdDev === 0) {\n throw new Error('Standard deviation is zero, kurtosis is undefined')\n }\n return vector.reduce((acc, val) => acc + ((val - mean) ** 4), 0) / (vector.length * stdDev ** 4)\n}\n\nfunction excessKurtosis(vector: number[]): number {\n return kurtosis(vector) - 3\n}\n\n/**\n * Calculates the sample kurtosis (bias-corrected)\n * @param vector Array of numeric values\n * @returns The sample kurtosis\n * @throws Error if sample size is less than 4 or if variance is zero\n */\nfunction sampleKurtosis(vector: number[]): number {\n const n = vector.length\n\n const mean = vector.reduce((sum, val) => sum + val, 0) / n\n const sumSquaredDeviations = vector.reduce((sum, val) => sum + (val - mean) ** 2, 0)\n const variance = sumSquaredDeviations / (n - 1)\n\n if (variance === 0) {\n throw new Error('Variance is zero, kurtosis is undefined')\n }\n\n const fourthMomentSum = vector.reduce((sum, val) => sum + (val - mean) ** 4, 0)\n\n // Correct formula for sample kurtosis\n return (n * (n + 1) * fourthMomentSum) / ((n - 1) * (n - 2) * (n - 3) * variance ** 2)\n}\n/**\n * Calculates the sample excess kurtosis (bias-corrected)\n * @param vector Array of numeric values\n * @returns The sample excess kurtosis\n * @throws Error if sample size is less than 4 or if variance is zero\n */\nfunction sampleExcessKurtosis(vector: number[]): number {\n const n = vector.length\n\n const mean = vector.reduce((sum, val) => sum + val, 0) / n\n const sumSquaredDeviations = vector.reduce((sum, val) => sum + (val - mean) ** 2, 0)\n const variance = sumSquaredDeviations / (n - 1)\n\n if (variance === 0) {\n throw new Error('Variance is zero, kurtosis is undefined')\n }\n\n const fourthMomentSum = vector.reduce((sum, val) => sum + (val - mean) ** 4, 0)\n const rawKurtosis = (n * (n + 1) * fourthMomentSum) / ((n - 1) * (n - 2) * (n - 3) * variance ** 2)\n\n // Compute excess kurtosis by subtracting 3 times the bias correction factor\n return rawKurtosis - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\nexport const kurtosisReductionFunction: ReductionFunctionDefinition<'kurtosis'> = {\n kurtosis: vector => kurtosis(vector),\n minLength: 4,\n}\n\nexport const eccessKurtosisReductionFunction: ReductionFunctionDefinition<'excess-kurtosis'> = {\n 'excess-kurtosis': vector => excessKurtosis(vector),\n 'minLength': 4,\n}\n\nexport const sampleKurtosisReductionFunction: ReductionFunctionDefinition<'sample-kurtosis'> = {\n 'sample-kurtosis': vector => sampleKurtosis(vector),\n 'minLength': 4,\n}\n\nexport const sampleExcessKurtosisReductionFunction: ReductionFunctionDefinition<'sample-excess-kurtosis'> = {\n 'sample-excess-kurtosis': vector => sampleExcessKurtosis(vector),\n 'minLength': 4,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const rmsReductionFunction: ReductionFunctionDefinition<'rms'> = {\n rms: vector => Math.sqrt(vector.reduce((acc, val) => acc + val ** 2, 0) / vector.length),\n}\n","import { calcMad } from '../calcMad'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const madReductionFunction: ReductionFunctionDefinition<'mad'> = {\n mad: vector => calcMad(vector),\n}\n","import { calcMedian } from './calcMedian'\n\nexport function calcMad(vector: number[]): number {\n const median = calcMedian(vector)\n\n // Calculate mean absolute deviation\n return vector.reduce((acc, val) => acc + Math.abs(val - median), 0) / vector.length\n}\n","import { calcMedad } from '../calcMedad'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const medadReductionFunction: ReductionFunctionDefinition<'medad'> = {\n medad: vector => calcMedad(vector),\n}\n","import { calcMedian } from './calcMedian'\n\nexport function calcMedad(vector: number[]): number {\n const median = calcMedian(vector)\n // Calculate absolute deviations from the median\n const absoluteDeviations = vector.map(val => Math.abs(val - median))\n\n // Calculate the median of the absolute deviations\n const medianOfDeviations = calcMedian(absoluteDeviations)\n const scaleFactor = 1.4826 // Scale factor for robust scaling\n\n return medianOfDeviations * scaleFactor\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const giniCoefficientReductionFunction: ReductionFunctionDefinition<'gini-coefficient'> = {\n 'gini-coefficient': (vector) => {\n if (vector.some(x => x < 0)) {\n throw new Error('Gini coefficient is not defined for negative values')\n }\n const sorted = [...vector].sort((a, b) => a - b)\n const n = sorted.length\n const sum = sorted.reduce((acc, val) => acc + val, 0)\n if (sum === 0) {\n return 0\n }\n const gini = (2 * sorted.reduce((acc, val, i) => acc + (i + 1) * val, 0)) / (n * sum) - (n + 1) / n\n return gini\n },\n 'minLength': 1,\n}\n","import { calculateEntropy } from '../entropy'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const entropyReductionFunction: ReductionFunctionDefinition<'entropy'> = {\n entropy: vector => calculateEntropy(vector),\n minLength: 1,\n}\n","/**\n * Calculates the Shannon entropy of a vector.\n * Entropy measures the amount of uncertainty or randomness in the data.\n *\n * @param vector - An array of values to calculate entropy for\n * @returns The entropy value (in bits) or 0 for empty arrays\n */\nexport function calculateEntropy<T>(vector: T[]): number {\n // Count occurrences of each value\n const frequencies = new Map<T, number>()\n for (const value of vector) {\n frequencies.set(value, (frequencies.get(value) || 0) + 1)\n }\n\n // Get the total number of elements\n const total = vector.length\n\n // Calculate entropy using Shannon's formula\n let entropy = 0\n for (const frequency of frequencies.values()) {\n const probability = frequency / total\n // Skip cases where probability is 0 (log(0) is undefined)\n if (probability > 0) {\n entropy -= probability * Math.log2(probability)\n }\n }\n\n return entropy\n}\n","import { LitsError } from '../../../../errors'\nimport { assertVector } from '../../../../typeGuards/annotatedArrays'\nimport { assertNumber } from '../../../../typeGuards/number'\nimport type { BuiltinNormalExpression, BuiltinNormalExpressions } from '../../../../builtin/interface'\nimport { toFixedArity } from '../../../../utils/arity'\nimport { geometricMeanReductionFunction, harmonicMeanReductionFunction, meanReductionFunction } from './mean'\nimport { medianReductionFunction } from './median'\nimport { prodReductionFunction } from './prod'\nimport { sumReductionFunction } from './sum'\nimport { sampleVarianceReductionFunction, varianceReductionFunction } from './variance'\nimport { sampleStdevReductionFunction, stdevReductionFunction } from './standardDeviation'\nimport { iqrReductionFunction } from './iqr'\nimport { spanReductionFunction } from './span'\nimport { sampleSkewnessReductionFunction, skewnessReductionFunction } from './skewness'\nimport { eccessKurtosisReductionFunction, kurtosisReductionFunction, sampleExcessKurtosisReductionFunction, sampleKurtosisReductionFunction } from './kurtosis'\nimport { rmsReductionFunction } from './rms'\nimport { madReductionFunction } from './mad'\nimport { medadReductionFunction } from './medad'\nimport { giniCoefficientReductionFunction } from './giniCoefficient'\nimport { entropyReductionFunction } from './entropy'\n\ntype VectorReductionKey<T extends string> = `${T}`\ntype VectorMovingWindowKey<T extends string> = `moving-${T}`\ntype VectorCenteredMovingWindowKey<T extends string> = `centered-moving-${T}`\ntype VectorRunningKey<T extends string> = `running-${T}`\n\nexport type VectorReductionKeys<T extends string> = VectorReductionKey<T> | VectorMovingWindowKey<T> | VectorCenteredMovingWindowKey<T> | VectorRunningKey<T>\n\ntype ReductionFunction = (vector: number[]) => number\n// type MovingWindowFunction = (vector: number[], windowSize: number, sourceCodeInfo: SourceCodeInfo | undefined) => number[]\n\nexport type ReductionFunctionDefinition<T extends string> = Record<VectorReductionKey<T>, ReductionFunction> & {\n minLength?: number\n padding?: number\n}\n\nexport const reductionFunctionNormalExpressions: BuiltinNormalExpressions = {}\n\naddReductionFunctions(meanReductionFunction)\naddReductionFunctions(geometricMeanReductionFunction)\naddReductionFunctions(harmonicMeanReductionFunction)\naddReductionFunctions(medianReductionFunction)\naddReductionFunctions(sumReductionFunction)\naddReductionFunctions(prodReductionFunction)\naddReductionFunctions(varianceReductionFunction)\naddReductionFunctions(sampleVarianceReductionFunction)\naddReductionFunctions(stdevReductionFunction)\naddReductionFunctions(sampleStdevReductionFunction)\naddReductionFunctions(iqrReductionFunction)\naddReductionFunctions(spanReductionFunction)\naddReductionFunctions(skewnessReductionFunction)\naddReductionFunctions(sampleSkewnessReductionFunction)\naddReductionFunctions(eccessKurtosisReductionFunction)\naddReductionFunctions(kurtosisReductionFunction)\naddReductionFunctions(sampleExcessKurtosisReductionFunction)\naddReductionFunctions(sampleKurtosisReductionFunction)\naddReductionFunctions(rmsReductionFunction)\naddReductionFunctions(madReductionFunction)\naddReductionFunctions(medadReductionFunction)\naddReductionFunctions(giniCoefficientReductionFunction)\naddReductionFunctions(entropyReductionFunction)\n\nfunction addReductionFunctions<T extends string>(fns: ReductionFunctionDefinition<T>) {\n for (const [key, value] of Object.entries(fns)) {\n /* v8 ignore next 3 */\n if (reductionFunctionNormalExpressions[key]) {\n throw new Error(`Duplicate normal expression key found: ${key}`)\n }\n if (key !== 'minLength' && key !== 'padding' && typeof value === 'function') {\n const reductionFn = value as ReductionFunction\n const baseKey = key.replace(/^/, '')\n const movingKey = `moving-${baseKey}` as VectorMovingWindowKey<T>\n const centeredMovingKey = `centered-moving-${baseKey}` as VectorCenteredMovingWindowKey<T>\n const runningKey = `running-${baseKey}` as VectorRunningKey<T>\n const minLength = fns.minLength ?? 1\n assertNumber(minLength, undefined, { integer: true, finite: true, gte: 0 })\n reductionFunctionNormalExpressions[key] = createReductionNormalExpression(reductionFn, minLength)\n reductionFunctionNormalExpressions[movingKey] = createMovingNormalExpression(reductionFn, minLength)\n reductionFunctionNormalExpressions[centeredMovingKey] = createCenteredMovingNormalExpression(reductionFn, minLength, fns.padding ?? null)\n reductionFunctionNormalExpressions[runningKey] = createRunningNormalExpression(reductionFn, minLength)\n }\n }\n}\n\nfunction createReductionNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<number> {\n return {\n evaluate: ([vector], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n try {\n return reductionFunction(vector)\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(1),\n }\n}\n\nfunction createMovingNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<number[]> {\n return {\n evaluate: ([vector, windowSize], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(windowSize, sourceCodeInfo, { integer: true, finite: true, gte: minLength, lte: vector.length })\n if (vector.length === 0) {\n return []\n }\n try {\n if (windowSize >= vector.length) {\n return [reductionFunction(vector)]\n }\n const result = []\n for (let i = 0; i < vector.length - windowSize + 1; i += 1) {\n result.push(reductionFunction(vector.slice(i, i + windowSize)))\n }\n return result\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(2),\n }\n}\n\nfunction createCenteredMovingNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n padding: number | null,\n): BuiltinNormalExpression<(number | null)[]> {\n return {\n evaluate: ([vector, windowSize, leftPadding, rightPadding], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n assertNumber(windowSize, sourceCodeInfo, { integer: true, finite: true, gte: minLength, lte: vector.length })\n leftPadding = leftPadding ?? padding\n if (leftPadding !== null) {\n assertNumber(leftPadding, sourceCodeInfo, { finite: true })\n }\n rightPadding = rightPadding ?? padding\n if (rightPadding !== null) {\n assertNumber(rightPadding, sourceCodeInfo, { finite: true })\n }\n\n if (vector.length === 0) {\n return []\n }\n\n const halfWindowSize = Math.floor(windowSize / 2)\n const paddedVector = [\n ...Array<number | null>(halfWindowSize).fill(leftPadding),\n ...vector,\n ...Array<number | null>(halfWindowSize).fill(rightPadding),\n ]\n\n const start = typeof leftPadding === 'number' ? 0 : halfWindowSize\n const end = vector.length - (typeof rightPadding === 'number' ? 0 : (windowSize - halfWindowSize - 1))\n\n const result: (number | null)[] = [\n ...Array<null>(start).fill(null),\n ]\n\n try {\n for (let i = start; i < end; i += 1) {\n result.push(reductionFunction(paddedVector.slice(i, i + windowSize) as number[]))\n }\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n\n result.push(...Array<null>(vector.length - end).fill(null))\n return result\n },\n arity: { min: 2, max: 4 },\n }\n}\n\nfunction createRunningNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<(number | null)[]> {\n return {\n evaluate: ([vector], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n if (vector.length === 0) {\n return []\n }\n\n try {\n const nullsCount = Math.max(minLength - 1, 0)\n const result: (number | null)[] = Array<null>(nullsCount).fill(null)\n\n for (let i = nullsCount; i < vector.length; i += 1) {\n result.push(reductionFunction(vector.slice(0, i + 1)))\n }\n return result\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(1),\n }\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const sumReductionFunction: ReductionFunctionDefinition<'sum'> = {\n sum: vector => vector.reduce((acc, val) => acc + val, 0),\n minLength: 0,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const prodReductionFunction: ReductionFunctionDefinition<'prod'> = {\n prod: vector => vector.reduce((acc, val) => acc * val, 1),\n padding: 1,\n minLength: 0,\n}\n","import { LitsError } from '../../../errors'\nimport { assertNonEmptyVector, assertVector } from '../../../typeGuards/annotatedArrays'\nimport { assertFunctionLike } from '../../../typeGuards/lits'\nimport { assertNumber } from '../../../typeGuards/number'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport type { LitsModule } from '../interface'\nimport { moduleDocs } from './docs'\nimport { bincount } from './bincount'\nimport { calcHistogram } from './histogram'\nimport { mode } from './mode'\nimport { hasOutliers, outliers } from './outliers'\nimport { calcPercentile } from './percentile'\nimport { quartiles } from './quartiles'\nimport { reductionFunctionNormalExpressions } from './reductionFunctions'\n\nconst vectorFunctions: BuiltinNormalExpressions = {\n 'monotonic?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val >= vector[i - 1]!)\n || vector.every((val, i) => i === 0 || val <= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-monotonic?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val > vector[i - 1]!)\n || vector.every((val, i) => i === 0 || val < vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'increasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val >= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'decreasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val <= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-increasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val > vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-decreasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val < vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'mode': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n return mode(vector)\n },\n arity: toFixedArity(1),\n },\n 'min-index': {\n evaluate: ([vector], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val, i) => (val < vector[acc]! ? i : acc), 0)\n },\n arity: toFixedArity(1),\n },\n 'max-index': {\n evaluate: ([vector], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val, i) => (val > vector[acc]! ? i : acc), 0)\n },\n arity: toFixedArity(1),\n },\n 'sort-indices': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return [...vector.keys()].sort((a, b) => vector[a]! - vector[b]!)\n },\n arity: toFixedArity(1),\n },\n 'count-values': {\n evaluate: ([vector], sourceCodeInfo): [number, number][] => {\n assertVector(vector, sourceCodeInfo)\n\n const frequencyMap = new Map<number, number>()\n for (const value of vector) {\n frequencyMap.set(value, (frequencyMap.get(value) || 0) + 1)\n }\n return [...frequencyMap.entries()].sort((a, b) => {\n // First compare by count (descending)\n const countDiff = b[1] - a[1]\n if (countDiff !== 0)\n return countDiff\n // If counts are equal, sort by value (ascending)\n return a[0] - b[0]\n })\n },\n arity: toFixedArity(1),\n },\n 'linspace': {\n evaluate: ([start, end, numPoints], sourceCodeInfo): number[] => {\n assertNumber(start, sourceCodeInfo, { finite: true })\n assertNumber(end, sourceCodeInfo, { finite: true })\n assertNumber(numPoints, sourceCodeInfo, { integer: true, nonNegative: true })\n\n if (numPoints === 0) {\n return []\n }\n if (numPoints === 1) {\n return [start]\n }\n const step = (end - start) / (numPoints - 1)\n return Array.from({ length: numPoints }, (_, i) => start + i * step)\n },\n arity: toFixedArity(3),\n },\n 'ones': {\n evaluate: ([length], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => 1)\n },\n arity: toFixedArity(1),\n },\n 'zeros': {\n evaluate: ([length], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => 0)\n },\n arity: toFixedArity(1),\n },\n 'fill': {\n evaluate: ([length, value], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => value) as number[]\n },\n arity: toFixedArity(2),\n },\n 'generate': {\n evaluate: ([length, generator], sourceCodeInfo, contextStack, { executeFunction }): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n assertFunctionLike(generator, sourceCodeInfo)\n\n return Array.from({ length }, (_, i) => {\n const value = executeFunction(generator, [i], contextStack, sourceCodeInfo)\n assertNumber(value, sourceCodeInfo, { finite: true })\n return value\n })\n },\n arity: toFixedArity(2),\n },\n 'cumsum': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val) => {\n const last = acc[acc.length - 1] ?? 0\n acc.push(last + val)\n return acc\n }, [] as number[])\n },\n arity: toFixedArity(1),\n },\n 'cumprod': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val) => {\n const last = acc[acc.length - 1] ?? 1\n acc.push(last * val)\n return acc\n }, [] as number[])\n },\n arity: toFixedArity(1),\n },\n 'quartiles': {\n evaluate: ([vector], sourceCodeInfo): [number, number, number] => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < 4) {\n throw new LitsError('Quartiles require at least four values', sourceCodeInfo)\n }\n return quartiles(vector)\n },\n arity: toFixedArity(1),\n },\n 'percentile': {\n evaluate: ([vector, percentile], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n assertNumber(percentile, sourceCodeInfo, { finite: true, nonNegative: true, lte: 100 })\n return calcPercentile(vector, percentile)\n },\n arity: toFixedArity(2),\n },\n 'quantile': {\n evaluate: ([vector, quantile], sourceCodeInfo): number => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(quantile, sourceCodeInfo, { finite: true, nonNegative: true, lte: 1 })\n return calcPercentile(vector, quantile * 100)\n },\n arity: toFixedArity(2),\n },\n 'histogram': {\n evaluate: ([vector, bins], sourceCodeInfo): [number, number, number][] => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(bins, sourceCodeInfo, { integer: true, positive: true })\n\n return calcHistogram(vector, bins)\n },\n arity: toFixedArity(2),\n },\n 'ecdf': {\n evaluate: ([vector, value], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n assertNumber(value, sourceCodeInfo, { finite: true })\n\n const sorted = [...vector].sort((a, b) => a - b)\n const index = sorted.findIndex(val => val > value)\n\n return index === -1 ? 1 : index / sorted.length\n },\n arity: toFixedArity(2),\n },\n 'outliers?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return hasOutliers(vector)\n },\n arity: toFixedArity(1),\n },\n 'outliers': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n return outliers(vector)\n },\n arity: toFixedArity(1),\n },\n 'bincount': {\n evaluate: (params, sourceCodeInfo): number[] => {\n const vector = params[0]\n assertVector(vector, sourceCodeInfo)\n vector.forEach(val => assertNumber(val, sourceCodeInfo, { finite: true, integer: true, nonNegative: true }))\n\n const minSize = params[1] ?? 0\n assertNumber(minSize, sourceCodeInfo, { integer: true, nonNegative: true })\n\n const weights = params[2] ?? undefined\n if (weights !== undefined) {\n assertVector(weights, sourceCodeInfo)\n if (weights.length !== vector.length) {\n throw new LitsError('Weights vector must be the same length as the input vector', sourceCodeInfo)\n }\n weights.forEach(val => assertNumber(val, sourceCodeInfo, { finite: true }))\n }\n\n return bincount(vector, minSize, weights)\n },\n arity: { min: 1, max: 3 },\n },\n 'winsorize': {\n evaluate: ([vector, lowerQuantile, upperQuantile], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(lowerQuantile, sourceCodeInfo, { finite: true, gte: 0, lte: 1 })\n upperQuantile ??= lowerQuantile > 0.5 ? 1 : (1 - lowerQuantile)\n assertNumber(upperQuantile, sourceCodeInfo, { finite: true, gte: lowerQuantile, lte: 1 })\n\n if (vector.length === 0)\n return []\n\n const sorted = [...vector].sort((a, b) => a - b)\n\n const lowerIndex = Math.max(0, Math.floor(lowerQuantile * vector.length))\n const upperIndex = Math.min(vector.length - 1, Math.max(0, Math.floor(upperQuantile * vector.length) - 1))\n\n const lowerBound = sorted[lowerIndex]!\n const upperBound = sorted[upperIndex]!\n\n return vector.map(val => Math.max(lowerBound, Math.min(val, upperBound)))\n },\n arity: { min: 2, max: 3 },\n },\n 'mse': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => acc + (val - vectorB[i]!) ** 2, 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n 'rmse': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return Math.sqrt(vectorA.reduce((acc, val, i) => acc + (val - vectorB[i]!) ** 2, 0) / vectorA.length)\n },\n arity: toFixedArity(2),\n },\n 'mae': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => acc + Math.abs(val - vectorB[i]!), 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n 'smape': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => {\n const diff = Math.abs(val - vectorB[i]!)\n const denom = (Math.abs(val) + Math.abs(vectorB[i]!)) / 2\n return acc + (denom === 0 ? 0 : diff / denom)\n }, 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n\n}\n\naddReductionFunctions(reductionFunctionNormalExpressions)\n\nfunction addReductionFunctions(sequences: BuiltinNormalExpressions) {\n for (const [key, value] of Object.entries(sequences)) {\n /* v8 ignore next 3 */\n if (vectorFunctions[key]) {\n throw new Error(`Duplicate normal expression key found: ${key}`)\n }\n vectorFunctions[key] = value\n }\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (vectorFunctions[key])\n vectorFunctions[key].docs = docs\n}\n\nexport const vectorModule: LitsModule = {\n name: 'vector',\n functions: vectorFunctions,\n}\n","/**\n * Calculates the mode (most frequent value(s)) of a dataset\n * @param values An array of values of any type\n * @returns An array containing the mode(s) of the dataset\n */\nexport function mode(values: number[]): number[] {\n // Create a frequency map\n const frequencyMap = new Map<number, number>()\n\n // Count occurrences of each value\n for (const value of values) {\n frequencyMap.set(value, (frequencyMap.get(value) || 0) + 1)\n }\n\n // Find the maximum frequency\n let maxFrequency = 0\n for (const frequency of frequencyMap.values()) {\n if (frequency > maxFrequency) {\n maxFrequency = frequency\n }\n }\n\n // If all values appear only once, there is no mode\n if (maxFrequency === 1) {\n return values\n }\n\n // Collect all values that appear with the maximum frequency\n const modes: number[] = []\n for (const [value, frequency] of frequencyMap.entries()) {\n if (frequency === maxFrequency) {\n modes.push(value)\n }\n }\n\n return modes\n}\n","/**\n * Creates a histogram from an array of numbers, returning bin ranges and counts.\n * Each bin is represented as a tuple of [minValue, maxValue, count].\n *\n * @param vector - Array of numeric values\n * @param bins - Number of bins to divide the data into\n * @returns Array of tuples, each containing [binStart, binEnd, count]\n */\nexport function calcHistogram(vector: number[], bins: number): [number, number, number][] {\n if (vector.length === 0) {\n // Return empty bins with zero counts if input is empty\n const result: [number, number, number][] = []\n for (let i = 0; i < bins; i++) {\n result.push([0, 0, 0])\n }\n return result\n }\n\n // Find min and max values\n const min = Math.min(...vector)\n const max = Math.max(...vector)\n\n // Handle the case where all values are the same\n if (min === max) {\n const result: [number, number, number][] = []\n // Create bins with the same min/max and zero counts\n for (let i = 0; i < bins; i++) {\n result.push([min, min, 0])\n }\n // Put all values in the first bin\n result[0]![2] = vector.length\n return result\n }\n\n // Calculate bin size\n const binSize = (max - min) / bins\n\n // Initialize histogram array with bin boundaries and zero counts\n const histogram: [number, number, number][] = []\n for (let i = 0; i < bins; i++) {\n const binStart = min + i * binSize\n const binEnd = i === bins - 1 ? max : min + (i + 1) * binSize\n histogram.push([binStart, binEnd, 0])\n }\n\n // Count values in each bin\n for (const value of vector) {\n if (value === max) {\n // Place maximum value in the last bin\n histogram[bins - 1]![2] += 1\n }\n else {\n const binIndex = Math.min(\n Math.floor((value - min) / binSize),\n bins - 1,\n )\n histogram[binIndex]![2] += 1\n }\n }\n\n return histogram\n}\n","/**\n * Counts occurrences of each integer value in an array of non-negative integers.\n *\n * @param array - Array of non-negative integers to count\n * @param minLength - Minimum length of the output array (default: 0)\n * @param weights - Optional array of weights (same length as input array)\n * @returns An array where index i contains the count of occurrences of i in the input array\n */\nexport function bincount(\n array: number[],\n minLength: number = 0,\n weights?: number[],\n): number[] {\n if (array.length === 0) {\n return Array.from({ length: minLength }, () => 0)\n }\n\n // Find the maximum value to determine output array size\n const maxValue = Math.max(...array)\n const outputLength = Math.max(maxValue + 1, minLength)\n const counts = Array.from({ length: outputLength }, () => 0)\n\n // Count occurrences (or sum weights if provided)\n for (let i = 0; i < array.length; i++) {\n const value = Math.floor(array[i]!)\n\n if (value < outputLength) {\n // If weights provided, add weight; otherwise add 1\n counts[value]! += weights ? weights[i]! : 1\n }\n }\n\n return counts\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","LitsError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getLitsErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","REGEXP_SYMBOL","isLitsFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","getSourceCodeInfo","anyValue","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","annotatedArrays","WeakSet","vectors","notVectors","assertVector","vector","every","elem","add","isVector","assertNonEmptyVector","isObj","regexp","isColl","isSeq","assertFunctionLike","isFunctionLike","typeName","getAssertionError","toFixedArity","arity","min","moduleDocs","mean","category","description","returns","args","variants","argumentNames","examples","seeAlso","windowSize","a","b","median","variance","stdev","iqr","sum","prod","span","skewness","kurtosis","rms","mad","medad","entropy","mode","array","linspace","start","stop","n","ones","zeros","fill","generate","cumsum","cumprod","quartiles","percentile","quantile","histogram","bins","ecdf","threshold","outliers","bincount","minSize","weights","hideOperatorForm","winsorize","mse","rmse","mae","smape","sorted","sort","q1Index","floor","q1","q3Index","q3","lowerBound","upperBound","val","calcPercentile","data","sortedData","index","lowerIndex","upperIndex","ceil","weight","midIndex","q2","lowerHalf","slice","upperHalf","midLower","midUpper","calcMean","reduce","acc","geometricMeanReductionFunction","some","exp","log","calcMedian","mid","medianReductionFunction","calcVariance","optionalMean","varianceReductionFunction","sampleVarianceReductionFunction","calcSampleVariance","minLength","calcStdDev","sqrt","stdevReductionFunction","sampleStdevReductionFunction","calcSampleStdDev","iqrReductionFunction","spanReductionFunction","skewnessReductionFunction","stdDev","sampleSkewnessReductionFunction","sumSquaredDiffs","sumCubedDiffs","diff","sampleVariance","sampleStdDev","sampleSkewness","kurtosisReductionFunction","eccessKurtosisReductionFunction","excessKurtosis","sampleKurtosisReductionFunction","sampleKurtosis","sampleExcessKurtosisReductionFunction","sampleExcessKurtosis","rmsReductionFunction","madReductionFunction","abs","calcMad","medadReductionFunction","map","calcMedad","giniCoefficientReductionFunction","i","entropyReductionFunction","frequencies","Map","set","get","total","frequency","probability","log2","calculateEntropy","reductionFunctionNormalExpressions","addReductionFunctions","fns","entries","reductionFn","baseKey","replace","movingKey","centeredMovingKey","runningKey","undefined","createReductionNormalExpression","createMovingNormalExpression","createCenteredMovingNormalExpression","padding","createRunningNormalExpression","reductionFunction","evaluate","error","result","push","halfWindowSize","paddedVector","end","nullsCount","vectorFunctions","frequencyMap","maxFrequency","modes","countDiff","numPoints","step","from","_","generator","contextStack","executeFunction","last","binSize","binStart","binEnd","calcHistogram","findIndex","hasOutliers","params","forEach","maxValue","outputLength","counts","lowerQuantile","upperQuantile","vectorA","vectorB","denom","sequences","docs","vectorModule","functions"],"mappings":"AAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAkBC,MACbX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD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,CACtCxR,KAAM,SACNyR,UAAWhC"}
|
|
1
|
+
{"version":3,"file":"vector.esm.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/number.ts","../../src/typeGuards/annotatedArrays.ts","../../src/typeGuards/litsFunction.ts","../../src/typeGuards/lits.ts","../../src/utils/getAssertionError.ts","../../src/utils/arity.ts","../../src/utils/maybePromise.ts","../../src/builtin/modules/vector/docs.ts","../../src/builtin/modules/vector/outliers.ts","../../src/builtin/modules/vector/percentile.ts","../../src/builtin/modules/vector/quartiles.ts","../../src/builtin/modules/vector/calcMean.ts","../../src/builtin/modules/vector/reductionFunctions/mean.ts","../../src/builtin/modules/vector/calcMedian.ts","../../src/builtin/modules/vector/reductionFunctions/median.ts","../../src/builtin/modules/vector/calcVariance.ts","../../src/builtin/modules/vector/reductionFunctions/variance.ts","../../src/builtin/modules/vector/calcStdDev.ts","../../src/builtin/modules/vector/reductionFunctions/standardDeviation.ts","../../src/builtin/modules/vector/reductionFunctions/iqr.ts","../../src/builtin/modules/vector/reductionFunctions/span.ts","../../src/builtin/modules/vector/reductionFunctions/skewness.ts","../../src/builtin/modules/vector/reductionFunctions/kurtosis.ts","../../src/builtin/modules/vector/reductionFunctions/rms.ts","../../src/builtin/modules/vector/reductionFunctions/mad.ts","../../src/builtin/modules/vector/calcMad.ts","../../src/builtin/modules/vector/reductionFunctions/medad.ts","../../src/builtin/modules/vector/calcMedad.ts","../../src/builtin/modules/vector/reductionFunctions/giniCoefficient.ts","../../src/builtin/modules/vector/reductionFunctions/entropy.ts","../../src/builtin/modules/vector/entropy.ts","../../src/builtin/modules/vector/reductionFunctions/index.ts","../../src/builtin/modules/vector/reductionFunctions/sum.ts","../../src/builtin/modules/vector/reductionFunctions/prod.ts","../../src/builtin/modules/vector/index.ts","../../src/builtin/modules/vector/mode.ts","../../src/builtin/modules/vector/histogram.ts","../../src/builtin/modules/vector/bincount.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getLitsErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class LitsError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getLitsErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, LitsError.prototype)\n this.name = 'LitsError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends LitsError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends LitsError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends LitsError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isLitsError(error: unknown): error is LitsError {\n return error instanceof LitsError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, LitsFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isLitsFunction(func: unknown): func is LitsFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isLitsFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new LitsError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import { LitsError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new LitsError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new LitsError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new LitsError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new LitsError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new LitsError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new LitsError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { LitsFunction, NativeJsFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isLitsFunction(value: unknown): value is LitsFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as LitsFunction)[FUNCTION_SYMBOL]\n}\nexport function asLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsFunction {\n assertLitsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is LitsFunction {\n if (!isLitsFunction(value))\n throw getAssertionError('LitsFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isLitsFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isNativeJsFunction(value: unknown): value is NativeJsFunction {\n return isLitsFunction(value) && value.functionType === 'NativeJsFunction'\n}\nexport function asNativeJsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): NativeJsFunction {\n assertNativeJsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertNativeJsFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is NativeJsFunction {\n if (!isNativeJsFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { REGEXP_SYMBOL } from '../utils/symbols'\nimport { isLitsFunction } from './litsFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isLitsFunction(value)\n || isRegularExpression(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nfunction isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isLitsFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsError {\n return new LitsError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { Arity } from '../builtin/interface'\nimport { LitsError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/lits'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new LitsError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new LitsError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","/**\n * MaybePromise utilities for transparent async support.\n *\n * The sync path stays zero-overhead — when no async JS functions are involved,\n * everything runs synchronously with only `instanceof Promise` checks as overhead.\n * When an async value is detected, the evaluation chain switches to Promise-based\n * execution for the remainder.\n */\n\nexport type MaybePromise<T> = T | Promise<T>\n\n/**\n * Chain a value that might be a Promise. If the value is sync, calls fn synchronously.\n * If it's a Promise, chains with .then().\n */\nexport function chain<T, U>(value: MaybePromise<T>, fn: (v: T) => MaybePromise<U>): MaybePromise<U> {\n if (value instanceof Promise) {\n return value.then(fn)\n }\n return fn(value)\n}\n\n/**\n * Like Array.map but handles MaybePromise callbacks sequentially.\n * In the sync case, runs as a simple loop. Switches to async only when needed.\n */\nexport function mapSequential<T, U>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<U>,\n): MaybePromise<U[]> {\n const results: U[] = []\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingMap(result, results, arr, fn, i)\n }\n results.push(result)\n }\n return results\n}\n\nasync function chainRemainingMap<T, U>(\n currentPromise: Promise<U>,\n results: U[],\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<U>,\n startIndex: number,\n): Promise<U[]> {\n results.push(await currentPromise)\n for (let i = startIndex + 1; i < arr.length; i++) {\n results.push(await fn(arr[i]!, i))\n }\n return results\n}\n\n/**\n * Like Array.reduce but handles MaybePromise callbacks sequentially.\n * In the sync case, runs as a simple loop. Switches to async only when needed.\n */\nexport function reduceSequential<T, U>(\n arr: readonly T[],\n fn: (acc: U, elem: T, index: number) => MaybePromise<U>,\n initial: U,\n): MaybePromise<U> {\n let result: U = initial\n for (let i = 0; i < arr.length; i++) {\n const next = fn(result, arr[i]!, i)\n if (next instanceof Promise) {\n return chainRemainingReduce(next, arr, fn, i)\n }\n result = next\n }\n return result\n}\n\nasync function chainRemainingReduce<T, U>(\n currentPromise: Promise<U>,\n arr: readonly T[],\n fn: (acc: U, elem: T, index: number) => MaybePromise<U>,\n startIndex: number,\n): Promise<U> {\n let result = await currentPromise\n for (let i = startIndex + 1; i < arr.length; i++) {\n result = await fn(result, arr[i]!, i)\n }\n return result\n}\n\n/**\n * Like Array.forEach but handles MaybePromise callbacks sequentially.\n * In the sync case, runs as a simple loop. Switches to async only when needed.\n */\nexport function forEachSequential<T>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<void>,\n): MaybePromise<void> {\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingForEach(result, arr, fn, i)\n }\n }\n}\n\nasync function chainRemainingForEach<T>(\n currentPromise: Promise<void>,\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<void>,\n startIndex: number,\n): Promise<void> {\n await currentPromise\n for (let i = startIndex + 1; i < arr.length; i++) {\n await fn(arr[i]!, i)\n }\n}\n\n/**\n * Try/catch that handles MaybePromise values correctly.\n * If tryFn returns a Promise, catches both sync throws and Promise rejections.\n */\nexport function tryCatch<T>(\n tryFn: () => MaybePromise<T>,\n catchFn: (error: unknown) => MaybePromise<T>,\n): MaybePromise<T> {\n try {\n const result = tryFn()\n if (result instanceof Promise) {\n return result.catch(catchFn)\n }\n return result\n }\n catch (error) {\n return catchFn(error)\n }\n}\n\n/**\n * Like Array.some but handles MaybePromise callbacks sequentially.\n * Returns the first truthy MaybePromise result, or false.\n */\nexport function someSequential<T>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n): MaybePromise<boolean> {\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingSome(result, arr, fn, i)\n }\n if (result)\n return true\n }\n return false\n}\n\nasync function chainRemainingSome<T>(\n currentPromise: Promise<unknown>,\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n startIndex: number,\n): Promise<boolean> {\n if (await currentPromise)\n return true\n for (let i = startIndex + 1; i < arr.length; i++) {\n if (await fn(arr[i]!, i))\n return true\n }\n return false\n}\n\n/**\n * Like Array.every but handles MaybePromise callbacks sequentially.\n * Returns false as soon as a falsy result is found.\n */\nexport function everySequential<T>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n): MaybePromise<boolean> {\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingEvery(result, arr, fn, i)\n }\n if (!result)\n return false\n }\n return true\n}\n\nasync function chainRemainingEvery<T>(\n currentPromise: Promise<unknown>,\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n startIndex: number,\n): Promise<boolean> {\n if (!await currentPromise)\n return false\n for (let i = startIndex + 1; i < arr.length; i++) {\n if (!await fn(arr[i]!, i))\n return false\n }\n return true\n}\n\n/**\n * Like Array.filter but handles MaybePromise callbacks sequentially.\n * Returns the filtered array.\n */\nexport function filterSequential<T>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n): MaybePromise<T[]> {\n const results: T[] = []\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingFilter(result, results, arr, fn, i)\n }\n if (result)\n results.push(arr[i]!)\n }\n return results\n}\n\nasync function chainRemainingFilter<T>(\n currentPromise: Promise<unknown>,\n results: T[],\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n startIndex: number,\n): Promise<T[]> {\n if (await currentPromise)\n results.push(arr[startIndex]!)\n for (let i = startIndex + 1; i < arr.length; i++) {\n if (await fn(arr[i]!, i))\n results.push(arr[i]!)\n }\n return results\n}\n\n/**\n * Like Array.findIndex but handles MaybePromise callbacks sequentially.\n * Returns -1 if no element matches.\n */\nexport function findIndexSequential<T>(\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n): MaybePromise<number> {\n for (let i = 0; i < arr.length; i++) {\n const result = fn(arr[i]!, i)\n if (result instanceof Promise) {\n return chainRemainingFindIndex(result, arr, fn, i)\n }\n if (result)\n return i\n }\n return -1\n}\n\nasync function chainRemainingFindIndex<T>(\n currentPromise: Promise<unknown>,\n arr: readonly T[],\n fn: (elem: T, index: number) => MaybePromise<unknown>,\n startIndex: number,\n): Promise<number> {\n if (await currentPromise)\n return startIndex\n for (let i = startIndex + 1; i < arr.length; i++) {\n if (await fn(arr[i]!, i))\n return i\n }\n return -1\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'mean': {\n category: 'vector',\n description: 'Returns the **mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'mean([1, 2, 3])',\n 'mean([1, 2, -3])',\n ],\n seeAlso: ['mean', 'vector.moving-mean', 'vector.centered-moving-mean', 'vector.running-mean', 'vector.geometric-mean', 'vector.harmonic-mean', 'vector.median', 'vector.mode', 'vector.sum', 'vector.rms'],\n },\n 'moving-mean': {\n category: 'vector',\n description: 'Returns the **moving mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-mean } = import(\"vector\");\\nmoving-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-mean } = import(\"vector\");\\nmoving-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['moving-fn', 'vector.mean', 'vector.centered-moving-mean', 'vector.running-mean'],\n },\n 'centered-moving-mean': {\n category: 'vector',\n description: 'Returns the **centered moving mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-mean } = import(\"vector\");\\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.mean', 'vector.moving-mean', 'vector.running-mean'],\n },\n 'running-mean': {\n category: 'vector',\n description: 'Returns the **running mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-mean } = import(\"vector\");\\nrunning-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['running-fn', 'vector.mean', 'vector.moving-mean', 'vector.centered-moving-mean'],\n },\n 'geometric-mean': {\n category: 'vector',\n description: 'Returns the **geometric mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **geometric mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { geometric-mean } = import(\"vector\");\\ngeometric-mean([1, 2, 3])',\n 'let { geometric-mean } = import(\"vector\");\\ngeometric-mean([1, 2, 9])',\n ],\n seeAlso: ['vector.moving-geometric-mean', 'vector.centered-moving-geometric-mean', 'vector.running-geometric-mean', 'vector.mean', 'vector.harmonic-mean'],\n },\n 'moving-geometric-mean': {\n category: 'vector',\n description: 'Returns the **moving geometric mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving geometric mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-geometric-mean } = import(\"vector\");\\nmoving-geometric-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-geometric-mean } = import(\"vector\");\\nmoving-geometric-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.centered-moving-geometric-mean', 'vector.running-geometric-mean'],\n },\n 'centered-moving-geometric-mean': {\n category: 'vector',\n description: 'Returns the **centered moving geometric mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving geometric mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-geometric-mean } = import(\"vector\");\\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.moving-geometric-mean', 'vector.running-geometric-mean'],\n },\n 'running-geometric-mean': {\n category: 'vector',\n description: 'Returns the **running geometric mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running geometric mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-geometric-mean } = import(\"vector\");\\nrunning-geometric-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.geometric-mean', 'vector.moving-geometric-mean', 'vector.centered-moving-geometric-mean'],\n },\n 'harmonic-mean': {\n category: 'vector',\n description: 'Returns the **harmonic mean** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **harmonic mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { harmonic-mean } = import(\"vector\");\\nharmonic-mean([1, 2, 3])',\n 'let { harmonic-mean } = import(\"vector\");\\nharmonic-mean([1, 2, 9])',\n ],\n seeAlso: ['vector.moving-harmonic-mean', 'vector.centered-moving-harmonic-mean', 'vector.running-harmonic-mean', 'vector.mean', 'vector.geometric-mean'],\n },\n 'moving-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **moving harmonic mean** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving harmonic mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-harmonic-mean } = import(\"vector\");\\nmoving-harmonic-mean([1, 2, 3, 4, 5], 3)',\n 'let { moving-harmonic-mean } = import(\"vector\");\\nmoving-harmonic-mean([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.centered-moving-harmonic-mean', 'vector.running-harmonic-mean'],\n },\n 'centered-moving-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **centered moving harmonic mean** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving harmonic mean** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-harmonic-mean } = import(\"vector\");\\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.moving-harmonic-mean', 'vector.running-harmonic-mean'],\n },\n 'running-harmonic-mean': {\n category: 'vector',\n description: 'Returns the **running harmonic mean** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running harmonic mean** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-harmonic-mean } = import(\"vector\");\\nrunning-harmonic-mean([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.harmonic-mean', 'vector.moving-harmonic-mean', 'vector.centered-moving-harmonic-mean'],\n },\n 'median': {\n category: 'vector',\n description: 'Returns the median of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the median of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'median([1, 2, 3])',\n 'median([1, 2, -3])',\n 'median([1, 2, 3, 4])',\n 'median([1, 2, -3, 4])',\n ],\n seeAlso: ['median', 'vector.moving-median', 'vector.centered-moving-median', 'vector.running-median', 'vector.mean', 'vector.mode', 'vector.quartiles', 'vector.percentile', 'vector.iqr', 'vector.medad'],\n },\n 'moving-median': {\n category: 'vector',\n description: 'Returns the **moving median** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving median** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-median } = import(\"vector\");\\nmoving-median([1, 2, 3, 4, 5], 3)',\n 'let { moving-median } = import(\"vector\");\\nmoving-median([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.median', 'vector.centered-moving-median', 'vector.running-median'],\n },\n 'centered-moving-median': {\n category: 'vector',\n description: 'Returns the **centered moving median** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving median** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3, 0, 10)',\n 'let { centered-moving-median } = import(\"vector\");\\ncentered-moving-median([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.median', 'vector.moving-median', 'vector.running-median'],\n },\n 'running-median': {\n category: 'vector',\n description: 'Returns the **running median** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running median** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-median } = import(\"vector\");\\nrunning-median([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.median', 'vector.moving-median', 'vector.centered-moving-median'],\n },\n 'variance': {\n category: 'vector',\n description: 'Returns the **variance** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **variance** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { variance } = import(\"vector\");\\nvariance([1, 2, 3])',\n 'let { variance } = import(\"vector\");\\nvariance([1, 2, -3])',\n ],\n seeAlso: ['linear-algebra.cov', 'vector.moving-variance', 'vector.centered-moving-variance', 'vector.running-variance', 'vector.stdev', 'vector.sample-variance', 'vector.mad'],\n },\n 'moving-variance': {\n category: 'vector',\n description: 'Returns the **moving variance** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-variance } = import(\"vector\");\\nmoving-variance([1, 2, 3, 4, 5], 3)',\n 'let { moving-variance } = import(\"vector\");\\nmoving-variance([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.variance', 'vector.centered-moving-variance', 'vector.running-variance'],\n },\n 'centered-moving-variance': {\n category: 'vector',\n description: 'Returns the **centered moving variance** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-variance } = import(\"vector\");\\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.variance', 'vector.moving-variance', 'vector.running-variance'],\n },\n 'running-variance': {\n category: 'vector',\n description: 'Returns the **running variance** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running variance** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-variance } = import(\"vector\");\\nrunning-variance([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.variance', 'vector.moving-variance', 'vector.centered-moving-variance'],\n },\n 'sample-variance': {\n category: 'vector',\n description: 'Returns the sample variance of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sample variance of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, -3])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3, 4])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, -3, 4])',\n 'let { sample-variance } = import(\"vector\");\\nsample-variance([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-sample-variance', 'vector.centered-moving-sample-variance', 'vector.running-sample-variance', 'vector.variance', 'vector.sample-stdev'],\n },\n 'moving-sample-variance': {\n category: 'vector',\n description: 'Returns the **moving sample variance** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-variance } = import(\"vector\");\\nmoving-sample-variance([1, 2, 3, 4, 5], 3)',\n 'let { moving-sample-variance } = import(\"vector\");\\nmoving-sample-variance([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sample-variance', 'vector.centered-moving-sample-variance', 'vector.running-sample-variance'],\n },\n 'centered-moving-sample-variance': {\n category: 'vector',\n description: 'Returns the **centered moving sample variance** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample variance** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-sample-variance } = import(\"vector\");\\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.sample-variance', 'vector.moving-sample-variance', 'vector.running-sample-variance'],\n },\n 'running-sample-variance': {\n category: 'vector',\n description: 'Returns the **running sample variance** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample variance** of. First element in result is `null` since **sample variance** is not defined for a single element.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-variance } = import(\"vector\");\\nrunning-sample-variance([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.sample-variance', 'vector.moving-sample-variance', 'vector.centered-moving-sample-variance'],\n },\n 'stdev': {\n category: 'vector',\n description: 'Returns the standard deviation of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the standard deviation of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, -3])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3, 4])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, -3, 4])',\n 'let { stdev } = import(\"vector\");\\nstdev([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-stdev', 'vector.centered-moving-stdev', 'vector.running-stdev', 'vector.variance', 'vector.sample-stdev', 'vector.rms', 'vector.mad'],\n },\n 'moving-stdev': {\n category: 'vector',\n description: 'Returns the **moving standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-stdev } = import(\"vector\");\\nmoving-stdev([1, 2, 3, 4, 5], 3)',\n 'let { moving-stdev } = import(\"vector\");\\nmoving-stdev([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.stdev', 'vector.centered-moving-stdev', 'vector.running-stdev'],\n },\n 'centered-moving-stdev': {\n category: 'vector',\n description: 'Returns the **centered moving standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-stdev } = import(\"vector\");\\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.stdev', 'vector.moving-stdev', 'vector.running-stdev'],\n },\n 'running-stdev': {\n category: 'vector',\n description: 'Returns the **running standard deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running standard deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-stdev } = import(\"vector\");\\nrunning-stdev([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.stdev', 'vector.moving-stdev', 'vector.centered-moving-stdev'],\n },\n 'sample-stdev': {\n category: 'vector',\n description: 'Returns the sample standard deviation of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sample standard deviation of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, -3])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3, 4])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, -3, 4])',\n 'let { sample-stdev } = import(\"vector\");\\nsample-stdev([1, 2, 3, 40, 50])',\n ],\n seeAlso: ['vector.moving-sample-stdev', 'vector.centered-moving-sample-stdev', 'vector.running-sample-stdev', 'vector.stdev', 'vector.sample-variance'],\n },\n 'moving-sample-stdev': {\n category: 'vector',\n description: 'Returns the **moving sample standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-stdev } = import(\"vector\");\\nmoving-sample-stdev([1, 2, 3, 4, 5], 3)',\n 'let { moving-sample-stdev } = import(\"vector\");\\nmoving-sample-stdev([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.centered-moving-sample-stdev', 'vector.running-sample-stdev'],\n },\n 'centered-moving-sample-stdev': {\n category: 'vector',\n description: 'Returns the **centered moving sample standard deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample standard deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1, 5)',\n 'let { centered-moving-sample-stdev } = import(\"vector\");\\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 0, 6)',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.moving-sample-stdev', 'vector.running-sample-stdev'],\n },\n 'running-sample-stdev': {\n category: 'vector',\n description: 'Returns the **running sample standard deviation** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample standard deviation** of. First element in result is `null` since **sample standard deviation** is not defined for a single element.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-stdev } = import(\"vector\");\\nrunning-sample-stdev([1, 2, 3, 4, 5])',\n ],\n seeAlso: ['vector.sample-stdev', 'vector.moving-sample-stdev', 'vector.centered-moving-sample-stdev'],\n },\n 'iqr': {\n category: 'vector',\n description: 'Calculates the **interquartile range** of a `vector`. Returns the difference between the third and first quartiles.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **interquartile range** of. Minimum length is 4.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { iqr } = import(\"vector\");\\niqr([1, 2, 3, 4])',\n 'let { iqr } = import(\"vector\");\\niqr([5, 4, 3, 2, 1, 2, 3, 4, 5])',\n 'let { iqr } = import(\"vector\");\\niqr(range(1, 1000))',\n 'let { iqr, generate } = import(\"vector\");\\niqr(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { iqr, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\niqr(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.moving-iqr', 'vector.centered-moving-iqr', 'vector.running-iqr', 'vector.quartiles', 'vector.median', 'vector.mad', 'vector.medad', 'vector.outliers?', 'vector.outliers'],\n },\n 'moving-iqr': {\n category: 'vector',\n description: 'Calculates the **moving interquartile range** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving interquartile range** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-iqr } = import(\"vector\");\\nmoving-iqr([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.iqr', 'vector.centered-moving-iqr', 'vector.running-iqr'],\n },\n 'centered-moving-iqr': {\n category: 'vector',\n description: 'Calculates the **centered moving interquartile range** of a `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving interquartile range** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-iqr } = import(\"vector\");\\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-iqr } = import(\"vector\");\\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.iqr', 'vector.moving-iqr', 'vector.running-iqr'],\n },\n 'running-iqr': {\n category: 'vector',\n description: 'Calculates the **running interquartile range** of a `vector`. First three element in result is `null` since **running interquartile range** is not defined for less than four elements.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running interquartile range** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-iqr } = import(\"vector\");\\nrunning-iqr([1, 2, 3, 4, 5, 6])',\n 'let { running-iqr } = import(\"vector\");\\nrunning-iqr([-1, -2, -3, 1, 2, 3])',\n ],\n seeAlso: ['vector.iqr', 'vector.moving-iqr', 'vector.centered-moving-iqr'],\n },\n 'sum': {\n category: 'vector',\n description: 'Returns the sum of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to sum.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'sum([1, 2, 3])',\n 'sum([1, 2, -3])',\n ],\n seeAlso: ['sum', 'vector.moving-sum', 'vector.centered-moving-sum', 'vector.running-sum', 'vector.prod', 'vector.cumsum', 'vector.mean'],\n },\n 'moving-sum': {\n category: 'vector',\n description: 'Returns the **moving sum** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sum** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sum } = import(\"vector\");\\nmoving-sum([1, 2, 3, 4, 5], 3)',\n 'let { moving-sum } = import(\"vector\");\\nmoving-sum([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.sum', 'vector.centered-moving-sum', 'vector.running-sum'],\n },\n 'centered-moving-sum': {\n category: 'vector',\n description: 'Returns the **centered moving sum** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sum** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the centered moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 0, 0)',\n 'let { centered-moving-sum } = import(\"vector\");\\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 10)',\n ],\n seeAlso: ['vector.sum', 'vector.moving-sum', 'vector.running-sum'],\n },\n 'running-sum': {\n category: 'vector',\n description: 'Returns the **running sum** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sum** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sum } = import(\"vector\");\\nrunning-sum([1, 2, 3])',\n 'let { running-sum } = import(\"vector\");\\nrunning-sum([1, -2, -3])',\n ],\n seeAlso: ['vector.sum', 'vector.moving-sum', 'vector.centered-moving-sum', 'vector.cumsum'],\n },\n 'prod': {\n category: 'vector',\n description: 'Returns the **product** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **product** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'prod([1, 2, 3])',\n 'prod([1, 2, -3])',\n ],\n seeAlso: ['prod', 'vector.moving-prod', 'vector.centered-moving-prod', 'vector.running-prod', 'vector.sum', 'vector.cumprod'],\n },\n 'moving-prod': {\n category: 'vector',\n description: 'Returns the **moving product** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving product** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-prod } = import(\"vector\");\\nmoving-prod([1, 2, 3, 4, 5], 3)',\n 'let { moving-prod } = import(\"vector\");\\nmoving-prod([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.prod', 'vector.centered-moving-prod', 'vector.running-prod'],\n },\n 'centered-moving-prod': {\n category: 'vector',\n description: 'Returns the **centered moving product** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving product** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-prod } = import(\"vector\");\\ncentered-moving-prod([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-prod } = import(\"vector\");\\ncentered-moving-prod([1, 2, 3, 4, 5], 3, 0, 0)',\n ],\n seeAlso: ['vector.prod', 'vector.moving-prod', 'vector.running-prod'],\n },\n 'running-prod': {\n category: 'vector',\n description: 'Returns the **running product** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running product** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-prod } = import(\"vector\");\\nrunning-prod([1, 2, 3, 4, 5])',\n 'let { running-prod } = import(\"vector\");\\nrunning-prod([1, -2, -3])',\n ],\n seeAlso: ['vector.prod', 'vector.moving-prod', 'vector.centered-moving-prod', 'vector.cumprod'],\n },\n 'span': {\n category: 'vector',\n description: 'Returns the difference between the maximum and minimum values in a vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the span of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { span } = import(\"vector\");\\nspan([1, 2, 3])',\n 'let { span } = import(\"vector\");\\nspan([1, 1, 2, 3, 3])',\n 'let { span } = import(\"vector\");\\nspan([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-span', 'vector.centered-moving-span', 'vector.running-span', 'min', 'max'],\n },\n 'moving-span': {\n category: 'vector',\n description: 'Calculates the **moving span** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving span** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-span } = import(\"vector\");\\nmoving-span([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.span', 'vector.centered-moving-span', 'vector.running-span'],\n },\n 'centered-moving-span': {\n category: 'vector',\n description: 'Calculates the **centered moving span** of a `vector` with a given window size. The result is padded with `leftPadding` on the left and right.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving span** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'The value to pad the result with on the left.',\n },\n rightPadding: {\n type: 'number',\n description: 'The value to pad the result with on the right.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-span } = import(\"vector\");\\ncentered-moving-span([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-span } = import(\"vector\");\\ncentered-moving-span([1, 2, 4, 7, 11, 16], 3, 0, 100)',\n ],\n seeAlso: ['vector.span', 'vector.moving-span', 'vector.running-span'],\n },\n 'running-span': {\n category: 'vector',\n description: 'Calculates the **running span** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running span** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-span } = import(\"vector\");\\nrunning-span([1, 2, 4])',\n ],\n seeAlso: ['vector.span', 'vector.moving-span', 'vector.centered-moving-span'],\n },\n 'skewness': {\n category: 'vector',\n description: 'Calculates the **skewness** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **skewness** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { skewness } = import(\"vector\");\\nskewness([1, 2, 3, 6, 20])',\n 'let { skewness } = import(\"vector\");\\nskewness([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-skewness', 'vector.centered-moving-skewness', 'vector.running-skewness', 'vector.kurtosis', 'vector.sample-skewness', 'vector.excess-kurtosis'],\n },\n 'moving-skewness': {\n category: 'vector',\n description: 'Calculates the **moving skewness** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-skewness } = import(\"vector\");\\nmoving-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-skewness } = import(\"vector\");\\nmoving-skewness([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.skewness', 'vector.centered-moving-skewness', 'vector.running-skewness'],\n },\n 'centered-moving-skewness': {\n category: 'vector',\n description: 'Calculates the **centered moving skewness** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-skewness } = import(\"vector\");\\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-skewness } = import(\"vector\");\\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.skewness', 'vector.moving-skewness', 'vector.running-skewness'],\n },\n 'running-skewness': {\n category: 'vector',\n description: 'Calculates the **running skewness** of a `vector` with a given window size. First two element in result is `null` since **running skewness** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running skewness** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-skewness } = import(\"vector\");\\nrunning-skewness([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.skewness', 'vector.moving-skewness', 'vector.centered-moving-skewness'],\n },\n 'sample-skewness': {\n category: 'vector',\n description: 'Calculates the **sample skewness** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample skewness** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-skewness } = import(\"vector\");\\nsample-skewness([1, 2, 3, 6, 20])',\n 'let { sample-skewness } = import(\"vector\");\\nsample-skewness([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-skewness', 'vector.centered-moving-sample-skewness', 'vector.running-sample-skewness', 'vector.skewness', 'vector.sample-kurtosis'],\n },\n 'moving-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **moving sample skewness** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-skewness } = import(\"vector\");\\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-skewness } = import(\"vector\");\\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.centered-moving-sample-skewness', 'vector.running-sample-skewness'],\n },\n 'centered-moving-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **centered moving sample skewness** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample skewness** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-skewness } = import(\"vector\");\\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-skewness } = import(\"vector\");\\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 3, 0, 100)',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.moving-sample-skewness', 'vector.running-sample-skewness'],\n },\n 'running-sample-skewness': {\n category: 'vector',\n description: 'Calculates the **running sample skewness** of a `vector` with a given window size. First two element in result is `null` since **running sample skewness** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample skewness** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-skewness } = import(\"vector\");\\nrunning-sample-skewness([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-skewness', 'vector.moving-sample-skewness', 'vector.centered-moving-sample-skewness'],\n },\n 'excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **excess kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **excess kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { excess-kurtosis } = import(\"vector\");\\nexcess-kurtosis([1, 2, 3, 6, 20])',\n 'let { excess-kurtosis } = import(\"vector\");\\nexcess-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-excess-kurtosis', 'vector.centered-moving-excess-kurtosis', 'vector.running-excess-kurtosis', 'vector.kurtosis', 'vector.sample-excess-kurtosis', 'vector.skewness'],\n },\n 'moving-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving excess kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-excess-kurtosis } = import(\"vector\");\\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-excess-kurtosis } = import(\"vector\");\\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.centered-moving-excess-kurtosis', 'vector.running-excess-kurtosis'],\n },\n 'centered-moving-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving excess kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-excess-kurtosis } = import(\"vector\");\\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-excess-kurtosis } = import(\"vector\");\\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.moving-excess-kurtosis', 'vector.running-excess-kurtosis'],\n },\n 'running-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running excess kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running excess kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running excess kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-excess-kurtosis } = import(\"vector\");\\nrunning-excess-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.excess-kurtosis', 'vector.moving-excess-kurtosis', 'vector.centered-moving-excess-kurtosis'],\n },\n 'kurtosis': {\n category: 'vector',\n description: 'Calculates the **kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { kurtosis } = import(\"vector\");\\nkurtosis([1, 2, 3, 6, 20])',\n 'let { kurtosis } = import(\"vector\");\\nkurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-kurtosis', 'vector.centered-moving-kurtosis', 'vector.running-kurtosis', 'vector.excess-kurtosis', 'vector.sample-kurtosis', 'vector.skewness'],\n },\n 'moving-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-kurtosis } = import(\"vector\");\\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-kurtosis } = import(\"vector\");\\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.kurtosis', 'vector.centered-moving-kurtosis', 'vector.running-kurtosis'],\n },\n 'centered-moving-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-kurtosis } = import(\"vector\");\\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-kurtosis } = import(\"vector\");\\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)',\n ],\n seeAlso: ['vector.kurtosis', 'vector.moving-kurtosis', 'vector.running-kurtosis'],\n },\n 'running-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-kurtosis } = import(\"vector\");\\nrunning-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.kurtosis', 'vector.moving-kurtosis', 'vector.centered-moving-kurtosis'],\n },\n 'sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **sample excess kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample excess kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-excess-kurtosis } = import(\"vector\");\\nsample-excess-kurtosis([1, 2, 3, 6, 20])',\n 'let { sample-excess-kurtosis } = import(\"vector\");\\nsample-excess-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis', 'vector.sample-kurtosis', 'vector.excess-kurtosis'],\n },\n 'moving-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving sample excess kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-excess-kurtosis } = import(\"vector\");\\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-excess-kurtosis } = import(\"vector\");\\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis'],\n },\n 'centered-moving-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving sample excess kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample excess kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-excess-kurtosis } = import(\"vector\");\\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-excess-kurtosis } = import(\"vector\");\\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.moving-sample-excess-kurtosis', 'vector.running-sample-excess-kurtosis'],\n },\n 'running-sample-excess-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running sample excess kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running sample excess kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample excess kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-excess-kurtosis } = import(\"vector\");\\nrunning-sample-excess-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-excess-kurtosis', 'vector.moving-sample-excess-kurtosis', 'vector.centered-moving-sample-excess-kurtosis'],\n },\n 'sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **sample kurtosis** of a `vector`. Returns the third standardized moment.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **sample kurtosis** of. Minimum length is 3.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sample-kurtosis } = import(\"vector\");\\nsample-kurtosis([1, 2, 3, 6, 20])',\n 'let { sample-kurtosis } = import(\"vector\");\\nsample-kurtosis([1, 2, 2, 3])',\n ],\n seeAlso: ['vector.moving-sample-kurtosis', 'vector.centered-moving-sample-kurtosis', 'vector.running-sample-kurtosis', 'vector.sample-excess-kurtosis', 'vector.kurtosis', 'vector.sample-skewness'],\n },\n 'moving-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **moving sample kurtosis** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving sample kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-sample-kurtosis } = import(\"vector\");\\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-sample-kurtosis } = import(\"vector\");\\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 5)',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.centered-moving-sample-kurtosis', 'vector.running-sample-kurtosis'],\n },\n 'centered-moving-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **centered moving sample kurtosis** of a `vector` with a given window size and padding.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving sample kurtosis** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-sample-kurtosis } = import(\"vector\");\\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-sample-kurtosis } = import(\"vector\");\\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.moving-sample-kurtosis', 'vector.running-sample-kurtosis'],\n },\n 'running-sample-kurtosis': {\n category: 'vector',\n description: 'Calculates the **running sample kurtosis** of a `vector` with a given window size. First two element in result is `null` since **running sample kurtosis** is not defined for less than three elements.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running sample kurtosis** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-sample-kurtosis } = import(\"vector\");\\nrunning-sample-kurtosis([1, 2, 4, 7, 11])',\n ],\n seeAlso: ['vector.sample-kurtosis', 'vector.moving-sample-kurtosis', 'vector.centered-moving-sample-kurtosis'],\n },\n 'rms': {\n category: 'vector',\n description: 'Calculates the **root mean square** of a `vector`. Returns the square root of the average of the squares of the elements.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **root mean square** of. Minimum length is 1.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { rms } = import(\"vector\");\\nrms([1, 2, 3, 4])',\n 'let { rms } = import(\"vector\");\\nrms([5, 4, 3, 2, 1])',\n 'let { rms } = import(\"vector\");\\nrms(range(1, 1000))',\n 'let { rms, generate } = import(\"vector\");\\nrms(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { rms, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\nrms(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.moving-rms', 'vector.centered-moving-rms', 'vector.running-rms', 'vector.mean', 'vector.stdev'],\n },\n 'moving-rms': {\n category: 'vector',\n description: 'Calculates the **moving root mean square** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving root mean square** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 4)',\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 5)',\n 'let { moving-rms } = import(\"vector\");\\nmoving-rms([1, 2, 4, 7, 11, 16], 6)',\n ],\n seeAlso: ['vector.rms', 'vector.centered-moving-rms', 'vector.running-rms'],\n },\n 'centered-moving-rms': {\n category: 'vector',\n description: 'Calculates the **centered moving root mean square** of a `vector` with a given window size and padding value.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving root mean square** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 4)',\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 5, 0)',\n 'let { centered-moving-rms } = import(\"vector\");\\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 6, 0, 0)',\n ],\n seeAlso: ['vector.rms', 'vector.moving-rms', 'vector.running-rms'],\n },\n 'running-rms': {\n category: 'vector',\n description: 'Calculates the **running root mean square** of a `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running root mean square** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([1, 2, 3, 4, 5, 6])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([1, -3, 2])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([-1, -2, -3])',\n 'let { running-rms } = import(\"vector\");\\nrunning-rms([0])',\n ],\n seeAlso: ['vector.rms', 'vector.moving-rms', 'vector.centered-moving-rms'],\n },\n 'mad': {\n category: 'vector',\n description: 'Returns the **mean absolute deviation** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **mean absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { mad } = import(\"vector\");\\nmad([1, 2, 3])',\n 'let { mad } = import(\"vector\");\\nmad([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-mad', 'vector.centered-moving-mad', 'vector.running-mad', 'vector.medad', 'vector.stdev', 'vector.variance', 'vector.iqr'],\n },\n 'moving-mad': {\n category: 'vector',\n description: 'Returns the **moving mean absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving mean absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-mad } = import(\"vector\");\\nmoving-mad([1, 2, 3, 4, 5], 3)',\n 'let { moving-mad } = import(\"vector\");\\nmoving-mad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.mad', 'vector.centered-moving-mad', 'vector.running-mad'],\n },\n 'centered-moving-mad': {\n category: 'vector',\n description: 'Returns the **centered moving mean absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving mean absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-mad } = import(\"vector\");\\ncentered-moving-mad([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-mad } = import(\"vector\");\\ncentered-moving-mad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.mad', 'vector.moving-mad', 'vector.running-mad'],\n },\n 'running-mad': {\n category: 'vector',\n description: 'Returns the **running mean absolute deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running mean absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-mad } = import(\"vector\");\\nrunning-mad([1, 2, 3])',\n 'let { running-mad } = import(\"vector\");\\nrunning-mad([1, 2, -3])',\n ],\n seeAlso: ['vector.mad', 'vector.moving-mad', 'vector.centered-moving-mad'],\n },\n 'medad': {\n category: 'vector',\n description: 'Returns the **median absolute deviation** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **median absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { medad } = import(\"vector\");\\nmedad([1, 2, 3])',\n 'let { medad } = import(\"vector\");\\nmedad([1, 2, -3])',\n ],\n seeAlso: ['vector.moving-medad', 'vector.centered-moving-medad', 'vector.running-medad', 'vector.mad', 'vector.median', 'vector.iqr'],\n },\n 'moving-medad': {\n category: 'vector',\n description: 'Returns the **moving median absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving median absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-medad } = import(\"vector\");\\nmoving-medad([1, 2, 3, 4, 5], 3)',\n 'let { moving-medad } = import(\"vector\");\\nmoving-medad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.medad', 'vector.centered-moving-medad', 'vector.running-medad'],\n },\n 'centered-moving-medad': {\n category: 'vector',\n description: 'Returns the **centered moving median absolute deviation** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving median absolute deviation** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-medad } = import(\"vector\");\\ncentered-moving-medad([1, 2, 3, 4, 5], 3)',\n 'let { centered-moving-medad } = import(\"vector\");\\ncentered-moving-medad([1, 2, 3, 4, 5], 5)',\n ],\n seeAlso: ['vector.medad', 'vector.moving-medad', 'vector.running-medad'],\n },\n 'running-medad': {\n category: 'vector',\n description: 'Returns the **running median absolute deviation** of the `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running median absolute deviation** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-medad } = import(\"vector\");\\nrunning-medad([1, 2, 3])',\n 'let { running-medad } = import(\"vector\");\\nrunning-medad([1, 2, -3])',\n ],\n seeAlso: ['vector.medad', 'vector.moving-medad', 'vector.centered-moving-medad'],\n },\n 'gini-coefficient': {\n category: 'vector',\n description: 'Returns the **gini coefficient** of all elements in the `vector`.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **gini coefficient** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { gini-coefficient } = import(\"vector\");\\ngini-coefficient([1, 2, 3])',\n 'let { gini-coefficient } = import(\"vector\");\\ngini-coefficient([1, 1, 3])',\n ],\n seeAlso: ['vector.moving-gini-coefficient', 'vector.centered-moving-gini-coefficient', 'vector.running-gini-coefficient', 'vector.entropy'],\n },\n 'moving-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **moving gini coefficient** of the `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving gini coefficient** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-gini-coefficient } = import(\"vector\");\\nmoving-gini-coefficient([1, 2, 3], 2)',\n 'let { moving-gini-coefficient } = import(\"vector\");\\nmoving-gini-coefficient([1, 1, 3], 2)',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.centered-moving-gini-coefficient', 'vector.running-gini-coefficient'],\n },\n 'centered-moving-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **centered moving gini coefficient** of the `vector` with a given window size.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving gini coefficient** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-gini-coefficient } = import(\"vector\");\\ncentered-moving-gini-coefficient([1, 2, 3], 2)',\n 'let { centered-moving-gini-coefficient } = import(\"vector\");\\ncentered-moving-gini-coefficient([1, 1, 3], 2)',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.moving-gini-coefficient', 'vector.running-gini-coefficient'],\n },\n 'running-gini-coefficient': {\n category: 'vector',\n description: 'Returns the **running gini coefficient** of the `vector`.',\n returns: {\n type: 'array',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running gini coefficient** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-gini-coefficient } = import(\"vector\");\\nrunning-gini-coefficient([1, 2, 3])',\n 'let { running-gini-coefficient } = import(\"vector\");\\nrunning-gini-coefficient([1, 1, 3])',\n ],\n seeAlso: ['vector.gini-coefficient', 'vector.moving-gini-coefficient', 'vector.centered-moving-gini-coefficient'],\n },\n 'entropy': {\n category: 'vector',\n description: 'Calculates the **entropy** of a `vector`. The entropy is a measure of the uncertainty associated with a random variable.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **entropy** of. Minimum length is 1.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { entropy } = import(\"vector\");\\nentropy([1, 1, 2, 3, 3, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2, 2, 3])',\n 'let { entropy } = import(\"vector\");\\nentropy([0])',\n 'let { entropy } = import(\"vector\");\\nentropy([1])',\n 'let { entropy } = import(\"vector\");\\nentropy([1, 2])',\n ],\n seeAlso: ['vector.moving-entropy', 'vector.centered-moving-entropy', 'vector.running-entropy', 'vector.gini-coefficient'],\n },\n 'moving-entropy': {\n category: 'vector',\n description: 'Calculates the **moving entropy** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **moving entropy** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n ],\n examples: [\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 1, 2, 3, 3, 3], 4)',\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 1, 2, 3, 3, 3], 3)',\n 'let { moving-entropy } = import(\"vector\");\\nmoving-entropy([1, 2], 2)',\n ],\n seeAlso: ['vector.entropy', 'vector.centered-moving-entropy', 'vector.running-entropy'],\n },\n 'centered-moving-entropy': {\n category: 'vector',\n description: 'Calculates the **centered moving entropy** of a `vector` with a given window size.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **centered moving entropy** of.',\n },\n windowSize: {\n type: 'integer',\n description: 'The size of the moving window.',\n },\n leftPadding: {\n type: 'number',\n description: 'Optional value to use for padding. Default is `null`.',\n },\n rightPadding: {\n type: 'number',\n description: 'Optional value to use for right padding. Default is `null`.',\n },\n a: {\n type: 'vector',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'windowSize',\n 'leftPadding',\n 'rightPadding',\n ],\n },\n ],\n examples: [\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 4)',\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 3)',\n 'let { centered-moving-entropy } = import(\"vector\");\\ncentered-moving-entropy([1, 2], 2)',\n ],\n seeAlso: ['vector.entropy', 'vector.moving-entropy', 'vector.running-entropy'],\n },\n 'running-entropy': {\n category: 'vector',\n description: 'Calculates the **running entropy** of a `vector`.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to calculate the **running entropy** of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { running-entropy } = import(\"vector\");\\nrunning-entropy([1, 1, 2, 3, 3, 3])',\n 'let { running-entropy } = import(\"vector\");\\nrunning-entropy([1, 2])',\n ],\n seeAlso: ['vector.entropy', 'vector.moving-entropy', 'vector.centered-moving-entropy'],\n },\n 'monotonic?': {\n category: 'vector',\n description: 'Checks if a vector is monotonic.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1, 2, 3])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1, 2, 2, 3])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1, 1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([3, 2, 1, 2])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([1])',\n 'let { monotonic? } = import(\"vector\");\\nmonotonic?([])',\n ],\n seeAlso: ['vector.strictly-monotonic?', 'vector.increasing?', 'vector.decreasing?'],\n },\n 'strictly-monotonic?': {\n category: 'vector',\n description: 'Checks if a vector is strictly monotonic.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1, 2, 3])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1, 2, 2, 3])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1, 1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([3, 2, 1, 2])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([1])',\n 'let { strictly-monotonic? } = import(\"vector\");\\nstrictly-monotonic?([])',\n ],\n seeAlso: ['vector.monotonic?', 'vector.strictly-increasing?', 'vector.strictly-decreasing?'],\n },\n 'increasing?': {\n category: 'vector',\n description: 'Checks if a vector is increasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1, 2, 3])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1, 2, 2, 3])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1, 1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([3, 2, 1, 2])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([1])',\n 'let { increasing? } = import(\"vector\");\\nincreasing?([])',\n ],\n seeAlso: ['vector.strictly-increasing?', 'vector.decreasing?', 'vector.strictly-decreasing?', 'vector.monotonic?'],\n },\n 'decreasing?': {\n category: 'vector',\n description: 'Checks if a vector is decreasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1, 2, 3])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1, 2, 2, 3])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1, 1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([3, 2, 1, 2])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([1])',\n 'let { decreasing? } = import(\"vector\");\\ndecreasing?([])',\n ],\n seeAlso: ['vector.strictly-decreasing?', 'vector.increasing?', 'vector.strictly-increasing?', 'vector.monotonic?'],\n },\n 'strictly-increasing?': {\n category: 'vector',\n description: 'Checks if a vector is strictly increasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1, 2, 3])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1, 2, 2, 3])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1, 1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([3, 2, 1, 2])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([1])',\n 'let { strictly-increasing? } = import(\"vector\");\\nstrictly-increasing?([])',\n ],\n seeAlso: ['vector.increasing?', 'vector.decreasing?', 'vector.strictly-decreasing?', 'vector.strictly-monotonic?'],\n },\n 'strictly-decreasing?': {\n category: 'vector',\n description: 'Checks if a vector is strictly decreasing.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to check.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1, 2, 3])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1, 2, 2, 3])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1, 1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([3, 2, 1, 2])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([1])',\n 'let { strictly-decreasing? } = import(\"vector\");\\nstrictly-decreasing?([])',\n ],\n seeAlso: ['vector.increasing?', 'vector.strictly-increasing?', 'vector.decreasing?', 'vector.strictly-monotonic?'],\n },\n 'mode': {\n category: 'vector',\n description: 'Returns the mode of all elements in the vector.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the mode of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { mode } = import(\"vector\");\\nmode([1, 2, 3])',\n 'let { mode } = import(\"vector\");\\nmode([1, 2, -3, 1])',\n 'let { mode } = import(\"vector\");\\nmode([2, 2, 3, 3, 4])',\n 'let { mode } = import(\"vector\");\\nmode([2, 2, 3, 3])',\n 'let { mode } = import(\"vector\");\\nmode([1, 2, 3, 2, 1, 2])',\n ],\n seeAlso: ['vector.mean', 'vector.median'],\n },\n 'min-index': {\n category: 'vector',\n description: 'Returns the index of the minimum value of all elements in the vector.',\n returns: {\n type: 'integer',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the minimum index of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, 3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 1, 2, 3, 3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, -3])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, 3, 4])',\n 'let { min-index } = import(\"vector\");\\nmin-index([1, 2, -3, 4])',\n ],\n seeAlso: ['vector.max-index', 'min'],\n },\n 'max-index': {\n category: 'vector',\n description: 'Returns the index of the maximum value of all elements in the vector.',\n returns: {\n type: 'integer',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the maximum index of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, 3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 1, 2, 3, 3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, -3])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, 3, 4])',\n 'let { max-index } = import(\"vector\");\\nmax-index([1, 2, -3, 4])',\n ],\n seeAlso: ['vector.min-index', 'max'],\n },\n 'sort-indices': {\n category: 'vector',\n description: 'Returns the indices of the elements in the vector sorted in ascending order.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Non emtpy vector to calculate the sorted indices of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, 3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 1, 2, 3, 3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, -3])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, 3, 4])',\n 'let { sort-indices } = import(\"vector\");\\nsort-indices([1, 2, -3, 4])',\n ],\n seeAlso: ['sort'],\n },\n 'count-values': {\n category: 'vector',\n description: 'Counts the number of occurrences of each value in the vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'Vector to count the values of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, 3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 1, 2, 3, 3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, -3])',\n 'let { count-values } = import(\"vector\");\\ncount-values([1, 2, 2, 1, 3, 2, 4, 2, 1, 2, 2, 1, 3, 2, 4])',\n ],\n seeAlso: ['sequence.frequencies', 'vector.bincount'],\n },\n 'linspace': {\n category: 'vector',\n description: 'Generates a vector of evenly spaced numbers between two values.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n start: {\n type: 'number',\n description: 'The starting value.',\n },\n stop: {\n type: 'number',\n description: 'The ending value.',\n },\n n: {\n type: 'integer',\n description: 'The number of values to generate.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'start',\n 'stop',\n 'n',\n ],\n },\n ],\n examples: [\n 'let { linspace } = import(\"vector\");\\nlinspace(0, 10, 6)',\n 'let { linspace } = import(\"vector\");\\nlinspace(10, 20, 25)',\n ],\n seeAlso: [\n 'range',\n 'vector.ones',\n 'vector.zeros',\n 'vector.fill',\n 'vector.generate',\n ],\n },\n 'ones': {\n category: 'vector',\n description: 'Generates a vector of ones.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n ],\n },\n ],\n examples: [\n 'let { ones } = import(\"vector\");\\nones(5)',\n 'let { ones } = import(\"vector\");\\nones(10)',\n 'let { ones } = import(\"vector\");\\nones(0)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.zeros',\n 'vector.fill',\n 'vector.generate',\n 'vector.linspace',\n ],\n },\n 'zeros': {\n category: 'vector',\n description: 'Generates a vector of zeros.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n ],\n },\n ],\n examples: [\n 'let { zeros } = import(\"vector\");\\nzeros(5)',\n 'let { zeros } = import(\"vector\");\\nzeros(10)',\n 'let { zeros } = import(\"vector\");\\nzeros(0)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.fill',\n 'vector.generate',\n 'vector.linspace',\n ],\n },\n 'fill': {\n category: 'vector',\n description: 'Generates a vector filled with a number.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n value: {\n type: 'number',\n description: 'The value to fill the vector with.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n 'value',\n ],\n },\n ],\n examples: [\n 'let { fill } = import(\"vector\");\\nfill(5, PI)',\n 'let { fill } = import(\"vector\");\\nfill(10, -1)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.zeros',\n 'vector.generate',\n 'vector.linspace',\n 'grid.fill',\n ],\n },\n 'generate': {\n category: 'vector',\n description: 'Generates a vector of numbers based on a function.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n length: {\n type: 'integer',\n description: 'The length of the vector.',\n },\n func: {\n type: 'function',\n description: 'A function that takes an index and returns a number.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'length',\n 'func',\n ],\n },\n ],\n examples: [\n 'let { generate } = import(\"vector\");\\ngenerate(5, -> $ * 2)',\n 'let { generate } = import(\"vector\");\\ngenerate(10, -> $ + 1)',\n 'let { generate } = import(\"vector\");\\ngenerate(0, -> $ + 1)',\n ],\n seeAlso: [\n 'repeat',\n 'vector.ones',\n 'vector.zeros',\n 'vector.fill',\n 'vector.linspace',\n 'grid.generate',\n ],\n },\n 'cumsum': {\n category: 'vector',\n description: 'Calculates the cumulative sum of a vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the cumulative sum of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { cumsum } = import(\"vector\");\\ncumsum([1, 2, 3])',\n 'let { cumsum } = import(\"vector\");\\ncumsum([1, 2, -3])',\n 'let { cumsum } = import(\"vector\");\\ncumsum([])',\n ],\n seeAlso: ['vector.cumprod', 'vector.sum', 'vector.running-sum'],\n },\n 'cumprod': {\n category: 'vector',\n description: 'Calculates the cumulative product of a vector.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the cumulative product of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { cumprod } = import(\"vector\");\\ncumprod([1, 2, 3])',\n 'let { cumprod } = import(\"vector\");\\ncumprod([1, 2, -3, 0, 10])',\n 'let { cumprod } = import(\"vector\");\\ncumprod([])',\n ],\n seeAlso: ['vector.cumsum', 'vector.prod', 'vector.running-prod'],\n },\n 'quartiles': {\n category: 'vector',\n description: 'Calculates the quartiles of a vector. Returns an array containing the first, second (median), and third quartiles.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to calculate the quartiles of. Minimum length is 4.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { quartiles } = import(\"vector\");\\nquartiles([1, 2, 3, 4])',\n 'let { quartiles } = import(\"vector\");\\nquartiles([5, 4, 3, 2, 1, 2, 3, 4, 5])',\n 'let { quartiles } = import(\"vector\");\\nquartiles(range(1, 1000))',\n 'let { quartiles, generate } = import(\"vector\");\\nquartiles(generate(1000, -> 1e6 / ($ + 1) ^ 2))',\n 'let { quartiles, generate } = import(\"vector\");\\nlet { ln } = import(\"math\");\\nquartiles(generate(1000, -> ln($ + 1)))',\n ],\n seeAlso: ['vector.percentile', 'vector.quantile', 'vector.median', 'vector.iqr'],\n },\n 'percentile': {\n category: 'vector',\n description: 'Calculates the percentile of a vector. Returns the value at the specified percentile.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The non empty vector to calculate the percentile of.',\n },\n percentile: {\n type: 'number',\n description: 'The percentile to calculate. Must be between 0 and 1.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'percentile',\n ],\n },\n ],\n examples: [\n 'let { percentile } = import(\"vector\");\\npercentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 35)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 0)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 10)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 20)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 30)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 40)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 50)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 60)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 70)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 80)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 90)',\n 'let { percentile } = import(\"vector\");\\npercentile(range(100) ^ 0.5, 100)',\n ],\n seeAlso: ['vector.quantile', 'vector.quartiles', 'vector.median', 'vector.ecdf', 'vector.winsorize'],\n },\n 'quantile': {\n category: 'vector',\n description: 'Calculates the quantile of a vector. Returns the value at the specified quantile.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The non empty vector to calculate the quantile of.',\n },\n quantile: {\n type: 'number',\n description: 'The quantile to calculate. Must be between 0 and 1.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'quantile',\n ],\n },\n ],\n examples: [\n 'let { quantile } = import(\"vector\");\\nquantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0.35)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.1)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.2)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.3)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.4)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.5)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.6)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.7)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.8)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 0.9)',\n 'let { quantile } = import(\"vector\");\\nquantile(range(100) ^ 0.5, 1)',\n ],\n seeAlso: ['vector.percentile', 'vector.quartiles', 'vector.ecdf'],\n },\n 'histogram': {\n category: 'vector',\n description: 'Creates a histogram from a numeric `array` by dividing the data range into the specified number of bins. Returns an `array` of `[binStart, binEnd, count]` tuples representing each bin\\'s range and the number of values within it. Handles empty arrays, identical values, and properly places maximum values in the last bin.',\n returns: {\n type: 'array',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The numeric array to create a histogram from.',\n },\n bins: {\n type: 'integer',\n description: 'The number of bins to divide the data range into.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'bins',\n ],\n },\n ],\n examples: [\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9], 3)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 5)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 10)',\n 'let { histogram } = import(\"vector\");\\nhistogram([1, 2, 3, 4, 5], 1)',\n ],\n seeAlso: ['vector.bincount', 'vector.ecdf'],\n },\n 'ecdf': {\n category: 'vector',\n description: 'Calculates the empirical cumulative distribution function value for a given threshold in a non empty dataset. Returns the proportion of values in the `array` that are less than or equal to the specified threshold.',\n returns: {\n type: 'number',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The numeric array to calculate the ECDF from.',\n },\n threshold: {\n type: 'number',\n description: 'The threshold value to calculate the ECDF for.',\n },\n a: {\n type: 'number',\n },\n b: {\n type: 'integer',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'threshold',\n ],\n },\n ],\n examples: [\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9, 10, 12], 5)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 3)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 0)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 10)',\n 'let { ecdf } = import(\"vector\");\\necdf([1, 2, 3, 4, 5], 2)',\n ],\n seeAlso: ['vector.histogram', 'vector.percentile', 'vector.quantile'],\n },\n 'outliers?': {\n category: 'vector',\n description: 'Checks if the `vector` contains outliers based on the interquartile range (IQR) method. Returns `true` if outliers are present, `false` otherwise.',\n returns: {\n type: 'boolean',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to check for outliers.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, 3])',\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, -3])',\n 'let { outliers? } = import(\"vector\");\\noutliers?([1, 2, 3, 2, 4, 120])',\n ],\n seeAlso: ['vector.outliers', 'vector.winsorize', 'vector.iqr'],\n },\n 'outliers': {\n category: 'vector',\n description: 'Identifies outliers in the `vector` based on the interquartile range (IQR) method. Returns an array of outlier values.',\n returns: {\n type: 'number',\n array: true,\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The `vector` to check for outliers.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n ],\n examples: [\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, 3])',\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, -3])',\n 'let { outliers } = import(\"vector\");\\noutliers([1, 2, 3, 2, 4, 120])',\n ],\n seeAlso: ['vector.outliers?', 'vector.winsorize', 'vector.iqr'],\n },\n 'bincount': {\n category: 'vector',\n description: 'counts occurrences of each `integer` in a vector, returning an array where index `i` contains the count of value `i`, with optional **minimum size** and **weights parameters**.',\n returns: {\n type: 'vector',\n },\n args: {\n vector: {\n type: 'vector',\n description: 'The vector to count occurrences in.',\n },\n minSize: {\n type: 'integer',\n description: 'Optional minimum size of the output array.',\n },\n weights: {\n type: 'number',\n array: true,\n description: 'Optional weights for each element in the vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'minSize',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'minSize',\n 'weights',\n ],\n },\n ],\n examples: [\n 'let { bincount } = import(\"vector\");\\nbincount([1, 2, 3])',\n 'let { bincount } = import(\"vector\");\\nbincount([1, 2, 2, 3, 3])',\n ],\n seeAlso: ['vector.count-values', 'vector.histogram'],\n hideOperatorForm: true,\n },\n 'winsorize': {\n category: 'vector',\n description: 'Limits extreme values in a `vector` by replacing values below the **lower quantile** and above the **upper quantile** with the values at those quantiles. The function takes a `vector` of values and **quantile thresholds** (between 0 and 1), with the upper quantile. Winsorization reduces the influence of outliers while preserving the overall distribution shape, making statistical analyses more robust.',\n returns: {\n type: 'vector',\n },\n args: {\n 'vector': {\n type: 'vector',\n description: 'The vector to winsorize.',\n },\n 'lower-quantile': {\n type: 'number',\n description: 'The lower quantile threshold (between 0 and 1).',\n },\n 'upper-quantile': {\n type: 'number',\n description: 'Optional Upper quantile threshold (between 0 and 1). Defaults to `(1 - lower-quantile)` if `lower-quantile <= 0.5` otherwise `1`.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'vector',\n 'lower-quantile',\n ],\n },\n {\n argumentNames: [\n 'vector',\n 'lower-quantile',\n 'upper-quantile',\n ],\n },\n ],\n examples: [\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25)',\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.75)',\n 'let { winsorize } = import(\"vector\");\\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.5)',\n ],\n seeAlso: ['vector.outliers', 'vector.outliers?', 'vector.percentile'],\n hideOperatorForm: true,\n },\n 'mse': {\n category: 'vector',\n description: 'Calculates the **Mean Squared Error (MSE)** between two vectors. Returns the average of the squared differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [1, 2, 3])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [4, 5, 6])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2, 3], [2, 2, 2])',\n 'let { mse } = import(\"vector\");\\nmse([1, 2], [3, 3])',\n 'let { mse } = import(\"vector\");\\nmse([1], [3])',\n ],\n seeAlso: ['vector.rmse', 'vector.mae', 'vector.smape'],\n },\n 'rmse': {\n category: 'vector',\n description: 'Calculates the **Root Mean Squared Error (RMSE)** between two vectors. Returns the square root of the average of the squared differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [1, 2, 3])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [4, 5, 6])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2, 3], [2, 2, 2])',\n 'let { rmse } = import(\"vector\");\\nrmse([1, 2], [3, 3])',\n 'let { rmse } = import(\"vector\");\\nrmse([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.mae', 'vector.smape'],\n },\n 'mae': {\n category: 'vector',\n description: 'Calculates the **Mean Absolute Error (MAE)** between two vectors. Returns the average of the absolute differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [1, 2, 3])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [4, 5, 6])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2, 3], [2, 2, 2])',\n 'let { mae } = import(\"vector\");\\nmae([1, 2], [3, 3])',\n 'let { mae } = import(\"vector\");\\nmae([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.rmse', 'vector.smape'],\n },\n 'smape': {\n category: 'vector',\n description: 'Calculates the **Symmetric Mean Absolute Percentage Error (SMAPE)** between two vectors. Returns the average of the absolute percentage differences between corresponding elements.',\n returns: {\n type: 'number',\n },\n args: {\n a: {\n type: 'vector',\n description: 'The first vector.',\n },\n b: {\n type: 'vector',\n description: 'The second vector.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [1, 2, 3])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [4, 5, 6])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2, 3], [2, 2, 2])',\n 'let { smape } = import(\"vector\");\\nsmape([1, 2], [3, 3])',\n 'let { smape } = import(\"vector\");\\nsmape([1], [3])',\n ],\n seeAlso: ['vector.mse', 'vector.rmse', 'vector.mae'],\n },\n}\n","/**\n * Checks if a vector has no extreme outliers using the IQR method\n * @param vector An array of numbers to check for extreme outliers\n * @returns true if there are no extreme outliers, false otherwise\n */\nexport function hasOutliers(vector: number[]): boolean {\n return outliers(vector).length > 0\n}\n\nexport function outliers(vector: number[]): number[] {\n // Handle edge cases\n if (vector.length <= 1)\n return []\n\n // Sort the vector to calculate quartiles\n const sorted = [...vector].sort((a, b) => a - b)\n\n // Calculate Q1 (25th percentile)\n const q1Index = Math.floor(sorted.length * 0.25)\n const q1 = sorted.length % 4 === 0\n ? (sorted[q1Index - 1]! + sorted[q1Index]!) / 2\n : sorted[q1Index]!\n\n // Calculate Q3 (75th percentile)\n const q3Index = Math.floor(sorted.length * 0.75)\n const q3 = sorted.length % 4 === 0\n ? (sorted[q3Index - 1]! + sorted[q3Index]!) / 2\n : sorted[q3Index]!\n\n // Calculate IQR (Interquartile Range)\n const iqr = q3 - q1\n\n // Define bounds for outliers (using 1.5*IQR for mild outliers and 3*IQR for extreme outliers)\n const lowerBound = q1 - iqr * 1.5\n const upperBound = q3 + iqr * 1.5\n\n // Filter the vector to find outliers\n return vector.filter(val => val < lowerBound || val > upperBound)\n}\n","/**\n * Calculate the percentile value from an array of numbers\n * @param data Array of numbers to calculate percentile from\n * @param percentile The percentile to calculate (0-100)\n * @returns The value at the specified percentile\n */\nexport function calcPercentile(data: number[], percentile: number): number {\n // Sort the data in ascending order\n const sortedData = [...data].sort((a, b) => a - b)\n\n // If percentile is 0, return the minimum value\n if (percentile === 0) {\n return sortedData[0]!\n }\n\n // If percentile is 100, return the maximum value\n if (percentile === 100) {\n return sortedData[sortedData.length - 1]!\n }\n\n // Calculate the index\n const index = (percentile / 100) * (sortedData.length - 1)\n\n // If index is an integer, return the value at that index\n if (Number.isInteger(index)) {\n return sortedData[index]!\n }\n\n // Otherwise, interpolate between the two adjacent values\n const lowerIndex = Math.floor(index)\n const upperIndex = Math.ceil(index)\n const weight = index - lowerIndex\n\n return sortedData[lowerIndex]! * (1 - weight) + sortedData[upperIndex]! * weight\n}\n","export function quartiles(vector: number[]): [number, number, number] {\n const sorted = [...vector].sort((a, b) => a - b)\n\n // Median calculation (Q2)\n const midIndex = sorted.length / 2\n let q2: number\n if (sorted.length % 2 === 0) {\n // Even length - average the two middle values\n q2 = (sorted[midIndex - 1]! + sorted[midIndex]!) / 2\n }\n else {\n // Odd length - take the middle value\n q2 = sorted[Math.floor(midIndex)]!\n }\n\n // Lower half for Q1\n const lowerHalf = sorted.slice(0, Math.floor(sorted.length / 2))\n // Upper half for Q3\n const upperHalf = sorted.slice(Math.ceil(sorted.length / 2))\n\n // Calculate Q1 and Q3 using the same median logic on the halves\n let q1: number, q3: number\n\n if (lowerHalf.length % 2 === 0) {\n const midLower = lowerHalf.length / 2\n q1 = (lowerHalf[midLower - 1]! + lowerHalf[midLower]!) / 2\n }\n else {\n q1 = lowerHalf[Math.floor(lowerHalf.length / 2)]!\n }\n\n if (upperHalf.length % 2 === 0) {\n const midUpper = upperHalf.length / 2\n q3 = (upperHalf[midUpper - 1]! + upperHalf[midUpper]!) / 2\n }\n else {\n q3 = upperHalf[Math.floor(upperHalf.length / 2)]!\n }\n\n return [q1, q2, q3]\n}\n","export function calcMean(vector: number[]): number {\n if (vector.length === 0) {\n return 0\n }\n\n const sum = vector.reduce((acc, val) => acc + val, 0)\n return sum / vector.length\n}\n","import { calcMean } from '../calcMean'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const meanReductionFunction: ReductionFunctionDefinition<'mean'> = {\n mean: vector => calcMean(vector),\n}\n\nexport const geometricMeanReductionFunction: ReductionFunctionDefinition<'geometric-mean'> = {\n 'geometric-mean': (vector) => {\n if (vector.some(val => val < 0)) {\n throw new Error('Geometric mean is not defined for non-positive numbers')\n }\n return Math.exp(vector.reduce((acc, val) => acc + Math.log(val), 0) / vector.length)\n },\n}\n\nexport const harmonicMeanReductionFunction: ReductionFunctionDefinition<'harmonic-mean'> = {\n 'harmonic-mean': vector => vector.length / vector.reduce((acc, val) => acc + 1 / val, 0),\n}\n","export function calcMedian(vector: number[]): number {\n const sorted = [...vector].sort((a, b) => a - b)\n const mid = Math.floor(sorted.length / 2)\n\n return sorted.length % 2 === 0\n ? (sorted[mid - 1]! + sorted[mid]!) / 2\n : sorted[mid]!\n}\n","import { calcMedian } from '../calcMedian'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const medianReductionFunction: ReductionFunctionDefinition<'median'> = {\n median: vector => calcMedian(vector),\n}\n","import { calcMean } from './calcMean'\n\nexport function calcVariance(vector: number[], optionalMean?: number): number {\n const mean = optionalMean ?? calcMean(vector)\n return vector.reduce((acc, val) => acc + (val - mean) ** 2, 0) / vector.length\n}\n\nexport function calcSampleVariance(vector: number[], optionalMean?: number): number {\n const mean = optionalMean ?? calcMean(vector)\n return vector.reduce((acc, val) => acc + (val - mean) ** 2, 0) / (vector.length - 1)\n}\n","import { calcSampleVariance, calcVariance } from '../calcVariance'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const varianceReductionFunction: ReductionFunctionDefinition<'variance'> = {\n variance: vector => calcVariance(vector),\n}\n\nexport const sampleVarianceReductionFunction: ReductionFunctionDefinition<'sample-variance'> = {\n 'sample-variance': vector => calcSampleVariance(vector),\n 'minLength': 2,\n}\n","import { calcVariance } from './calcVariance'\n\nexport function calcStdDev(vector: number[], optionalMean?: number): number {\n const variance = calcVariance(vector, optionalMean)\n return Math.sqrt(variance)\n}\n\nexport function calcSampleStdDev(vector: number[], optionalMean?: number): number {\n const variance = calcVariance(vector, optionalMean)\n return Math.sqrt(variance * (vector.length / (vector.length - 1)))\n}\n","import { calcSampleStdDev, calcStdDev } from '../calcStdDev'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const stdevReductionFunction: ReductionFunctionDefinition<'stdev'> = {\n stdev: vector => calcStdDev(vector),\n}\n\nexport const sampleStdevReductionFunction: ReductionFunctionDefinition<'sample-stdev'> = {\n 'sample-stdev': vector => calcSampleStdDev(vector),\n 'minLength': 2,\n}\n","import { quartiles } from '../quartiles'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const iqrReductionFunction: ReductionFunctionDefinition<'iqr'> = {\n iqr: (vector) => {\n const [q1, , q3] = quartiles(vector)\n return q3 - q1\n },\n minLength: 4,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const spanReductionFunction: ReductionFunctionDefinition<'span'> = {\n span: vector => vector.length === 0 ? 0 : Math.max(...vector) - Math.min(...vector),\n minLength: 0,\n}\n","import { calcMean } from '../calcMean'\nimport { calcStdDev } from '../calcStdDev'\nimport type { ReductionFunctionDefinition } from '.'\n\nfunction skewness(vector: number[]): number {\n const mean = calcMean(vector)\n const stdDev = calcStdDev(vector)\n if (stdDev === 0) {\n throw new Error('Standard deviation is zero, skewness is undefined')\n }\n return vector.reduce((acc, val) => acc + ((val - mean) ** 3), 0) / (vector.length * stdDev ** 3)\n}\n\nfunction sampleSkewness(vector: number[]): number {\n const n = vector.length\n\n // Calculate the mean\n const mean = vector.reduce((acc, val) => acc + val, 0) / n\n\n // Calculate sum of squared differences and sum of cubed differences\n let sumSquaredDiffs = 0\n let sumCubedDiffs = 0\n\n for (const val of vector) {\n const diff = val - mean\n sumSquaredDiffs += diff * diff\n sumCubedDiffs += diff * diff * diff\n }\n\n // Calculate sample standard deviation (using n-1)\n const sampleVariance = sumSquaredDiffs / (n - 1)\n const sampleStdDev = Math.sqrt(sampleVariance)\n\n // If standard deviation is 0, skewness is undefined\n if (sampleStdDev === 0) {\n throw new Error('Cannot calculate sample skewness when standard deviation is 0')\n }\n\n // Calculate sample skewness with Fisher's adjustment\n return (n / ((n - 1) * (n - 2))) * sumCubedDiffs / sampleStdDev ** 3\n}\n\nexport const skewnessReductionFunction: ReductionFunctionDefinition<'skewness'> = {\n skewness: vector => skewness(vector),\n minLength: 3,\n}\n\nexport const sampleSkewnessReductionFunction: ReductionFunctionDefinition<'sample-skewness'> = {\n 'sample-skewness': vector => sampleSkewness(vector),\n 'minLength': 3,\n}\n","import { calcMean } from '../calcMean'\nimport { calcStdDev } from '../calcStdDev'\n\nimport type { ReductionFunctionDefinition } from '.'\n\nfunction kurtosis(vector: number[]): number {\n const mean = calcMean(vector)\n const stdDev = calcStdDev(vector)\n if (stdDev === 0) {\n throw new Error('Standard deviation is zero, kurtosis is undefined')\n }\n return vector.reduce((acc, val) => acc + ((val - mean) ** 4), 0) / (vector.length * stdDev ** 4)\n}\n\nfunction excessKurtosis(vector: number[]): number {\n return kurtosis(vector) - 3\n}\n\n/**\n * Calculates the sample kurtosis (bias-corrected)\n * @param vector Array of numeric values\n * @returns The sample kurtosis\n * @throws Error if sample size is less than 4 or if variance is zero\n */\nfunction sampleKurtosis(vector: number[]): number {\n const n = vector.length\n\n const mean = vector.reduce((sum, val) => sum + val, 0) / n\n const sumSquaredDeviations = vector.reduce((sum, val) => sum + (val - mean) ** 2, 0)\n const variance = sumSquaredDeviations / (n - 1)\n\n if (variance === 0) {\n throw new Error('Variance is zero, kurtosis is undefined')\n }\n\n const fourthMomentSum = vector.reduce((sum, val) => sum + (val - mean) ** 4, 0)\n\n // Correct formula for sample kurtosis\n return (n * (n + 1) * fourthMomentSum) / ((n - 1) * (n - 2) * (n - 3) * variance ** 2)\n}\n/**\n * Calculates the sample excess kurtosis (bias-corrected)\n * @param vector Array of numeric values\n * @returns The sample excess kurtosis\n * @throws Error if sample size is less than 4 or if variance is zero\n */\nfunction sampleExcessKurtosis(vector: number[]): number {\n const n = vector.length\n\n const mean = vector.reduce((sum, val) => sum + val, 0) / n\n const sumSquaredDeviations = vector.reduce((sum, val) => sum + (val - mean) ** 2, 0)\n const variance = sumSquaredDeviations / (n - 1)\n\n if (variance === 0) {\n throw new Error('Variance is zero, kurtosis is undefined')\n }\n\n const fourthMomentSum = vector.reduce((sum, val) => sum + (val - mean) ** 4, 0)\n const rawKurtosis = (n * (n + 1) * fourthMomentSum) / ((n - 1) * (n - 2) * (n - 3) * variance ** 2)\n\n // Compute excess kurtosis by subtracting 3 times the bias correction factor\n return rawKurtosis - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\nexport const kurtosisReductionFunction: ReductionFunctionDefinition<'kurtosis'> = {\n kurtosis: vector => kurtosis(vector),\n minLength: 4,\n}\n\nexport const eccessKurtosisReductionFunction: ReductionFunctionDefinition<'excess-kurtosis'> = {\n 'excess-kurtosis': vector => excessKurtosis(vector),\n 'minLength': 4,\n}\n\nexport const sampleKurtosisReductionFunction: ReductionFunctionDefinition<'sample-kurtosis'> = {\n 'sample-kurtosis': vector => sampleKurtosis(vector),\n 'minLength': 4,\n}\n\nexport const sampleExcessKurtosisReductionFunction: ReductionFunctionDefinition<'sample-excess-kurtosis'> = {\n 'sample-excess-kurtosis': vector => sampleExcessKurtosis(vector),\n 'minLength': 4,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const rmsReductionFunction: ReductionFunctionDefinition<'rms'> = {\n rms: vector => Math.sqrt(vector.reduce((acc, val) => acc + val ** 2, 0) / vector.length),\n}\n","import { calcMad } from '../calcMad'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const madReductionFunction: ReductionFunctionDefinition<'mad'> = {\n mad: vector => calcMad(vector),\n}\n","import { calcMedian } from './calcMedian'\n\nexport function calcMad(vector: number[]): number {\n const median = calcMedian(vector)\n\n // Calculate mean absolute deviation\n return vector.reduce((acc, val) => acc + Math.abs(val - median), 0) / vector.length\n}\n","import { calcMedad } from '../calcMedad'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const medadReductionFunction: ReductionFunctionDefinition<'medad'> = {\n medad: vector => calcMedad(vector),\n}\n","import { calcMedian } from './calcMedian'\n\nexport function calcMedad(vector: number[]): number {\n const median = calcMedian(vector)\n // Calculate absolute deviations from the median\n const absoluteDeviations = vector.map(val => Math.abs(val - median))\n\n // Calculate the median of the absolute deviations\n const medianOfDeviations = calcMedian(absoluteDeviations)\n const scaleFactor = 1.4826 // Scale factor for robust scaling\n\n return medianOfDeviations * scaleFactor\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const giniCoefficientReductionFunction: ReductionFunctionDefinition<'gini-coefficient'> = {\n 'gini-coefficient': (vector) => {\n if (vector.some(x => x < 0)) {\n throw new Error('Gini coefficient is not defined for negative values')\n }\n const sorted = [...vector].sort((a, b) => a - b)\n const n = sorted.length\n const sum = sorted.reduce((acc, val) => acc + val, 0)\n if (sum === 0) {\n return 0\n }\n const gini = (2 * sorted.reduce((acc, val, i) => acc + (i + 1) * val, 0)) / (n * sum) - (n + 1) / n\n return gini\n },\n 'minLength': 1,\n}\n","import { calculateEntropy } from '../entropy'\nimport type { ReductionFunctionDefinition } from '.'\n\nexport const entropyReductionFunction: ReductionFunctionDefinition<'entropy'> = {\n entropy: vector => calculateEntropy(vector),\n minLength: 1,\n}\n","/**\n * Calculates the Shannon entropy of a vector.\n * Entropy measures the amount of uncertainty or randomness in the data.\n *\n * @param vector - An array of values to calculate entropy for\n * @returns The entropy value (in bits) or 0 for empty arrays\n */\nexport function calculateEntropy<T>(vector: T[]): number {\n // Count occurrences of each value\n const frequencies = new Map<T, number>()\n for (const value of vector) {\n frequencies.set(value, (frequencies.get(value) || 0) + 1)\n }\n\n // Get the total number of elements\n const total = vector.length\n\n // Calculate entropy using Shannon's formula\n let entropy = 0\n for (const frequency of frequencies.values()) {\n const probability = frequency / total\n // Skip cases where probability is 0 (log(0) is undefined)\n if (probability > 0) {\n entropy -= probability * Math.log2(probability)\n }\n }\n\n return entropy\n}\n","import { LitsError } from '../../../../errors'\nimport { assertVector } from '../../../../typeGuards/annotatedArrays'\nimport { assertNumber } from '../../../../typeGuards/number'\nimport type { BuiltinNormalExpression, BuiltinNormalExpressions } from '../../../../builtin/interface'\nimport { toFixedArity } from '../../../../utils/arity'\nimport { geometricMeanReductionFunction, harmonicMeanReductionFunction, meanReductionFunction } from './mean'\nimport { medianReductionFunction } from './median'\nimport { prodReductionFunction } from './prod'\nimport { sumReductionFunction } from './sum'\nimport { sampleVarianceReductionFunction, varianceReductionFunction } from './variance'\nimport { sampleStdevReductionFunction, stdevReductionFunction } from './standardDeviation'\nimport { iqrReductionFunction } from './iqr'\nimport { spanReductionFunction } from './span'\nimport { sampleSkewnessReductionFunction, skewnessReductionFunction } from './skewness'\nimport { eccessKurtosisReductionFunction, kurtosisReductionFunction, sampleExcessKurtosisReductionFunction, sampleKurtosisReductionFunction } from './kurtosis'\nimport { rmsReductionFunction } from './rms'\nimport { madReductionFunction } from './mad'\nimport { medadReductionFunction } from './medad'\nimport { giniCoefficientReductionFunction } from './giniCoefficient'\nimport { entropyReductionFunction } from './entropy'\n\ntype VectorReductionKey<T extends string> = `${T}`\ntype VectorMovingWindowKey<T extends string> = `moving-${T}`\ntype VectorCenteredMovingWindowKey<T extends string> = `centered-moving-${T}`\ntype VectorRunningKey<T extends string> = `running-${T}`\n\nexport type VectorReductionKeys<T extends string> = VectorReductionKey<T> | VectorMovingWindowKey<T> | VectorCenteredMovingWindowKey<T> | VectorRunningKey<T>\n\ntype ReductionFunction = (vector: number[]) => number\n// type MovingWindowFunction = (vector: number[], windowSize: number, sourceCodeInfo: SourceCodeInfo | undefined) => number[]\n\nexport type ReductionFunctionDefinition<T extends string> = Record<VectorReductionKey<T>, ReductionFunction> & {\n minLength?: number\n padding?: number\n}\n\nexport const reductionFunctionNormalExpressions: BuiltinNormalExpressions = {}\n\naddReductionFunctions(meanReductionFunction)\naddReductionFunctions(geometricMeanReductionFunction)\naddReductionFunctions(harmonicMeanReductionFunction)\naddReductionFunctions(medianReductionFunction)\naddReductionFunctions(sumReductionFunction)\naddReductionFunctions(prodReductionFunction)\naddReductionFunctions(varianceReductionFunction)\naddReductionFunctions(sampleVarianceReductionFunction)\naddReductionFunctions(stdevReductionFunction)\naddReductionFunctions(sampleStdevReductionFunction)\naddReductionFunctions(iqrReductionFunction)\naddReductionFunctions(spanReductionFunction)\naddReductionFunctions(skewnessReductionFunction)\naddReductionFunctions(sampleSkewnessReductionFunction)\naddReductionFunctions(eccessKurtosisReductionFunction)\naddReductionFunctions(kurtosisReductionFunction)\naddReductionFunctions(sampleExcessKurtosisReductionFunction)\naddReductionFunctions(sampleKurtosisReductionFunction)\naddReductionFunctions(rmsReductionFunction)\naddReductionFunctions(madReductionFunction)\naddReductionFunctions(medadReductionFunction)\naddReductionFunctions(giniCoefficientReductionFunction)\naddReductionFunctions(entropyReductionFunction)\n\nfunction addReductionFunctions<T extends string>(fns: ReductionFunctionDefinition<T>) {\n for (const [key, value] of Object.entries(fns)) {\n /* v8 ignore next 3 */\n if (reductionFunctionNormalExpressions[key]) {\n throw new Error(`Duplicate normal expression key found: ${key}`)\n }\n if (key !== 'minLength' && key !== 'padding' && typeof value === 'function') {\n const reductionFn = value as ReductionFunction\n const baseKey = key.replace(/^/, '')\n const movingKey = `moving-${baseKey}` as VectorMovingWindowKey<T>\n const centeredMovingKey = `centered-moving-${baseKey}` as VectorCenteredMovingWindowKey<T>\n const runningKey = `running-${baseKey}` as VectorRunningKey<T>\n const minLength = fns.minLength ?? 1\n assertNumber(minLength, undefined, { integer: true, finite: true, gte: 0 })\n reductionFunctionNormalExpressions[key] = createReductionNormalExpression(reductionFn, minLength)\n reductionFunctionNormalExpressions[movingKey] = createMovingNormalExpression(reductionFn, minLength)\n reductionFunctionNormalExpressions[centeredMovingKey] = createCenteredMovingNormalExpression(reductionFn, minLength, fns.padding ?? null)\n reductionFunctionNormalExpressions[runningKey] = createRunningNormalExpression(reductionFn, minLength)\n }\n }\n}\n\nfunction createReductionNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<number> {\n return {\n evaluate: ([vector], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n try {\n return reductionFunction(vector)\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(1),\n }\n}\n\nfunction createMovingNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<number[]> {\n return {\n evaluate: ([vector, windowSize], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(windowSize, sourceCodeInfo, { integer: true, finite: true, gte: minLength, lte: vector.length })\n if (vector.length === 0) {\n return []\n }\n try {\n if (windowSize >= vector.length) {\n return [reductionFunction(vector)]\n }\n const result = []\n for (let i = 0; i < vector.length - windowSize + 1; i += 1) {\n result.push(reductionFunction(vector.slice(i, i + windowSize)))\n }\n return result\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(2),\n }\n}\n\nfunction createCenteredMovingNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n padding: number | null,\n): BuiltinNormalExpression<(number | null)[]> {\n return {\n evaluate: ([vector, windowSize, leftPadding, rightPadding], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n assertNumber(windowSize, sourceCodeInfo, { integer: true, finite: true, gte: minLength, lte: vector.length })\n leftPadding = leftPadding ?? padding\n if (leftPadding !== null) {\n assertNumber(leftPadding, sourceCodeInfo, { finite: true })\n }\n rightPadding = rightPadding ?? padding\n if (rightPadding !== null) {\n assertNumber(rightPadding, sourceCodeInfo, { finite: true })\n }\n\n if (vector.length === 0) {\n return []\n }\n\n const halfWindowSize = Math.floor(windowSize / 2)\n const paddedVector = [\n ...Array<number | null>(halfWindowSize).fill(leftPadding),\n ...vector,\n ...Array<number | null>(halfWindowSize).fill(rightPadding),\n ]\n\n const start = typeof leftPadding === 'number' ? 0 : halfWindowSize\n const end = vector.length - (typeof rightPadding === 'number' ? 0 : (windowSize - halfWindowSize - 1))\n\n const result: (number | null)[] = [\n ...Array<null>(start).fill(null),\n ]\n\n try {\n for (let i = start; i < end; i += 1) {\n result.push(reductionFunction(paddedVector.slice(i, i + windowSize) as number[]))\n }\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n\n result.push(...Array<null>(vector.length - end).fill(null))\n return result\n },\n arity: { min: 2, max: 4 },\n }\n}\n\nfunction createRunningNormalExpression(\n reductionFunction: ReductionFunction,\n minLength: number,\n): BuiltinNormalExpression<(number | null)[]> {\n return {\n evaluate: ([vector], sourceCodeInfo) => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < minLength) {\n throw new LitsError(`Vector length must be at least ${minLength}`, sourceCodeInfo)\n }\n\n if (vector.length === 0) {\n return []\n }\n\n try {\n const nullsCount = Math.max(minLength - 1, 0)\n const result: (number | null)[] = Array<null>(nullsCount).fill(null)\n\n for (let i = nullsCount; i < vector.length; i += 1) {\n result.push(reductionFunction(vector.slice(0, i + 1)))\n }\n return result\n }\n catch (error) {\n throw new LitsError(error, sourceCodeInfo)\n }\n },\n arity: toFixedArity(1),\n }\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const sumReductionFunction: ReductionFunctionDefinition<'sum'> = {\n sum: vector => vector.reduce((acc, val) => acc + val, 0),\n minLength: 0,\n}\n","import type { ReductionFunctionDefinition } from '.'\n\nexport const prodReductionFunction: ReductionFunctionDefinition<'prod'> = {\n prod: vector => vector.reduce((acc, val) => acc * val, 1),\n padding: 1,\n minLength: 0,\n}\n","import { LitsError } from '../../../errors'\nimport { assertNonEmptyVector, assertVector } from '../../../typeGuards/annotatedArrays'\nimport { assertFunctionLike } from '../../../typeGuards/lits'\nimport { assertNumber } from '../../../typeGuards/number'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { MaybePromise } from '../../../utils/maybePromise'\nimport { chain, mapSequential } from '../../../utils/maybePromise'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport type { LitsModule } from '../interface'\nimport { moduleDocs } from './docs'\nimport { bincount } from './bincount'\nimport { calcHistogram } from './histogram'\nimport { mode } from './mode'\nimport { hasOutliers, outliers } from './outliers'\nimport { calcPercentile } from './percentile'\nimport { quartiles } from './quartiles'\nimport { reductionFunctionNormalExpressions } from './reductionFunctions'\n\nconst vectorFunctions: BuiltinNormalExpressions = {\n 'monotonic?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val >= vector[i - 1]!)\n || vector.every((val, i) => i === 0 || val <= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-monotonic?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val > vector[i - 1]!)\n || vector.every((val, i) => i === 0 || val < vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'increasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val >= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'decreasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val <= vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-increasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val > vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'strictly-decreasing?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return vector.every((val, i) => i === 0 || val < vector[i - 1]!)\n },\n arity: toFixedArity(1),\n },\n 'mode': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n return mode(vector)\n },\n arity: toFixedArity(1),\n },\n 'min-index': {\n evaluate: ([vector], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val, i) => (val < vector[acc]! ? i : acc), 0)\n },\n arity: toFixedArity(1),\n },\n 'max-index': {\n evaluate: ([vector], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val, i) => (val > vector[acc]! ? i : acc), 0)\n },\n arity: toFixedArity(1),\n },\n 'sort-indices': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return [...vector.keys()].sort((a, b) => vector[a]! - vector[b]!)\n },\n arity: toFixedArity(1),\n },\n 'count-values': {\n evaluate: ([vector], sourceCodeInfo): [number, number][] => {\n assertVector(vector, sourceCodeInfo)\n\n const frequencyMap = new Map<number, number>()\n for (const value of vector) {\n frequencyMap.set(value, (frequencyMap.get(value) || 0) + 1)\n }\n return [...frequencyMap.entries()].sort((a, b) => {\n // First compare by count (descending)\n const countDiff = b[1] - a[1]\n if (countDiff !== 0)\n return countDiff\n // If counts are equal, sort by value (ascending)\n return a[0] - b[0]\n })\n },\n arity: toFixedArity(1),\n },\n 'linspace': {\n evaluate: ([start, end, numPoints], sourceCodeInfo): number[] => {\n assertNumber(start, sourceCodeInfo, { finite: true })\n assertNumber(end, sourceCodeInfo, { finite: true })\n assertNumber(numPoints, sourceCodeInfo, { integer: true, nonNegative: true })\n\n if (numPoints === 0) {\n return []\n }\n if (numPoints === 1) {\n return [start]\n }\n const step = (end - start) / (numPoints - 1)\n return Array.from({ length: numPoints }, (_, i) => start + i * step)\n },\n arity: toFixedArity(3),\n },\n 'ones': {\n evaluate: ([length], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => 1)\n },\n arity: toFixedArity(1),\n },\n 'zeros': {\n evaluate: ([length], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => 0)\n },\n arity: toFixedArity(1),\n },\n 'fill': {\n evaluate: ([length, value], sourceCodeInfo): number[] => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n return Array.from({ length }, () => value) as number[]\n },\n arity: toFixedArity(2),\n },\n 'generate': {\n evaluate: ([length, generator], sourceCodeInfo, contextStack, { executeFunction }): MaybePromise<number[]> => {\n assertNumber(length, sourceCodeInfo, { integer: true, nonNegative: true })\n assertFunctionLike(generator, sourceCodeInfo)\n\n return mapSequential(Array.from({ length }), (_, i) => {\n return chain(\n executeFunction(generator, [i], contextStack, sourceCodeInfo),\n (value) => {\n assertNumber(value, sourceCodeInfo, { finite: true })\n return value\n },\n )\n })\n },\n arity: toFixedArity(2),\n },\n 'cumsum': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val) => {\n const last = acc[acc.length - 1] ?? 0\n acc.push(last + val)\n return acc\n }, [] as number[])\n },\n arity: toFixedArity(1),\n },\n 'cumprod': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n\n return vector.reduce((acc, val) => {\n const last = acc[acc.length - 1] ?? 1\n acc.push(last * val)\n return acc\n }, [] as number[])\n },\n arity: toFixedArity(1),\n },\n 'quartiles': {\n evaluate: ([vector], sourceCodeInfo): [number, number, number] => {\n assertVector(vector, sourceCodeInfo)\n if (vector.length < 4) {\n throw new LitsError('Quartiles require at least four values', sourceCodeInfo)\n }\n return quartiles(vector)\n },\n arity: toFixedArity(1),\n },\n 'percentile': {\n evaluate: ([vector, percentile], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n assertNumber(percentile, sourceCodeInfo, { finite: true, nonNegative: true, lte: 100 })\n return calcPercentile(vector, percentile)\n },\n arity: toFixedArity(2),\n },\n 'quantile': {\n evaluate: ([vector, quantile], sourceCodeInfo): number => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(quantile, sourceCodeInfo, { finite: true, nonNegative: true, lte: 1 })\n return calcPercentile(vector, quantile * 100)\n },\n arity: toFixedArity(2),\n },\n 'histogram': {\n evaluate: ([vector, bins], sourceCodeInfo): [number, number, number][] => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(bins, sourceCodeInfo, { integer: true, positive: true })\n\n return calcHistogram(vector, bins)\n },\n arity: toFixedArity(2),\n },\n 'ecdf': {\n evaluate: ([vector, value], sourceCodeInfo): number => {\n assertNonEmptyVector(vector, sourceCodeInfo)\n assertNumber(value, sourceCodeInfo, { finite: true })\n\n const sorted = [...vector].sort((a, b) => a - b)\n const index = sorted.findIndex(val => val > value)\n\n return index === -1 ? 1 : index / sorted.length\n },\n arity: toFixedArity(2),\n },\n 'outliers?': {\n evaluate: ([vector], sourceCodeInfo): boolean => {\n assertVector(vector, sourceCodeInfo)\n return hasOutliers(vector)\n },\n arity: toFixedArity(1),\n },\n 'outliers': {\n evaluate: ([vector], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n return outliers(vector)\n },\n arity: toFixedArity(1),\n },\n 'bincount': {\n evaluate: (params, sourceCodeInfo): number[] => {\n const vector = params[0]\n assertVector(vector, sourceCodeInfo)\n vector.forEach(val => assertNumber(val, sourceCodeInfo, { finite: true, integer: true, nonNegative: true }))\n\n const minSize = params[1] ?? 0\n assertNumber(minSize, sourceCodeInfo, { integer: true, nonNegative: true })\n\n const weights = params[2] ?? undefined\n if (weights !== undefined) {\n assertVector(weights, sourceCodeInfo)\n if (weights.length !== vector.length) {\n throw new LitsError('Weights vector must be the same length as the input vector', sourceCodeInfo)\n }\n weights.forEach(val => assertNumber(val, sourceCodeInfo, { finite: true }))\n }\n\n return bincount(vector, minSize, weights)\n },\n arity: { min: 1, max: 3 },\n },\n 'winsorize': {\n evaluate: ([vector, lowerQuantile, upperQuantile], sourceCodeInfo): number[] => {\n assertVector(vector, sourceCodeInfo)\n assertNumber(lowerQuantile, sourceCodeInfo, { finite: true, gte: 0, lte: 1 })\n upperQuantile ??= lowerQuantile > 0.5 ? 1 : (1 - lowerQuantile)\n assertNumber(upperQuantile, sourceCodeInfo, { finite: true, gte: lowerQuantile, lte: 1 })\n\n if (vector.length === 0)\n return []\n\n const sorted = [...vector].sort((a, b) => a - b)\n\n const lowerIndex = Math.max(0, Math.floor(lowerQuantile * vector.length))\n const upperIndex = Math.min(vector.length - 1, Math.max(0, Math.floor(upperQuantile * vector.length) - 1))\n\n const lowerBound = sorted[lowerIndex]!\n const upperBound = sorted[upperIndex]!\n\n return vector.map(val => Math.max(lowerBound, Math.min(val, upperBound)))\n },\n arity: { min: 2, max: 3 },\n },\n 'mse': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => acc + (val - vectorB[i]!) ** 2, 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n 'rmse': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return Math.sqrt(vectorA.reduce((acc, val, i) => acc + (val - vectorB[i]!) ** 2, 0) / vectorA.length)\n },\n arity: toFixedArity(2),\n },\n 'mae': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => acc + Math.abs(val - vectorB[i]!), 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n 'smape': {\n evaluate: ([vectorA, vectorB], sourceCodeInfo): number => {\n assertNonEmptyVector(vectorA, sourceCodeInfo)\n assertNonEmptyVector(vectorB, sourceCodeInfo)\n if (vectorA.length !== vectorB.length) {\n throw new LitsError('Vectors must be of the same length', sourceCodeInfo)\n }\n return vectorA.reduce((acc, val, i) => {\n const diff = Math.abs(val - vectorB[i]!)\n const denom = (Math.abs(val) + Math.abs(vectorB[i]!)) / 2\n return acc + (denom === 0 ? 0 : diff / denom)\n }, 0) / vectorA.length\n },\n arity: toFixedArity(2),\n },\n\n}\n\naddReductionFunctions(reductionFunctionNormalExpressions)\n\nfunction addReductionFunctions(sequences: BuiltinNormalExpressions) {\n for (const [key, value] of Object.entries(sequences)) {\n /* v8 ignore next 3 */\n if (vectorFunctions[key]) {\n throw new Error(`Duplicate normal expression key found: ${key}`)\n }\n vectorFunctions[key] = value\n }\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (vectorFunctions[key])\n vectorFunctions[key].docs = docs\n}\n\nexport const vectorModule: LitsModule = {\n name: 'vector',\n functions: vectorFunctions,\n}\n","/**\n * Calculates the mode (most frequent value(s)) of a dataset\n * @param values An array of values of any type\n * @returns An array containing the mode(s) of the dataset\n */\nexport function mode(values: number[]): number[] {\n // Create a frequency map\n const frequencyMap = new Map<number, number>()\n\n // Count occurrences of each value\n for (const value of values) {\n frequencyMap.set(value, (frequencyMap.get(value) || 0) + 1)\n }\n\n // Find the maximum frequency\n let maxFrequency = 0\n for (const frequency of frequencyMap.values()) {\n if (frequency > maxFrequency) {\n maxFrequency = frequency\n }\n }\n\n // If all values appear only once, there is no mode\n if (maxFrequency === 1) {\n return values\n }\n\n // Collect all values that appear with the maximum frequency\n const modes: number[] = []\n for (const [value, frequency] of frequencyMap.entries()) {\n if (frequency === maxFrequency) {\n modes.push(value)\n }\n }\n\n return modes\n}\n","/**\n * Creates a histogram from an array of numbers, returning bin ranges and counts.\n * Each bin is represented as a tuple of [minValue, maxValue, count].\n *\n * @param vector - Array of numeric values\n * @param bins - Number of bins to divide the data into\n * @returns Array of tuples, each containing [binStart, binEnd, count]\n */\nexport function calcHistogram(vector: number[], bins: number): [number, number, number][] {\n if (vector.length === 0) {\n // Return empty bins with zero counts if input is empty\n const result: [number, number, number][] = []\n for (let i = 0; i < bins; i++) {\n result.push([0, 0, 0])\n }\n return result\n }\n\n // Find min and max values\n const min = Math.min(...vector)\n const max = Math.max(...vector)\n\n // Handle the case where all values are the same\n if (min === max) {\n const result: [number, number, number][] = []\n // Create bins with the same min/max and zero counts\n for (let i = 0; i < bins; i++) {\n result.push([min, min, 0])\n }\n // Put all values in the first bin\n result[0]![2] = vector.length\n return result\n }\n\n // Calculate bin size\n const binSize = (max - min) / bins\n\n // Initialize histogram array with bin boundaries and zero counts\n const histogram: [number, number, number][] = []\n for (let i = 0; i < bins; i++) {\n const binStart = min + i * binSize\n const binEnd = i === bins - 1 ? max : min + (i + 1) * binSize\n histogram.push([binStart, binEnd, 0])\n }\n\n // Count values in each bin\n for (const value of vector) {\n if (value === max) {\n // Place maximum value in the last bin\n histogram[bins - 1]![2] += 1\n }\n else {\n const binIndex = Math.min(\n Math.floor((value - min) / binSize),\n bins - 1,\n )\n histogram[binIndex]![2] += 1\n }\n }\n\n return histogram\n}\n","/**\n * Counts occurrences of each integer value in an array of non-negative integers.\n *\n * @param array - Array of non-negative integers to count\n * @param minLength - Minimum length of the output array (default: 0)\n * @param weights - Optional array of weights (same length as input array)\n * @returns An array where index i contains the count of occurrences of i in the input array\n */\nexport function bincount(\n array: number[],\n minLength: number = 0,\n weights?: number[],\n): number[] {\n if (array.length === 0) {\n return Array.from({ length: minLength }, () => 0)\n }\n\n // Find the maximum value to determine output array size\n const maxValue = Math.max(...array)\n const outputLength = Math.max(maxValue + 1, minLength)\n const counts = Array.from({ length: outputLength }, () => 0)\n\n // Count occurrences (or sum weights if provided)\n for (let i = 0; i < array.length; i++) {\n const value = Math.floor(array[i]!)\n\n if (value < outputLength) {\n // If weights provided, add weight; otherwise add 1\n counts[value]! += weights ? weights[i]! : 1\n }\n }\n\n return counts\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","LitsError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getLitsErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","REGEXP_SYMBOL","isLitsFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","getSourceCodeInfo","anyValue","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","annotatedArrays","WeakSet","vectors","notVectors","assertVector","vector","every","elem","add","isVector","assertNonEmptyVector","isObj","regexp","isColl","isSeq","assertFunctionLike","isFunctionLike","typeName","getAssertionError","toFixedArity","arity","min","async","chainRemainingMap","currentPromise","results","arr","fn","startIndex","push","i","moduleDocs","mean","category","description","returns","args","variants","argumentNames","examples","seeAlso","windowSize","a","b","median","variance","stdev","iqr","sum","prod","span","skewness","kurtosis","rms","mad","medad","entropy","mode","array","linspace","start","stop","n","ones","zeros","fill","generate","cumsum","cumprod","quartiles","percentile","quantile","histogram","bins","ecdf","threshold","outliers","bincount","minSize","weights","hideOperatorForm","winsorize","mse","rmse","mae","smape","sorted","sort","q1Index","floor","q1","q3Index","q3","lowerBound","upperBound","val","calcPercentile","data","sortedData","index","lowerIndex","upperIndex","ceil","weight","midIndex","q2","lowerHalf","slice","upperHalf","midLower","midUpper","calcMean","reduce","acc","geometricMeanReductionFunction","some","exp","log","calcMedian","mid","medianReductionFunction","calcVariance","optionalMean","varianceReductionFunction","sampleVarianceReductionFunction","calcSampleVariance","minLength","calcStdDev","sqrt","stdevReductionFunction","sampleStdevReductionFunction","calcSampleStdDev","iqrReductionFunction","spanReductionFunction","skewnessReductionFunction","stdDev","sampleSkewnessReductionFunction","sumSquaredDiffs","sumCubedDiffs","diff","sampleVariance","sampleStdDev","sampleSkewness","kurtosisReductionFunction","eccessKurtosisReductionFunction","excessKurtosis","sampleKurtosisReductionFunction","sampleKurtosis","sampleExcessKurtosisReductionFunction","sampleExcessKurtosis","rmsReductionFunction","madReductionFunction","abs","calcMad","medadReductionFunction","map","calcMedad","giniCoefficientReductionFunction","entropyReductionFunction","frequencies","Map","set","get","total","frequency","probability","log2","calculateEntropy","reductionFunctionNormalExpressions","addReductionFunctions","fns","entries","reductionFn","baseKey","replace","movingKey","centeredMovingKey","runningKey","undefined","createReductionNormalExpression","createMovingNormalExpression","createCenteredMovingNormalExpression","padding","createRunningNormalExpression","reductionFunction","evaluate","error","result","halfWindowSize","paddedVector","end","nullsCount","vectorFunctions","frequencyMap","maxFrequency","modes","countDiff","numPoints","step","from","_","generator","contextStack","executeFunction","Promise","mapSequential","then","last","binSize","binStart","binEnd","calcHistogram","findIndex","hasOutliers","params","forEach","maxValue","outputLength","counts","lowerQuantile","upperQuantile","vectorA","vectorB","denom","sequences","docs","vectorModule","functions"],"mappings":"AAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAkBC,MACbX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA6BD,EAAiBf,GAC5C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAoBL,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