@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
package/dist/modules/vector.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,r=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(r,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(r,n){const o=r instanceof Error?r.message:`${r}`;super(function(t,r){if(!r)return t;const n=`${r.position.line}:${r.position.column}`;return`${t}${r.filePath?`\n${r.filePath}:${n}`:`\nLocation ${n}`}\n${r.code}\n${e(r)}`}(o,n)),this.shortMessage=o,this.sourceCodeInfo=n,Object.setPrototypeOf(this,t.prototype),this.name="LitsError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const r={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},n=new Set(Object.values(r));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","Builtin","SpecialBuiltin","NativeJsFunction","Module"]);const i="^^fn^^",s="^^re^^";function c(e){return null!==e&&"object"==typeof e&&(i in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&o.has(t)));var t}function a(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&n.has(t));var t}function v(e){return c(e)?`<function ${e.name||"λ"}>`:a(e)?`${t=e[0],Object.keys(r).find(e=>r[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function m(e,t){return e?.sourceCodeInfo??t}function l(e,t={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(t.integer&&!Number.isInteger(e))&&(!(t.finite&&!Number.isFinite(e))&&((!t.zero||0===e)&&((!t.nonZero||0!==e)&&(!(t.positive&&e<=0)&&(!(t.negative&&e>=0)&&(!(t.nonPositive&&e>0)&&(!(t.nonNegative&&e<0)&&(!("number"==typeof t.gt&&e<=t.gt)&&(!("number"==typeof t.gte&&e<t.gte)&&(!("number"==typeof t.lt&&e>=t.lt)&&!("number"==typeof t.lte&&e>t.lte)))))))))))))}function g(e,r,n={}){if(!l(e,n))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),r=e.integer?"integer":"number",n=e.finite?"finite":"",o=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,n,r,o].filter(e=>!!e).join(" ")}(n)}, got ${v(e)}.`,m(e,r))}const p=new WeakSet,d=new WeakSet,u=new WeakSet;function h(e,r){if(!function(e){return!(!Array.isArray(e)||!d.has(e)&&(u.has(e)||(e.every(e=>l(e))?(p.add(e),d.add(e),0):(u.add(e),1))))}(e))throw new t(`Expected a vector, but got ${e}`,r)}function y(e,r){if(h(e,r),0===e.length)throw new t(`Expected a non empty vector, but got ${e}`,r)}function f(e){return null!==e&&"object"==typeof e&&!!e[i]}function w(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||f(e)||(t=e,null!==t&&"object"==typeof t&&t[s]));var t}function b(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||w(e)}function x(e,r){if(!function(e){return"number"==typeof e||!!b(e)||!!f(e)}(e))throw function(e,r,n){return new t(`Expected ${e}, got ${v(r)}.`,m(r,n))}("FunctionLike",e,r)}function k(e){return{min:e,max:e}}const z={mean:{category:"vector",description:"Returns the **mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **mean** of."}},variants:[{argumentNames:["vector"]}],examples:["mean([1, 2, 3])","mean([1, 2, -3])"],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"]},"moving-mean":{category:"vector",description:"Returns the **moving mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-mean } = import("vector");\nmoving-mean([1, 2, 3, 4, 5], 3)','let { moving-mean } = import("vector");\nmoving-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["moving-fn","vector.mean","vector.centered-moving-mean","vector.running-mean"]},"centered-moving-mean":{category:"vector",description:"Returns the **centered moving mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.mean","vector.moving-mean","vector.running-mean"]},"running-mean":{category:"vector",description:"Returns the **running mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-mean } = import("vector");\nrunning-mean([1, 2, 3, 4, 5])'],seeAlso:["running-fn","vector.mean","vector.moving-mean","vector.centered-moving-mean"]},"geometric-mean":{category:"vector",description:"Returns the **geometric mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **geometric mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { geometric-mean } = import("vector");\ngeometric-mean([1, 2, 3])','let { geometric-mean } = import("vector");\ngeometric-mean([1, 2, 9])'],seeAlso:["vector.moving-geometric-mean","vector.centered-moving-geometric-mean","vector.running-geometric-mean","vector.mean","vector.harmonic-mean"]},"moving-geometric-mean":{category:"vector",description:"Returns the **moving geometric mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving geometric mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-geometric-mean } = import("vector");\nmoving-geometric-mean([1, 2, 3, 4, 5], 3)','let { moving-geometric-mean } = import("vector");\nmoving-geometric-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.geometric-mean","vector.centered-moving-geometric-mean","vector.running-geometric-mean"]},"centered-moving-geometric-mean":{category:"vector",description:"Returns the **centered moving geometric mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving geometric mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.geometric-mean","vector.moving-geometric-mean","vector.running-geometric-mean"]},"running-geometric-mean":{category:"vector",description:"Returns the **running geometric mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running geometric mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-geometric-mean } = import("vector");\nrunning-geometric-mean([1, 2, 3, 4, 5])'],seeAlso:["vector.geometric-mean","vector.moving-geometric-mean","vector.centered-moving-geometric-mean"]},"harmonic-mean":{category:"vector",description:"Returns the **harmonic mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **harmonic mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { harmonic-mean } = import("vector");\nharmonic-mean([1, 2, 3])','let { harmonic-mean } = import("vector");\nharmonic-mean([1, 2, 9])'],seeAlso:["vector.moving-harmonic-mean","vector.centered-moving-harmonic-mean","vector.running-harmonic-mean","vector.mean","vector.geometric-mean"]},"moving-harmonic-mean":{category:"vector",description:"Returns the **moving harmonic mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving harmonic mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-harmonic-mean } = import("vector");\nmoving-harmonic-mean([1, 2, 3, 4, 5], 3)','let { moving-harmonic-mean } = import("vector");\nmoving-harmonic-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.harmonic-mean","vector.centered-moving-harmonic-mean","vector.running-harmonic-mean"]},"centered-moving-harmonic-mean":{category:"vector",description:"Returns the **centered moving harmonic mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving harmonic mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.harmonic-mean","vector.moving-harmonic-mean","vector.running-harmonic-mean"]},"running-harmonic-mean":{category:"vector",description:"Returns the **running harmonic mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running harmonic mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-harmonic-mean } = import("vector");\nrunning-harmonic-mean([1, 2, 3, 4, 5])'],seeAlso:["vector.harmonic-mean","vector.moving-harmonic-mean","vector.centered-moving-harmonic-mean"]},median:{category:"vector",description:"Returns the median of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the median of."}},variants:[{argumentNames:["vector"]}],examples:["median([1, 2, 3])","median([1, 2, -3])","median([1, 2, 3, 4])","median([1, 2, -3, 4])"],seeAlso:["median","vector.moving-median","vector.centered-moving-median","vector.running-median","vector.mean","vector.mode","vector.quartiles","vector.percentile","vector.iqr","vector.medad"]},"moving-median":{category:"vector",description:"Returns the **moving median** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving median** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-median } = import("vector");\nmoving-median([1, 2, 3, 4, 5], 3)','let { moving-median } = import("vector");\nmoving-median([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.median","vector.centered-moving-median","vector.running-median"]},"centered-moving-median":{category:"vector",description:"Returns the **centered moving median** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving median** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3)','let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.median","vector.moving-median","vector.running-median"]},"running-median":{category:"vector",description:"Returns the **running median** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running median** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-median } = import("vector");\nrunning-median([1, 2, 3, 4, 5])'],seeAlso:["vector.median","vector.moving-median","vector.centered-moving-median"]},variance:{category:"vector",description:"Returns the **variance** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **variance** of."}},variants:[{argumentNames:["vector"]}],examples:['let { variance } = import("vector");\nvariance([1, 2, 3])','let { variance } = import("vector");\nvariance([1, 2, -3])'],seeAlso:["linear-algebra.cov","vector.moving-variance","vector.centered-moving-variance","vector.running-variance","vector.stdev","vector.sample-variance","vector.mad"]},"moving-variance":{category:"vector",description:"Returns the **moving variance** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving variance** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-variance } = import("vector");\nmoving-variance([1, 2, 3, 4, 5], 3)','let { moving-variance } = import("vector");\nmoving-variance([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.variance","vector.centered-moving-variance","vector.running-variance"]},"centered-moving-variance":{category:"vector",description:"Returns the **centered moving variance** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving variance** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.variance","vector.moving-variance","vector.running-variance"]},"running-variance":{category:"vector",description:"Returns the **running variance** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running variance** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-variance } = import("vector");\nrunning-variance([1, 2, 3, 4, 5])'],seeAlso:["vector.variance","vector.moving-variance","vector.centered-moving-variance"]},"sample-variance":{category:"vector",description:"Returns the sample variance of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sample variance of."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-variance } = import("vector");\nsample-variance([1, 2, 3])','let { sample-variance } = import("vector");\nsample-variance([1, 2, -3])','let { sample-variance } = import("vector");\nsample-variance([1, 2, 3, 4])','let { sample-variance } = import("vector");\nsample-variance([1, 2, -3, 4])','let { sample-variance } = import("vector");\nsample-variance([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-sample-variance","vector.centered-moving-sample-variance","vector.running-sample-variance","vector.variance","vector.sample-stdev"]},"moving-sample-variance":{category:"vector",description:"Returns the **moving sample variance** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample variance** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-variance } = import("vector");\nmoving-sample-variance([1, 2, 3, 4, 5], 3)','let { moving-sample-variance } = import("vector");\nmoving-sample-variance([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sample-variance","vector.centered-moving-sample-variance","vector.running-sample-variance"]},"centered-moving-sample-variance":{category:"vector",description:"Returns the **centered moving sample variance** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample variance** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.sample-variance","vector.moving-sample-variance","vector.running-sample-variance"]},"running-sample-variance":{category:"vector",description:"Returns the **running sample variance** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",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."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-variance } = import("vector");\nrunning-sample-variance([1, 2, 3, 4, 5])'],seeAlso:["vector.sample-variance","vector.moving-sample-variance","vector.centered-moving-sample-variance"]},stdev:{category:"vector",description:"Returns the standard deviation of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the standard deviation of."}},variants:[{argumentNames:["vector"]}],examples:['let { stdev } = import("vector");\nstdev([1, 2, 3])','let { stdev } = import("vector");\nstdev([1, 2, -3])','let { stdev } = import("vector");\nstdev([1, 2, 3, 4])','let { stdev } = import("vector");\nstdev([1, 2, -3, 4])','let { stdev } = import("vector");\nstdev([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-stdev","vector.centered-moving-stdev","vector.running-stdev","vector.variance","vector.sample-stdev","vector.rms","vector.mad"]},"moving-stdev":{category:"vector",description:"Returns the **moving standard deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving standard deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-stdev } = import("vector");\nmoving-stdev([1, 2, 3, 4, 5], 3)','let { moving-stdev } = import("vector");\nmoving-stdev([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.stdev","vector.centered-moving-stdev","vector.running-stdev"]},"centered-moving-stdev":{category:"vector",description:"Returns the **centered moving standard deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving standard deviation** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.stdev","vector.moving-stdev","vector.running-stdev"]},"running-stdev":{category:"vector",description:"Returns the **running standard deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running standard deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-stdev } = import("vector");\nrunning-stdev([1, 2, 3, 4, 5])'],seeAlso:["vector.stdev","vector.moving-stdev","vector.centered-moving-stdev"]},"sample-stdev":{category:"vector",description:"Returns the sample standard deviation of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sample standard deviation of."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, -3])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3, 4])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, -3, 4])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-sample-stdev","vector.centered-moving-sample-stdev","vector.running-sample-stdev","vector.stdev","vector.sample-variance"]},"moving-sample-stdev":{category:"vector",description:"Returns the **moving sample standard deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample standard deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-stdev } = import("vector");\nmoving-sample-stdev([1, 2, 3, 4, 5], 3)','let { moving-sample-stdev } = import("vector");\nmoving-sample-stdev([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sample-stdev","vector.centered-moving-sample-stdev","vector.running-sample-stdev"]},"centered-moving-sample-stdev":{category:"vector",description:"Returns the **centered moving sample standard deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample standard deviation** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.sample-stdev","vector.moving-sample-stdev","vector.running-sample-stdev"]},"running-sample-stdev":{category:"vector",description:"Returns the **running sample standard deviation** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",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."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-stdev } = import("vector");\nrunning-sample-stdev([1, 2, 3, 4, 5])'],seeAlso:["vector.sample-stdev","vector.moving-sample-stdev","vector.centered-moving-sample-stdev"]},iqr:{category:"vector",description:"Calculates the **interquartile range** of a `vector`. Returns the difference between the third and first quartiles.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **interquartile range** of. Minimum length is 4."}},variants:[{argumentNames:["vector"]}],examples:['let { iqr } = import("vector");\niqr([1, 2, 3, 4])','let { iqr } = import("vector");\niqr([5, 4, 3, 2, 1, 2, 3, 4, 5])','let { iqr } = import("vector");\niqr(range(1, 1000))','let { iqr, generate } = import("vector");\niqr(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { iqr, generate } = import("vector");\nlet { ln } = import("math");\niqr(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.moving-iqr","vector.centered-moving-iqr","vector.running-iqr","vector.quartiles","vector.median","vector.mad","vector.medad","vector.outliers?","vector.outliers"]},"moving-iqr":{category:"vector",description:"Calculates the **moving interquartile range** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving interquartile range** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 4)','let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 5)','let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.iqr","vector.centered-moving-iqr","vector.running-iqr"]},"centered-moving-iqr":{category:"vector",description:"Calculates the **centered moving interquartile range** of a `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving interquartile range** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-iqr } = import("vector");\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-iqr } = import("vector");\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.iqr","vector.moving-iqr","vector.running-iqr"]},"running-iqr":{category:"vector",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.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running interquartile range** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-iqr } = import("vector");\nrunning-iqr([1, 2, 3, 4, 5, 6])','let { running-iqr } = import("vector");\nrunning-iqr([-1, -2, -3, 1, 2, 3])'],seeAlso:["vector.iqr","vector.moving-iqr","vector.centered-moving-iqr"]},sum:{category:"vector",description:"Returns the sum of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to sum."}},variants:[{argumentNames:["vector"]}],examples:["sum([1, 2, 3])","sum([1, 2, -3])"],seeAlso:["sum","vector.moving-sum","vector.centered-moving-sum","vector.running-sum","vector.prod","vector.cumsum","vector.mean"]},"moving-sum":{category:"vector",description:"Returns the **moving sum** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sum** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sum } = import("vector");\nmoving-sum([1, 2, 3, 4, 5], 3)','let { moving-sum } = import("vector");\nmoving-sum([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sum","vector.centered-moving-sum","vector.running-sum"]},"centered-moving-sum":{category:"vector",description:"Returns the **centered moving sum** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sum** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3)','let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 0, 0)','let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.sum","vector.moving-sum","vector.running-sum"]},"running-sum":{category:"vector",description:"Returns the **running sum** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sum** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sum } = import("vector");\nrunning-sum([1, 2, 3])','let { running-sum } = import("vector");\nrunning-sum([1, -2, -3])'],seeAlso:["vector.sum","vector.moving-sum","vector.centered-moving-sum","vector.cumsum"]},prod:{category:"vector",description:"Returns the **product** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **product** of."}},variants:[{argumentNames:["vector"]}],examples:["prod([1, 2, 3])","prod([1, 2, -3])"],seeAlso:["prod","vector.moving-prod","vector.centered-moving-prod","vector.running-prod","vector.sum","vector.cumprod"]},"moving-prod":{category:"vector",description:"Returns the **moving product** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving product** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-prod } = import("vector");\nmoving-prod([1, 2, 3, 4, 5], 3)','let { moving-prod } = import("vector");\nmoving-prod([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.prod","vector.centered-moving-prod","vector.running-prod"]},"centered-moving-prod":{category:"vector",description:"Returns the **centered moving product** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving product** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-prod } = import("vector");\ncentered-moving-prod([1, 2, 3, 4, 5], 3)','let { centered-moving-prod } = import("vector");\ncentered-moving-prod([1, 2, 3, 4, 5], 3, 0, 0)'],seeAlso:["vector.prod","vector.moving-prod","vector.running-prod"]},"running-prod":{category:"vector",description:"Returns the **running product** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running product** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-prod } = import("vector");\nrunning-prod([1, 2, 3, 4, 5])','let { running-prod } = import("vector");\nrunning-prod([1, -2, -3])'],seeAlso:["vector.prod","vector.moving-prod","vector.centered-moving-prod","vector.cumprod"]},span:{category:"vector",description:"Returns the difference between the maximum and minimum values in a vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the span of."}},variants:[{argumentNames:["vector"]}],examples:['let { span } = import("vector");\nspan([1, 2, 3])','let { span } = import("vector");\nspan([1, 1, 2, 3, 3])','let { span } = import("vector");\nspan([1, 2, -3])'],seeAlso:["vector.moving-span","vector.centered-moving-span","vector.running-span","min","max"]},"moving-span":{category:"vector",description:"Calculates the **moving span** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving span** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 4)','let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 5)','let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.span","vector.centered-moving-span","vector.running-span"]},"centered-moving-span":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving span** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"The value to pad the result with on the left."},rightPadding:{type:"number",description:"The value to pad the result with on the right."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-span } = import("vector");\ncentered-moving-span([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-span } = import("vector");\ncentered-moving-span([1, 2, 4, 7, 11, 16], 3, 0, 100)'],seeAlso:["vector.span","vector.moving-span","vector.running-span"]},"running-span":{category:"vector",description:"Calculates the **running span** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running span** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-span } = import("vector");\nrunning-span([1, 2, 4])'],seeAlso:["vector.span","vector.moving-span","vector.centered-moving-span"]},skewness:{category:"vector",description:"Calculates the **skewness** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **skewness** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { skewness } = import("vector");\nskewness([1, 2, 3, 6, 20])','let { skewness } = import("vector");\nskewness([1, 2, 2, 3])'],seeAlso:["vector.moving-skewness","vector.centered-moving-skewness","vector.running-skewness","vector.kurtosis","vector.sample-skewness","vector.excess-kurtosis"]},"moving-skewness":{category:"vector",description:"Calculates the **moving skewness** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-skewness } = import("vector");\nmoving-skewness([1, 2, 4, 7, 11, 16], 4)','let { moving-skewness } = import("vector");\nmoving-skewness([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.skewness","vector.centered-moving-skewness","vector.running-skewness"]},"centered-moving-skewness":{category:"vector",description:"Calculates the **centered moving skewness** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-skewness } = import("vector");\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-skewness } = import("vector");\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.skewness","vector.moving-skewness","vector.running-skewness"]},"running-skewness":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running skewness** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-skewness } = import("vector");\nrunning-skewness([1, 2, 4, 7, 11])'],seeAlso:["vector.skewness","vector.moving-skewness","vector.centered-moving-skewness"]},"sample-skewness":{category:"vector",description:"Calculates the **sample skewness** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample skewness** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-skewness } = import("vector");\nsample-skewness([1, 2, 3, 6, 20])','let { sample-skewness } = import("vector");\nsample-skewness([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-skewness","vector.centered-moving-sample-skewness","vector.running-sample-skewness","vector.skewness","vector.sample-kurtosis"]},"moving-sample-skewness":{category:"vector",description:"Calculates the **moving sample skewness** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-skewness } = import("vector");\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-skewness } = import("vector");\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-skewness","vector.centered-moving-sample-skewness","vector.running-sample-skewness"]},"centered-moving-sample-skewness":{category:"vector",description:"Calculates the **centered moving sample skewness** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-skewness } = import("vector");\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-skewness } = import("vector");\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 3, 0, 100)'],seeAlso:["vector.sample-skewness","vector.moving-sample-skewness","vector.running-sample-skewness"]},"running-sample-skewness":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample skewness** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-skewness } = import("vector");\nrunning-sample-skewness([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-skewness","vector.moving-sample-skewness","vector.centered-moving-sample-skewness"]},"excess-kurtosis":{category:"vector",description:"Calculates the **excess kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **excess kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { excess-kurtosis } = import("vector");\nexcess-kurtosis([1, 2, 3, 6, 20])','let { excess-kurtosis } = import("vector");\nexcess-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-excess-kurtosis","vector.centered-moving-excess-kurtosis","vector.running-excess-kurtosis","vector.kurtosis","vector.sample-excess-kurtosis","vector.skewness"]},"moving-excess-kurtosis":{category:"vector",description:"Calculates the **moving excess kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-excess-kurtosis } = import("vector");\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-excess-kurtosis } = import("vector");\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.excess-kurtosis","vector.centered-moving-excess-kurtosis","vector.running-excess-kurtosis"]},"centered-moving-excess-kurtosis":{category:"vector",description:"Calculates the **centered moving excess kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-excess-kurtosis } = import("vector");\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-excess-kurtosis } = import("vector");\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.excess-kurtosis","vector.moving-excess-kurtosis","vector.running-excess-kurtosis"]},"running-excess-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running excess kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-excess-kurtosis } = import("vector");\nrunning-excess-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.excess-kurtosis","vector.moving-excess-kurtosis","vector.centered-moving-excess-kurtosis"]},kurtosis:{category:"vector",description:"Calculates the **kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { kurtosis } = import("vector");\nkurtosis([1, 2, 3, 6, 20])','let { kurtosis } = import("vector");\nkurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-kurtosis","vector.centered-moving-kurtosis","vector.running-kurtosis","vector.excess-kurtosis","vector.sample-kurtosis","vector.skewness"]},"moving-kurtosis":{category:"vector",description:"Calculates the **moving kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-kurtosis } = import("vector");\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-kurtosis } = import("vector");\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.kurtosis","vector.centered-moving-kurtosis","vector.running-kurtosis"]},"centered-moving-kurtosis":{category:"vector",description:"Calculates the **centered moving kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-kurtosis } = import("vector");\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-kurtosis } = import("vector");\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.kurtosis","vector.moving-kurtosis","vector.running-kurtosis"]},"running-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-kurtosis } = import("vector");\nrunning-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.kurtosis","vector.moving-kurtosis","vector.centered-moving-kurtosis"]},"sample-excess-kurtosis":{category:"vector",description:"Calculates the **sample excess kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample excess kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-excess-kurtosis } = import("vector");\nsample-excess-kurtosis([1, 2, 3, 6, 20])','let { sample-excess-kurtosis } = import("vector");\nsample-excess-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis","vector.sample-kurtosis","vector.excess-kurtosis"]},"moving-sample-excess-kurtosis":{category:"vector",description:"Calculates the **moving sample excess kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-excess-kurtosis } = import("vector");\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-excess-kurtosis } = import("vector");\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis"]},"centered-moving-sample-excess-kurtosis":{category:"vector",description:"Calculates the **centered moving sample excess kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-excess-kurtosis } = import("vector");\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-excess-kurtosis } = import("vector");\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)'],seeAlso:["vector.sample-excess-kurtosis","vector.moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis"]},"running-sample-excess-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample excess kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-excess-kurtosis } = import("vector");\nrunning-sample-excess-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-excess-kurtosis","vector.moving-sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis"]},"sample-kurtosis":{category:"vector",description:"Calculates the **sample kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-kurtosis } = import("vector");\nsample-kurtosis([1, 2, 3, 6, 20])','let { sample-kurtosis } = import("vector");\nsample-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-kurtosis","vector.centered-moving-sample-kurtosis","vector.running-sample-kurtosis","vector.sample-excess-kurtosis","vector.kurtosis","vector.sample-skewness"]},"moving-sample-kurtosis":{category:"vector",description:"Calculates the **moving sample kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-kurtosis } = import("vector");\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-kurtosis } = import("vector");\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-kurtosis","vector.centered-moving-sample-kurtosis","vector.running-sample-kurtosis"]},"centered-moving-sample-kurtosis":{category:"vector",description:"Calculates the **centered moving sample kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-kurtosis } = import("vector");\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-kurtosis } = import("vector");\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)'],seeAlso:["vector.sample-kurtosis","vector.moving-sample-kurtosis","vector.running-sample-kurtosis"]},"running-sample-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-kurtosis } = import("vector");\nrunning-sample-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-kurtosis","vector.moving-sample-kurtosis","vector.centered-moving-sample-kurtosis"]},rms:{category:"vector",description:"Calculates the **root mean square** of a `vector`. Returns the square root of the average of the squares of the elements.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **root mean square** of. Minimum length is 1."}},variants:[{argumentNames:["vector"]}],examples:['let { rms } = import("vector");\nrms([1, 2, 3, 4])','let { rms } = import("vector");\nrms([5, 4, 3, 2, 1])','let { rms } = import("vector");\nrms(range(1, 1000))','let { rms, generate } = import("vector");\nrms(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { rms, generate } = import("vector");\nlet { ln } = import("math");\nrms(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.moving-rms","vector.centered-moving-rms","vector.running-rms","vector.mean","vector.stdev"]},"moving-rms":{category:"vector",description:"Calculates the **moving root mean square** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving root mean square** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 4)','let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 5)','let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.rms","vector.centered-moving-rms","vector.running-rms"]},"centered-moving-rms":{category:"vector",description:"Calculates the **centered moving root mean square** of a `vector` with a given window size and padding value.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving root mean square** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 5, 0)','let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 6, 0, 0)'],seeAlso:["vector.rms","vector.moving-rms","vector.running-rms"]},"running-rms":{category:"vector",description:"Calculates the **running root mean square** of a `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running root mean square** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-rms } = import("vector");\nrunning-rms([1, 2, 3, 4, 5, 6])','let { running-rms } = import("vector");\nrunning-rms([1, -3, 2])','let { running-rms } = import("vector");\nrunning-rms([-1, -2, -3])','let { running-rms } = import("vector");\nrunning-rms([0])'],seeAlso:["vector.rms","vector.moving-rms","vector.centered-moving-rms"]},mad:{category:"vector",description:"Returns the **mean absolute deviation** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **mean absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { mad } = import("vector");\nmad([1, 2, 3])','let { mad } = import("vector");\nmad([1, 2, -3])'],seeAlso:["vector.moving-mad","vector.centered-moving-mad","vector.running-mad","vector.medad","vector.stdev","vector.variance","vector.iqr"]},"moving-mad":{category:"vector",description:"Returns the **moving mean absolute deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving mean absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-mad } = import("vector");\nmoving-mad([1, 2, 3, 4, 5], 3)','let { moving-mad } = import("vector");\nmoving-mad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.mad","vector.centered-moving-mad","vector.running-mad"]},"centered-moving-mad":{category:"vector",description:"Returns the **centered moving mean absolute deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving mean absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-mad } = import("vector");\ncentered-moving-mad([1, 2, 3, 4, 5], 3)','let { centered-moving-mad } = import("vector");\ncentered-moving-mad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.mad","vector.moving-mad","vector.running-mad"]},"running-mad":{category:"vector",description:"Returns the **running mean absolute deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running mean absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-mad } = import("vector");\nrunning-mad([1, 2, 3])','let { running-mad } = import("vector");\nrunning-mad([1, 2, -3])'],seeAlso:["vector.mad","vector.moving-mad","vector.centered-moving-mad"]},medad:{category:"vector",description:"Returns the **median absolute deviation** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **median absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { medad } = import("vector");\nmedad([1, 2, 3])','let { medad } = import("vector");\nmedad([1, 2, -3])'],seeAlso:["vector.moving-medad","vector.centered-moving-medad","vector.running-medad","vector.mad","vector.median","vector.iqr"]},"moving-medad":{category:"vector",description:"Returns the **moving median absolute deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving median absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-medad } = import("vector");\nmoving-medad([1, 2, 3, 4, 5], 3)','let { moving-medad } = import("vector");\nmoving-medad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.medad","vector.centered-moving-medad","vector.running-medad"]},"centered-moving-medad":{category:"vector",description:"Returns the **centered moving median absolute deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving median absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-medad } = import("vector");\ncentered-moving-medad([1, 2, 3, 4, 5], 3)','let { centered-moving-medad } = import("vector");\ncentered-moving-medad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.medad","vector.moving-medad","vector.running-medad"]},"running-medad":{category:"vector",description:"Returns the **running median absolute deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running median absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-medad } = import("vector");\nrunning-medad([1, 2, 3])','let { running-medad } = import("vector");\nrunning-medad([1, 2, -3])'],seeAlso:["vector.medad","vector.moving-medad","vector.centered-moving-medad"]},"gini-coefficient":{category:"vector",description:"Returns the **gini coefficient** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **gini coefficient** of."}},variants:[{argumentNames:["vector"]}],examples:['let { gini-coefficient } = import("vector");\ngini-coefficient([1, 2, 3])','let { gini-coefficient } = import("vector");\ngini-coefficient([1, 1, 3])'],seeAlso:["vector.moving-gini-coefficient","vector.centered-moving-gini-coefficient","vector.running-gini-coefficient","vector.entropy"]},"moving-gini-coefficient":{category:"vector",description:"Returns the **moving gini coefficient** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving gini coefficient** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-gini-coefficient } = import("vector");\nmoving-gini-coefficient([1, 2, 3], 2)','let { moving-gini-coefficient } = import("vector");\nmoving-gini-coefficient([1, 1, 3], 2)'],seeAlso:["vector.gini-coefficient","vector.centered-moving-gini-coefficient","vector.running-gini-coefficient"]},"centered-moving-gini-coefficient":{category:"vector",description:"Returns the **centered moving gini coefficient** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving gini coefficient** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-gini-coefficient } = import("vector");\ncentered-moving-gini-coefficient([1, 2, 3], 2)','let { centered-moving-gini-coefficient } = import("vector");\ncentered-moving-gini-coefficient([1, 1, 3], 2)'],seeAlso:["vector.gini-coefficient","vector.moving-gini-coefficient","vector.running-gini-coefficient"]},"running-gini-coefficient":{category:"vector",description:"Returns the **running gini coefficient** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running gini coefficient** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-gini-coefficient } = import("vector");\nrunning-gini-coefficient([1, 2, 3])','let { running-gini-coefficient } = import("vector");\nrunning-gini-coefficient([1, 1, 3])'],seeAlso:["vector.gini-coefficient","vector.moving-gini-coefficient","vector.centered-moving-gini-coefficient"]},entropy:{category:"vector",description:"Calculates the **entropy** of a `vector`. The entropy is a measure of the uncertainty associated with a random variable.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **entropy** of. Minimum length is 1."}},variants:[{argumentNames:["vector"]}],examples:['let { entropy } = import("vector");\nentropy([1, 1, 2, 3, 3, 3])','let { entropy } = import("vector");\nentropy([1, 2, 3])','let { entropy } = import("vector");\nentropy([1, 2, 2, 3])','let { entropy } = import("vector");\nentropy([0])','let { entropy } = import("vector");\nentropy([1])','let { entropy } = import("vector");\nentropy([1, 2])'],seeAlso:["vector.moving-entropy","vector.centered-moving-entropy","vector.running-entropy","vector.gini-coefficient"]},"moving-entropy":{category:"vector",description:"Calculates the **moving entropy** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving entropy** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-entropy } = import("vector");\nmoving-entropy([1, 1, 2, 3, 3, 3], 4)','let { moving-entropy } = import("vector");\nmoving-entropy([1, 1, 2, 3, 3, 3], 3)','let { moving-entropy } = import("vector");\nmoving-entropy([1, 2], 2)'],seeAlso:["vector.entropy","vector.centered-moving-entropy","vector.running-entropy"]},"centered-moving-entropy":{category:"vector",description:"Calculates the **centered moving entropy** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving entropy** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 4)','let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 3)','let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 2], 2)'],seeAlso:["vector.entropy","vector.moving-entropy","vector.running-entropy"]},"running-entropy":{category:"vector",description:"Calculates the **running entropy** of a `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running entropy** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-entropy } = import("vector");\nrunning-entropy([1, 1, 2, 3, 3, 3])','let { running-entropy } = import("vector");\nrunning-entropy([1, 2])'],seeAlso:["vector.entropy","vector.moving-entropy","vector.centered-moving-entropy"]},"monotonic?":{category:"vector",description:"Checks if a vector is monotonic.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { monotonic? } = import("vector");\nmonotonic?([1, 2, 3])','let { monotonic? } = import("vector");\nmonotonic?([1, 2, 2, 3])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1, 1])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1, 2])','let { monotonic? } = import("vector");\nmonotonic?([1])','let { monotonic? } = import("vector");\nmonotonic?([])'],seeAlso:["vector.strictly-monotonic?","vector.increasing?","vector.decreasing?"]},"strictly-monotonic?":{category:"vector",description:"Checks if a vector is strictly monotonic.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1, 2, 3])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1, 2, 2, 3])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1, 1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1, 2])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([])'],seeAlso:["vector.monotonic?","vector.strictly-increasing?","vector.strictly-decreasing?"]},"increasing?":{category:"vector",description:"Checks if a vector is increasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { increasing? } = import("vector");\nincreasing?([1, 2, 3])','let { increasing? } = import("vector");\nincreasing?([1, 2, 2, 3])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1, 1])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1, 2])','let { increasing? } = import("vector");\nincreasing?([1])','let { increasing? } = import("vector");\nincreasing?([])'],seeAlso:["vector.strictly-increasing?","vector.decreasing?","vector.strictly-decreasing?","vector.monotonic?"]},"decreasing?":{category:"vector",description:"Checks if a vector is decreasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { decreasing? } = import("vector");\ndecreasing?([1, 2, 3])','let { decreasing? } = import("vector");\ndecreasing?([1, 2, 2, 3])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1, 1])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1, 2])','let { decreasing? } = import("vector");\ndecreasing?([1])','let { decreasing? } = import("vector");\ndecreasing?([])'],seeAlso:["vector.strictly-decreasing?","vector.increasing?","vector.strictly-increasing?","vector.monotonic?"]},"strictly-increasing?":{category:"vector",description:"Checks if a vector is strictly increasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1, 2, 3])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1, 2, 2, 3])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1, 1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1, 2])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([])'],seeAlso:["vector.increasing?","vector.decreasing?","vector.strictly-decreasing?","vector.strictly-monotonic?"]},"strictly-decreasing?":{category:"vector",description:"Checks if a vector is strictly decreasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1, 2, 3])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1, 2, 2, 3])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1, 1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1, 2])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([])'],seeAlso:["vector.increasing?","vector.strictly-increasing?","vector.decreasing?","vector.strictly-monotonic?"]},mode:{category:"vector",description:"Returns the mode of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the mode of."}},variants:[{argumentNames:["vector"]}],examples:['let { mode } = import("vector");\nmode([1, 2, 3])','let { mode } = import("vector");\nmode([1, 2, -3, 1])','let { mode } = import("vector");\nmode([2, 2, 3, 3, 4])','let { mode } = import("vector");\nmode([2, 2, 3, 3])','let { mode } = import("vector");\nmode([1, 2, 3, 2, 1, 2])'],seeAlso:["vector.mean","vector.median"]},"min-index":{category:"vector",description:"Returns the index of the minimum value of all elements in the vector.",returns:{type:"integer"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the minimum index of."}},variants:[{argumentNames:["vector"]}],examples:['let { min-index } = import("vector");\nmin-index([1, 2, 3])','let { min-index } = import("vector");\nmin-index([1, 1, 2, 3, 3])','let { min-index } = import("vector");\nmin-index([1, 2, -3])','let { min-index } = import("vector");\nmin-index([1, 2, 3, 4])','let { min-index } = import("vector");\nmin-index([1, 2, -3, 4])'],seeAlso:["vector.max-index","min"]},"max-index":{category:"vector",description:"Returns the index of the maximum value of all elements in the vector.",returns:{type:"integer"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the maximum index of."}},variants:[{argumentNames:["vector"]}],examples:['let { max-index } = import("vector");\nmax-index([1, 2, 3])','let { max-index } = import("vector");\nmax-index([1, 1, 2, 3, 3])','let { max-index } = import("vector");\nmax-index([1, 2, -3])','let { max-index } = import("vector");\nmax-index([1, 2, 3, 4])','let { max-index } = import("vector");\nmax-index([1, 2, -3, 4])'],seeAlso:["vector.min-index","max"]},"sort-indices":{category:"vector",description:"Returns the indices of the elements in the vector sorted in ascending order.",returns:{type:"vector"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sorted indices of."}},variants:[{argumentNames:["vector"]}],examples:['let { sort-indices } = import("vector");\nsort-indices([1, 2, 3])','let { sort-indices } = import("vector");\nsort-indices([1, 1, 2, 3, 3])','let { sort-indices } = import("vector");\nsort-indices([1, 2, -3])','let { sort-indices } = import("vector");\nsort-indices([1, 2, 3, 4])','let { sort-indices } = import("vector");\nsort-indices([1, 2, -3, 4])'],seeAlso:["sort"]},"count-values":{category:"vector",description:"Counts the number of occurrences of each value in the vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"Vector to count the values of."}},variants:[{argumentNames:["vector"]}],examples:['let { count-values } = import("vector");\ncount-values([1, 2, 3])','let { count-values } = import("vector");\ncount-values([1, 1, 2, 3, 3])','let { count-values } = import("vector");\ncount-values([1, 2, -3])','let { count-values } = import("vector");\ncount-values([1, 2, 2, 1, 3, 2, 4, 2, 1, 2, 2, 1, 3, 2, 4])'],seeAlso:["sequence.frequencies","vector.bincount"]},linspace:{category:"vector",description:"Generates a vector of evenly spaced numbers between two values.",returns:{type:"number",array:!0},args:{start:{type:"number",description:"The starting value."},stop:{type:"number",description:"The ending value."},n:{type:"integer",description:"The number of values to generate."}},variants:[{argumentNames:["start","stop","n"]}],examples:['let { linspace } = import("vector");\nlinspace(0, 10, 6)','let { linspace } = import("vector");\nlinspace(10, 20, 25)'],seeAlso:["range","vector.ones","vector.zeros","vector.fill","vector.generate"]},ones:{category:"vector",description:"Generates a vector of ones.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."}},variants:[{argumentNames:["length"]}],examples:['let { ones } = import("vector");\nones(5)','let { ones } = import("vector");\nones(10)','let { ones } = import("vector");\nones(0)'],seeAlso:["repeat","vector.zeros","vector.fill","vector.generate","vector.linspace"]},zeros:{category:"vector",description:"Generates a vector of zeros.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."}},variants:[{argumentNames:["length"]}],examples:['let { zeros } = import("vector");\nzeros(5)','let { zeros } = import("vector");\nzeros(10)','let { zeros } = import("vector");\nzeros(0)'],seeAlso:["repeat","vector.ones","vector.fill","vector.generate","vector.linspace"]},fill:{category:"vector",description:"Generates a vector filled with a number.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."},value:{type:"number",description:"The value to fill the vector with."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["length","value"]}],examples:['let { fill } = import("vector");\nfill(5, PI)','let { fill } = import("vector");\nfill(10, -1)'],seeAlso:["repeat","vector.ones","vector.zeros","vector.generate","vector.linspace","grid.fill"]},generate:{category:"vector",description:"Generates a vector of numbers based on a function.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."},func:{type:"function",description:"A function that takes an index and returns a number."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["length","func"]}],examples:['let { generate } = import("vector");\ngenerate(5, -> $ * 2)','let { generate } = import("vector");\ngenerate(10, -> $ + 1)','let { generate } = import("vector");\ngenerate(0, -> $ + 1)'],seeAlso:["repeat","vector.ones","vector.zeros","vector.fill","vector.linspace","grid.generate"]},cumsum:{category:"vector",description:"Calculates the cumulative sum of a vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the cumulative sum of."}},variants:[{argumentNames:["vector"]}],examples:['let { cumsum } = import("vector");\ncumsum([1, 2, 3])','let { cumsum } = import("vector");\ncumsum([1, 2, -3])','let { cumsum } = import("vector");\ncumsum([])'],seeAlso:["vector.cumprod","vector.sum","vector.running-sum"]},cumprod:{category:"vector",description:"Calculates the cumulative product of a vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the cumulative product of."}},variants:[{argumentNames:["vector"]}],examples:['let { cumprod } = import("vector");\ncumprod([1, 2, 3])','let { cumprod } = import("vector");\ncumprod([1, 2, -3, 0, 10])','let { cumprod } = import("vector");\ncumprod([])'],seeAlso:["vector.cumsum","vector.prod","vector.running-prod"]},quartiles:{category:"vector",description:"Calculates the quartiles of a vector. Returns an array containing the first, second (median), and third quartiles.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the quartiles of. Minimum length is 4."}},variants:[{argumentNames:["vector"]}],examples:['let { quartiles } = import("vector");\nquartiles([1, 2, 3, 4])','let { quartiles } = import("vector");\nquartiles([5, 4, 3, 2, 1, 2, 3, 4, 5])','let { quartiles } = import("vector");\nquartiles(range(1, 1000))','let { quartiles, generate } = import("vector");\nquartiles(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { quartiles, generate } = import("vector");\nlet { ln } = import("math");\nquartiles(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.percentile","vector.quantile","vector.median","vector.iqr"]},percentile:{category:"vector",description:"Calculates the percentile of a vector. Returns the value at the specified percentile.",returns:{type:"number"},args:{vector:{type:"vector",description:"The non empty vector to calculate the percentile of."},percentile:{type:"number",description:"The percentile to calculate. Must be between 0 and 1."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","percentile"]}],examples:['let { percentile } = import("vector");\npercentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 35)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 0)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 10)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 20)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 30)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 40)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 50)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 60)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 70)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 80)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 90)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 100)'],seeAlso:["vector.quantile","vector.quartiles","vector.median","vector.ecdf","vector.winsorize"]},quantile:{category:"vector",description:"Calculates the quantile of a vector. Returns the value at the specified quantile.",returns:{type:"number"},args:{vector:{type:"vector",description:"The non empty vector to calculate the quantile of."},quantile:{type:"number",description:"The quantile to calculate. Must be between 0 and 1."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","quantile"]}],examples:['let { quantile } = import("vector");\nquantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0.35)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.1)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.2)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.3)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.4)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.5)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.6)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.7)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.8)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.9)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 1)'],seeAlso:["vector.percentile","vector.quartiles","vector.ecdf"]},histogram:{category:"vector",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.",returns:{type:"array",array:!0},args:{vector:{type:"vector",description:"The numeric array to create a histogram from."},bins:{type:"integer",description:"The number of bins to divide the data range into."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","bins"]}],examples:['let { histogram } = import("vector");\nhistogram([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9], 3)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 5)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 10)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 1)'],seeAlso:["vector.bincount","vector.ecdf"]},ecdf:{category:"vector",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.",returns:{type:"number"},args:{vector:{type:"vector",description:"The numeric array to calculate the ECDF from."},threshold:{type:"number",description:"The threshold value to calculate the ECDF for."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","threshold"]}],examples:['let { ecdf } = import("vector");\necdf([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9, 10, 12], 5)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 3)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 0)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 10)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 2)'],seeAlso:["vector.histogram","vector.percentile","vector.quantile"]},"outliers?":{category:"vector",description:"Checks if the `vector` contains outliers based on the interquartile range (IQR) method. Returns `true` if outliers are present, `false` otherwise.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The `vector` to check for outliers."}},variants:[{argumentNames:["vector"]}],examples:['let { outliers? } = import("vector");\noutliers?([1, 2, 3])','let { outliers? } = import("vector");\noutliers?([1, 2, -3])','let { outliers? } = import("vector");\noutliers?([1, 2, 3, 2, 4, 120])'],seeAlso:["vector.outliers","vector.winsorize","vector.iqr"]},outliers:{category:"vector",description:"Identifies outliers in the `vector` based on the interquartile range (IQR) method. Returns an array of outlier values.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The `vector` to check for outliers."}},variants:[{argumentNames:["vector"]}],examples:['let { outliers } = import("vector");\noutliers([1, 2, 3])','let { outliers } = import("vector");\noutliers([1, 2, -3])','let { outliers } = import("vector");\noutliers([1, 2, 3, 2, 4, 120])'],seeAlso:["vector.outliers?","vector.winsorize","vector.iqr"]},bincount:{category:"vector",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**.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The vector to count occurrences in."},minSize:{type:"integer",description:"Optional minimum size of the output array."},weights:{type:"number",array:!0,description:"Optional weights for each element in the vector."}},variants:[{argumentNames:["vector"]},{argumentNames:["vector","minSize"]},{argumentNames:["vector","minSize","weights"]}],examples:['let { bincount } = import("vector");\nbincount([1, 2, 3])','let { bincount } = import("vector");\nbincount([1, 2, 2, 3, 3])'],seeAlso:["vector.count-values","vector.histogram"],hideOperatorForm:!0},winsorize:{category:"vector",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.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The vector to winsorize."},"lower-quantile":{type:"number",description:"The lower quantile threshold (between 0 and 1)."},"upper-quantile":{type:"number",description:"Optional Upper quantile threshold (between 0 and 1). Defaults to `(1 - lower-quantile)` if `lower-quantile <= 0.5` otherwise `1`."}},variants:[{argumentNames:["vector","lower-quantile"]},{argumentNames:["vector","lower-quantile","upper-quantile"]}],examples:['let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25)','let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.75)','let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.5)'],seeAlso:["vector.outliers","vector.outliers?","vector.percentile"],hideOperatorForm:!0},mse:{category:"vector",description:"Calculates the **Mean Squared Error (MSE)** between two vectors. Returns the average of the squared differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { mse } = import("vector");\nmse([1, 2, 3], [1, 2, 3])','let { mse } = import("vector");\nmse([1, 2, 3], [4, 5, 6])','let { mse } = import("vector");\nmse([1, 2, 3], [2, 2, 2])','let { mse } = import("vector");\nmse([1, 2], [3, 3])','let { mse } = import("vector");\nmse([1], [3])'],seeAlso:["vector.rmse","vector.mae","vector.smape"]},rmse:{category:"vector",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.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { rmse } = import("vector");\nrmse([1, 2, 3], [1, 2, 3])','let { rmse } = import("vector");\nrmse([1, 2, 3], [4, 5, 6])','let { rmse } = import("vector");\nrmse([1, 2, 3], [2, 2, 2])','let { rmse } = import("vector");\nrmse([1, 2], [3, 3])','let { rmse } = import("vector");\nrmse([1], [3])'],seeAlso:["vector.mse","vector.mae","vector.smape"]},mae:{category:"vector",description:"Calculates the **Mean Absolute Error (MAE)** between two vectors. Returns the average of the absolute differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { mae } = import("vector");\nmae([1, 2, 3], [1, 2, 3])','let { mae } = import("vector");\nmae([1, 2, 3], [4, 5, 6])','let { mae } = import("vector");\nmae([1, 2, 3], [2, 2, 2])','let { mae } = import("vector");\nmae([1, 2], [3, 3])','let { mae } = import("vector");\nmae([1], [3])'],seeAlso:["vector.mse","vector.rmse","vector.smape"]},smape:{category:"vector",description:"Calculates the **Symmetric Mean Absolute Percentage Error (SMAPE)** between two vectors. Returns the average of the absolute percentage differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { smape } = import("vector");\nsmape([1, 2, 3], [1, 2, 3])','let { smape } = import("vector");\nsmape([1, 2, 3], [4, 5, 6])','let { smape } = import("vector");\nsmape([1, 2, 3], [2, 2, 2])','let { smape } = import("vector");\nsmape([1, 2], [3, 3])','let { smape } = import("vector");\nsmape([1], [3])'],seeAlso:["vector.mse","vector.rmse","vector.mae"]}};function N(e){if(e.length<=1)return[];const t=[...e].sort((e,t)=>e-t),r=Math.floor(.25*t.length),n=t.length%4==0?(t[r-1]+t[r])/2:t[r],o=Math.floor(.75*t.length),i=t.length%4==0?(t[o-1]+t[o])/2:t[o],s=i-n,c=n-1.5*s,a=i+1.5*s;return e.filter(e=>e<c||e>a)}function T(e,t){const r=[...e].sort((e,t)=>e-t);if(0===t)return r[0];if(100===t)return r[r.length-1];const n=t/100*(r.length-1);if(Number.isInteger(n))return r[n];const o=Math.floor(n),i=Math.ceil(n),s=n-o;return r[o]*(1-s)+r[i]*s}function S(e){const t=[...e].sort((e,t)=>e-t),r=t.length/2;let n;n=t.length%2==0?(t[r-1]+t[r])/2:t[Math.floor(r)];const o=t.slice(0,Math.floor(t.length/2)),i=t.slice(Math.ceil(t.length/2));let s,c;if(o.length%2==0){const e=o.length/2;s=(o[e-1]+o[e])/2}else s=o[Math.floor(o.length/2)];if(i.length%2==0){const e=i.length/2;c=(i[e-1]+i[e])/2}else c=i[Math.floor(i.length/2)];return[s,n,c]}function q(e){if(0===e.length)return 0;return e.reduce((e,t)=>e+t,0)/e.length}const A={"geometric-mean":e=>{if(e.some(e=>e<0))throw new Error("Geometric mean is not defined for non-positive numbers");return Math.exp(e.reduce((e,t)=>e+Math.log(t),0)/e.length)}};function P(e){const t=[...e].sort((e,t)=>e-t),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}const R={median:e=>P(e)};function M(e,t){const r=q(e);return e.reduce((e,t)=>e+(t-r)**2,0)/e.length}const C={variance:e=>M(e)},O={"sample-variance":e=>function(e){const t=q(e);return e.reduce((e,r)=>e+(r-t)**2,0)/(e.length-1)}(e),minLength:2};function D(e,t){const r=M(e);return Math.sqrt(r)}const $={stdev:e=>D(e)},E={"sample-stdev":e=>function(e){const t=M(e);return Math.sqrt(t*(e.length/(e.length-1)))}(e),minLength:2},L={iqr:e=>{const[t,,r]=S(e);return r-t},minLength:4},F={span:e=>0===e.length?0:Math.max(...e)-Math.min(...e),minLength:0};const j={skewness:e=>function(e){const t=q(e),r=D(e);if(0===r)throw new Error("Standard deviation is zero, skewness is undefined");return e.reduce((e,r)=>e+(r-t)**3,0)/(e.length*r**3)}(e),minLength:3},I={"sample-skewness":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t;let n=0,o=0;for(const t of e){const e=t-r;n+=e*e,o+=e*e*e}const i=n/(t-1),s=Math.sqrt(i);if(0===s)throw new Error("Cannot calculate sample skewness when standard deviation is 0");return t/((t-1)*(t-2))*o/s**3}(e),minLength:3};function V(e){const t=q(e),r=D(e);if(0===r)throw new Error("Standard deviation is zero, kurtosis is undefined");return e.reduce((e,r)=>e+(r-t)**4,0)/(e.length*r**4)}const G={kurtosis:e=>V(e),minLength:4},B={"excess-kurtosis":e=>function(e){return V(e)-3}(e),minLength:4},W={"sample-kurtosis":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t,n=e.reduce((e,t)=>e+(t-r)**2,0)/(t-1);if(0===n)throw new Error("Variance is zero, kurtosis is undefined");return t*(t+1)*e.reduce((e,t)=>e+(t-r)**4,0)/((t-1)*(t-2)*(t-3)*n**2)}(e),minLength:4},J={"sample-excess-kurtosis":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t,n=e.reduce((e,t)=>e+(t-r)**2,0)/(t-1);if(0===n)throw new Error("Variance is zero, kurtosis is undefined");return t*(t+1)*e.reduce((e,t)=>e+(t-r)**4,0)/((t-1)*(t-2)*(t-3)*n**2)-3*(t-1)*(t-1)/((t-2)*(t-3))}(e),minLength:4},Q={rms:e=>Math.sqrt(e.reduce((e,t)=>e+t**2,0)/e.length)};const U={mad:e=>function(e){const t=P(e);return e.reduce((e,r)=>e+Math.abs(r-t),0)/e.length}(e)};const Z={medad:e=>function(e){const t=P(e);return 1.4826*P(e.map(e=>Math.abs(e-t)))}(e)},H={"gini-coefficient":e=>{if(e.some(e=>e<0))throw new Error("Gini coefficient is not defined for negative values");const t=[...e].sort((e,t)=>e-t),r=t.length,n=t.reduce((e,t)=>e+t,0);if(0===n)return 0;return 2*t.reduce((e,t,r)=>e+(r+1)*t,0)/(r*n)-(r+1)/r},minLength:1};const K={entropy:e=>function(e){const t=new Map;for(const r of e)t.set(r,(t.get(r)||0)+1);const r=e.length;let n=0;for(const e of t.values()){const t=e/r;t>0&&(n-=t*Math.log2(t))}return n}(e),minLength:1},X={};function Y(e){for(const[t,r]of Object.entries(e)){if(X[t])throw new Error(`Duplicate normal expression key found: ${t}`);if("minLength"!==t&&"padding"!==t&&"function"==typeof r){const n=r,o=t.replace(/^/,""),i=`moving-${o}`,s=`centered-moving-${o}`,c=`running-${o}`,a=e.minLength??1;g(a,void 0,{integer:!0,finite:!0,gte:0}),X[t]=_(n,a),X[i]=ee(n,a),X[s]=te(n,a,e.padding??null),X[c]=re(n,a)}}}function _(e,r){return{evaluate:([n],o)=>{if(h(n,o),n.length<r)throw new t(`Vector length must be at least ${r}`,o);try{return e(n)}catch(e){throw new t(e,o)}},arity:k(1)}}function ee(e,r){return{evaluate:([n,o],i)=>{if(h(n,i),g(o,i,{integer:!0,finite:!0,gte:r,lte:n.length}),0===n.length)return[];try{if(o>=n.length)return[e(n)];const t=[];for(let r=0;r<n.length-o+1;r+=1)t.push(e(n.slice(r,r+o)));return t}catch(e){throw new t(e,i)}},arity:k(2)}}function te(e,r,n){return{evaluate:([o,i,s,c],a)=>{if(h(o,a),o.length<r)throw new t(`Vector length must be at least ${r}`,a);if(g(i,a,{integer:!0,finite:!0,gte:r,lte:o.length}),null!==(s=s??n)&&g(s,a,{finite:!0}),null!==(c=c??n)&&g(c,a,{finite:!0}),0===o.length)return[];const v=Math.floor(i/2),m=[...Array(v).fill(s),...o,...Array(v).fill(c)],l="number"==typeof s?0:v,p=o.length-("number"==typeof c?0:i-v-1),d=[...Array(l).fill(null)];try{for(let t=l;t<p;t+=1)d.push(e(m.slice(t,t+i)))}catch(e){throw new t(e,a)}return d.push(...Array(o.length-p).fill(null)),d},arity:{min:2,max:4}}}function re(e,r){return{evaluate:([n],o)=>{if(h(n,o),n.length<r)throw new t(`Vector length must be at least ${r}`,o);if(0===n.length)return[];try{const t=Math.max(r-1,0),o=Array(t).fill(null);for(let r=t;r<n.length;r+=1)o.push(e(n.slice(0,r+1)));return o}catch(e){throw new t(e,o)}},arity:k(1)}}Y({mean:e=>q(e)}),Y(A),Y({"harmonic-mean":e=>e.length/e.reduce((e,t)=>e+1/t,0)}),Y(R),Y({sum:e=>e.reduce((e,t)=>e+t,0),minLength:0}),Y({prod:e=>e.reduce((e,t)=>e*t,1),padding:1,minLength:0}),Y(C),Y(O),Y($),Y(E),Y(L),Y(F),Y(j),Y(I),Y(B),Y(G),Y(J),Y(W),Y(Q),Y(U),Y(Z),Y(H),Y(K);const ne={"monotonic?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>=e[r-1])||e.every((t,r)=>0===r||t<=e[r-1])),arity:k(1)},"strictly-monotonic?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>e[r-1])||e.every((t,r)=>0===r||t<e[r-1])),arity:k(1)},"increasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>=e[r-1])),arity:k(1)},"decreasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t<=e[r-1])),arity:k(1)},"strictly-increasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>e[r-1])),arity:k(1)},"strictly-decreasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t<e[r-1])),arity:k(1)},mode:{evaluate:([e],t)=>(y(e,t),function(e){const t=new Map;for(const r of e)t.set(r,(t.get(r)||0)+1);let r=0;for(const e of t.values())e>r&&(r=e);if(1===r)return e;const n=[];for(const[e,o]of t.entries())o===r&&n.push(e);return n}(e)),arity:k(1)},"min-index":{evaluate:([e],t)=>(y(e,t),e.reduce((t,r,n)=>r<e[t]?n:t,0)),arity:k(1)},"max-index":{evaluate:([e],t)=>(y(e,t),e.reduce((t,r,n)=>r>e[t]?n:t,0)),arity:k(1)},"sort-indices":{evaluate:([e],t)=>(h(e,t),[...e.keys()].sort((t,r)=>e[t]-e[r])),arity:k(1)},"count-values":{evaluate:([e],t)=>{h(e,t);const r=new Map;for(const t of e)r.set(t,(r.get(t)||0)+1);return[...r.entries()].sort((e,t)=>{const r=t[1]-e[1];return 0!==r?r:e[0]-t[0]})},arity:k(1)},linspace:{evaluate:([e,t,r],n)=>{if(g(e,n,{finite:!0}),g(t,n,{finite:!0}),g(r,n,{integer:!0,nonNegative:!0}),0===r)return[];if(1===r)return[e];const o=(t-e)/(r-1);return Array.from({length:r},(t,r)=>e+r*o)},arity:k(3)},ones:{evaluate:([e],t)=>(g(e,t,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>1)),arity:k(1)},zeros:{evaluate:([e],t)=>(g(e,t,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>0)),arity:k(1)},fill:{evaluate:([e,t],r)=>(g(e,r,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>t)),arity:k(2)},generate:{evaluate:([e,t],r,n,{executeFunction:o})=>(g(e,r,{integer:!0,nonNegative:!0}),x(t,r),Array.from({length:e},(e,i)=>{const s=o(t,[i],n,r);return g(s,r,{finite:!0}),s})),arity:k(2)},cumsum:{evaluate:([e],t)=>(h(e,t),e.reduce((e,t)=>{const r=e[e.length-1]??0;return e.push(r+t),e},[])),arity:k(1)},cumprod:{evaluate:([e],t)=>(h(e,t),e.reduce((e,t)=>{const r=e[e.length-1]??1;return e.push(r*t),e},[])),arity:k(1)},quartiles:{evaluate:([e],r)=>{if(h(e,r),e.length<4)throw new t("Quartiles require at least four values",r);return S(e)},arity:k(1)},percentile:{evaluate:([e,t],r)=>(y(e,r),g(t,r,{finite:!0,nonNegative:!0,lte:100}),T(e,t)),arity:k(2)},quantile:{evaluate:([e,t],r)=>(h(e,r),g(t,r,{finite:!0,nonNegative:!0,lte:1}),T(e,100*t)),arity:k(2)},histogram:{evaluate:([e,t],r)=>(h(e,r),g(t,r,{integer:!0,positive:!0}),function(e,t){if(0===e.length){const e=[];for(let r=0;r<t;r++)e.push([0,0,0]);return e}const r=Math.min(...e),n=Math.max(...e);if(r===n){const n=[];for(let e=0;e<t;e++)n.push([r,r,0]);return n[0][2]=e.length,n}const o=(n-r)/t,i=[];for(let e=0;e<t;e++){const s=r+e*o,c=e===t-1?n:r+(e+1)*o;i.push([s,c,0])}for(const s of e)s===n?i[t-1][2]+=1:i[Math.min(Math.floor((s-r)/o),t-1)][2]+=1;return i}(e,t)),arity:k(2)},ecdf:{evaluate:([e,t],r)=>{y(e,r),g(t,r,{finite:!0});const n=[...e].sort((e,t)=>e-t),o=n.findIndex(e=>e>t);return-1===o?1:o/n.length},arity:k(2)},"outliers?":{evaluate:([e],t)=>(h(e,t),function(e){return N(e).length>0}(e)),arity:k(1)},outliers:{evaluate:([e],t)=>(h(e,t),N(e)),arity:k(1)},bincount:{evaluate:(e,r)=>{const n=e[0];h(n,r),n.forEach(e=>g(e,r,{finite:!0,integer:!0,nonNegative:!0}));const o=e[1]??0;g(o,r,{integer:!0,nonNegative:!0});const i=e[2]??void 0;if(void 0!==i){if(h(i,r),i.length!==n.length)throw new t("Weights vector must be the same length as the input vector",r);i.forEach(e=>g(e,r,{finite:!0}))}return function(e,t=0,r){if(0===e.length)return Array.from({length:t},()=>0);const n=Math.max(...e),o=Math.max(n+1,t),i=Array.from({length:o},()=>0);for(let t=0;t<e.length;t++){const n=Math.floor(e[t]);n<o&&(i[n]+=r?r[t]:1)}return i}(n,o,i)},arity:{min:1,max:3}},winsorize:{evaluate:([e,t,r],n)=>{if(h(e,n),g(t,n,{finite:!0,gte:0,lte:1}),r??=t>.5?1:1-t,g(r,n,{finite:!0,gte:t,lte:1}),0===e.length)return[];const o=[...e].sort((e,t)=>e-t),i=Math.max(0,Math.floor(t*e.length)),s=Math.min(e.length-1,Math.max(0,Math.floor(r*e.length)-1)),c=o[i],a=o[s];return e.map(e=>Math.max(c,Math.min(e,a)))},arity:{min:2,max:3}},mse:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>e+(t-r[n])**2,0)/e.length},arity:k(2)},rmse:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return Math.sqrt(e.reduce((e,t,n)=>e+(t-r[n])**2,0)/e.length)},arity:k(2)},mae:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>e+Math.abs(t-r[n]),0)/e.length},arity:k(2)},smape:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>{const o=Math.abs(t-r[n]),i=(Math.abs(t)+Math.abs(r[n]))/2;return e+(0===i?0:o/i)},0)/e.length},arity:k(2)}};!function(e){for(const[t,r]of Object.entries(e)){if(ne[t])throw new Error(`Duplicate normal expression key found: ${t}`);ne[t]=r}}(X);for(const[e,t]of Object.entries(z))ne[e]&&(ne[e].docs=t);const oe={name:"vector",functions:ne};exports.vectorModule=oe;
|
|
1
|
+
"use strict";function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,r=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(r,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(r,n){const o=r instanceof Error?r.message:`${r}`;super(function(t,r){if(!r)return t;const n=`${r.position.line}:${r.position.column}`;return`${t}${r.filePath?`\n${r.filePath}:${n}`:`\nLocation ${n}`}\n${r.code}\n${e(r)}`}(o,n)),this.shortMessage=o,this.sourceCodeInfo=n,Object.setPrototypeOf(this,t.prototype),this.name="LitsError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const r={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},n=new Set(Object.values(r));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","Builtin","SpecialBuiltin","NativeJsFunction","Module"]);const i="^^fn^^",s="^^re^^";function c(e){return null!==e&&"object"==typeof e&&(i in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&o.has(t)));var t}function a(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&n.has(t));var t}function v(e){return c(e)?`<function ${e.name||"λ"}>`:a(e)?`${t=e[0],Object.keys(r).find(e=>r[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function m(e,t){return e?.sourceCodeInfo??t}function l(e,t={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(t.integer&&!Number.isInteger(e))&&(!(t.finite&&!Number.isFinite(e))&&((!t.zero||0===e)&&((!t.nonZero||0!==e)&&(!(t.positive&&e<=0)&&(!(t.negative&&e>=0)&&(!(t.nonPositive&&e>0)&&(!(t.nonNegative&&e<0)&&(!("number"==typeof t.gt&&e<=t.gt)&&(!("number"==typeof t.gte&&e<t.gte)&&(!("number"==typeof t.lt&&e>=t.lt)&&!("number"==typeof t.lte&&e>t.lte)))))))))))))}function g(e,r,n={}){if(!l(e,n))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),r=e.integer?"integer":"number",n=e.finite?"finite":"",o=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,n,r,o].filter(e=>!!e).join(" ")}(n)}, got ${v(e)}.`,m(e,r))}const p=new WeakSet,d=new WeakSet,u=new WeakSet;function h(e,r){if(!function(e){return!(!Array.isArray(e)||!d.has(e)&&(u.has(e)||(e.every(e=>l(e))?(p.add(e),d.add(e),0):(u.add(e),1))))}(e))throw new t(`Expected a vector, but got ${e}`,r)}function y(e,r){if(h(e,r),0===e.length)throw new t(`Expected a non empty vector, but got ${e}`,r)}function f(e){return null!==e&&"object"==typeof e&&!!e[i]}function w(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||f(e)||(t=e,null!==t&&"object"==typeof t&&t[s]));var t}function b(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||w(e)}function x(e,r){if(!function(e){return"number"==typeof e||!!b(e)||!!f(e)}(e))throw function(e,r,n){return new t(`Expected ${e}, got ${v(r)}.`,m(r,n))}("FunctionLike",e,r)}function k(e){return{min:e,max:e}}async function z(e,t,r,n,o){t.push(await e);for(let e=o+1;e<r.length;e++)t.push(await n(r[e],e));return t}const N={mean:{category:"vector",description:"Returns the **mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **mean** of."}},variants:[{argumentNames:["vector"]}],examples:["mean([1, 2, 3])","mean([1, 2, -3])"],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"]},"moving-mean":{category:"vector",description:"Returns the **moving mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-mean } = import("vector");\nmoving-mean([1, 2, 3, 4, 5], 3)','let { moving-mean } = import("vector");\nmoving-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["moving-fn","vector.mean","vector.centered-moving-mean","vector.running-mean"]},"centered-moving-mean":{category:"vector",description:"Returns the **centered moving mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-mean } = import("vector");\ncentered-moving-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.mean","vector.moving-mean","vector.running-mean"]},"running-mean":{category:"vector",description:"Returns the **running mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-mean } = import("vector");\nrunning-mean([1, 2, 3, 4, 5])'],seeAlso:["running-fn","vector.mean","vector.moving-mean","vector.centered-moving-mean"]},"geometric-mean":{category:"vector",description:"Returns the **geometric mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **geometric mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { geometric-mean } = import("vector");\ngeometric-mean([1, 2, 3])','let { geometric-mean } = import("vector");\ngeometric-mean([1, 2, 9])'],seeAlso:["vector.moving-geometric-mean","vector.centered-moving-geometric-mean","vector.running-geometric-mean","vector.mean","vector.harmonic-mean"]},"moving-geometric-mean":{category:"vector",description:"Returns the **moving geometric mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving geometric mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-geometric-mean } = import("vector");\nmoving-geometric-mean([1, 2, 3, 4, 5], 3)','let { moving-geometric-mean } = import("vector");\nmoving-geometric-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.geometric-mean","vector.centered-moving-geometric-mean","vector.running-geometric-mean"]},"centered-moving-geometric-mean":{category:"vector",description:"Returns the **centered moving geometric mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving geometric mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-geometric-mean } = import("vector");\ncentered-moving-geometric-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.geometric-mean","vector.moving-geometric-mean","vector.running-geometric-mean"]},"running-geometric-mean":{category:"vector",description:"Returns the **running geometric mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running geometric mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-geometric-mean } = import("vector");\nrunning-geometric-mean([1, 2, 3, 4, 5])'],seeAlso:["vector.geometric-mean","vector.moving-geometric-mean","vector.centered-moving-geometric-mean"]},"harmonic-mean":{category:"vector",description:"Returns the **harmonic mean** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **harmonic mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { harmonic-mean } = import("vector");\nharmonic-mean([1, 2, 3])','let { harmonic-mean } = import("vector");\nharmonic-mean([1, 2, 9])'],seeAlso:["vector.moving-harmonic-mean","vector.centered-moving-harmonic-mean","vector.running-harmonic-mean","vector.mean","vector.geometric-mean"]},"moving-harmonic-mean":{category:"vector",description:"Returns the **moving harmonic mean** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving harmonic mean** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-harmonic-mean } = import("vector");\nmoving-harmonic-mean([1, 2, 3, 4, 5], 3)','let { moving-harmonic-mean } = import("vector");\nmoving-harmonic-mean([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.harmonic-mean","vector.centered-moving-harmonic-mean","vector.running-harmonic-mean"]},"centered-moving-harmonic-mean":{category:"vector",description:"Returns the **centered moving harmonic mean** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving harmonic mean** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3)','let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-harmonic-mean } = import("vector");\ncentered-moving-harmonic-mean([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.harmonic-mean","vector.moving-harmonic-mean","vector.running-harmonic-mean"]},"running-harmonic-mean":{category:"vector",description:"Returns the **running harmonic mean** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running harmonic mean** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-harmonic-mean } = import("vector");\nrunning-harmonic-mean([1, 2, 3, 4, 5])'],seeAlso:["vector.harmonic-mean","vector.moving-harmonic-mean","vector.centered-moving-harmonic-mean"]},median:{category:"vector",description:"Returns the median of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the median of."}},variants:[{argumentNames:["vector"]}],examples:["median([1, 2, 3])","median([1, 2, -3])","median([1, 2, 3, 4])","median([1, 2, -3, 4])"],seeAlso:["median","vector.moving-median","vector.centered-moving-median","vector.running-median","vector.mean","vector.mode","vector.quartiles","vector.percentile","vector.iqr","vector.medad"]},"moving-median":{category:"vector",description:"Returns the **moving median** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving median** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-median } = import("vector");\nmoving-median([1, 2, 3, 4, 5], 3)','let { moving-median } = import("vector");\nmoving-median([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.median","vector.centered-moving-median","vector.running-median"]},"centered-moving-median":{category:"vector",description:"Returns the **centered moving median** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving median** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3)','let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3, 0, 10)','let { centered-moving-median } = import("vector");\ncentered-moving-median([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.median","vector.moving-median","vector.running-median"]},"running-median":{category:"vector",description:"Returns the **running median** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running median** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-median } = import("vector");\nrunning-median([1, 2, 3, 4, 5])'],seeAlso:["vector.median","vector.moving-median","vector.centered-moving-median"]},variance:{category:"vector",description:"Returns the **variance** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **variance** of."}},variants:[{argumentNames:["vector"]}],examples:['let { variance } = import("vector");\nvariance([1, 2, 3])','let { variance } = import("vector");\nvariance([1, 2, -3])'],seeAlso:["linear-algebra.cov","vector.moving-variance","vector.centered-moving-variance","vector.running-variance","vector.stdev","vector.sample-variance","vector.mad"]},"moving-variance":{category:"vector",description:"Returns the **moving variance** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving variance** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-variance } = import("vector");\nmoving-variance([1, 2, 3, 4, 5], 3)','let { moving-variance } = import("vector");\nmoving-variance([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.variance","vector.centered-moving-variance","vector.running-variance"]},"centered-moving-variance":{category:"vector",description:"Returns the **centered moving variance** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving variance** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-variance } = import("vector");\ncentered-moving-variance([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.variance","vector.moving-variance","vector.running-variance"]},"running-variance":{category:"vector",description:"Returns the **running variance** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running variance** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-variance } = import("vector");\nrunning-variance([1, 2, 3, 4, 5])'],seeAlso:["vector.variance","vector.moving-variance","vector.centered-moving-variance"]},"sample-variance":{category:"vector",description:"Returns the sample variance of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sample variance of."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-variance } = import("vector");\nsample-variance([1, 2, 3])','let { sample-variance } = import("vector");\nsample-variance([1, 2, -3])','let { sample-variance } = import("vector");\nsample-variance([1, 2, 3, 4])','let { sample-variance } = import("vector");\nsample-variance([1, 2, -3, 4])','let { sample-variance } = import("vector");\nsample-variance([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-sample-variance","vector.centered-moving-sample-variance","vector.running-sample-variance","vector.variance","vector.sample-stdev"]},"moving-sample-variance":{category:"vector",description:"Returns the **moving sample variance** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample variance** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-variance } = import("vector");\nmoving-sample-variance([1, 2, 3, 4, 5], 3)','let { moving-sample-variance } = import("vector");\nmoving-sample-variance([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sample-variance","vector.centered-moving-sample-variance","vector.running-sample-variance"]},"centered-moving-sample-variance":{category:"vector",description:"Returns the **centered moving sample variance** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample variance** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-sample-variance } = import("vector");\ncentered-moving-sample-variance([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.sample-variance","vector.moving-sample-variance","vector.running-sample-variance"]},"running-sample-variance":{category:"vector",description:"Returns the **running sample variance** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",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."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-variance } = import("vector");\nrunning-sample-variance([1, 2, 3, 4, 5])'],seeAlso:["vector.sample-variance","vector.moving-sample-variance","vector.centered-moving-sample-variance"]},stdev:{category:"vector",description:"Returns the standard deviation of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the standard deviation of."}},variants:[{argumentNames:["vector"]}],examples:['let { stdev } = import("vector");\nstdev([1, 2, 3])','let { stdev } = import("vector");\nstdev([1, 2, -3])','let { stdev } = import("vector");\nstdev([1, 2, 3, 4])','let { stdev } = import("vector");\nstdev([1, 2, -3, 4])','let { stdev } = import("vector");\nstdev([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-stdev","vector.centered-moving-stdev","vector.running-stdev","vector.variance","vector.sample-stdev","vector.rms","vector.mad"]},"moving-stdev":{category:"vector",description:"Returns the **moving standard deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving standard deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-stdev } = import("vector");\nmoving-stdev([1, 2, 3, 4, 5], 3)','let { moving-stdev } = import("vector");\nmoving-stdev([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.stdev","vector.centered-moving-stdev","vector.running-stdev"]},"centered-moving-stdev":{category:"vector",description:"Returns the **centered moving standard deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving standard deviation** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-stdev } = import("vector");\ncentered-moving-stdev([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.stdev","vector.moving-stdev","vector.running-stdev"]},"running-stdev":{category:"vector",description:"Returns the **running standard deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running standard deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-stdev } = import("vector");\nrunning-stdev([1, 2, 3, 4, 5])'],seeAlso:["vector.stdev","vector.moving-stdev","vector.centered-moving-stdev"]},"sample-stdev":{category:"vector",description:"Returns the sample standard deviation of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sample standard deviation of."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, -3])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3, 4])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, -3, 4])','let { sample-stdev } = import("vector");\nsample-stdev([1, 2, 3, 40, 50])'],seeAlso:["vector.moving-sample-stdev","vector.centered-moving-sample-stdev","vector.running-sample-stdev","vector.stdev","vector.sample-variance"]},"moving-sample-stdev":{category:"vector",description:"Returns the **moving sample standard deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample standard deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-stdev } = import("vector");\nmoving-sample-stdev([1, 2, 3, 4, 5], 3)','let { moving-sample-stdev } = import("vector");\nmoving-sample-stdev([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sample-stdev","vector.centered-moving-sample-stdev","vector.running-sample-stdev"]},"centered-moving-sample-stdev":{category:"vector",description:"Returns the **centered moving sample standard deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample standard deviation** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 1, 5)','let { centered-moving-sample-stdev } = import("vector");\ncentered-moving-sample-stdev([1, 2, 3, 4, 5], 3, 0, 6)'],seeAlso:["vector.sample-stdev","vector.moving-sample-stdev","vector.running-sample-stdev"]},"running-sample-stdev":{category:"vector",description:"Returns the **running sample standard deviation** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",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."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-stdev } = import("vector");\nrunning-sample-stdev([1, 2, 3, 4, 5])'],seeAlso:["vector.sample-stdev","vector.moving-sample-stdev","vector.centered-moving-sample-stdev"]},iqr:{category:"vector",description:"Calculates the **interquartile range** of a `vector`. Returns the difference between the third and first quartiles.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **interquartile range** of. Minimum length is 4."}},variants:[{argumentNames:["vector"]}],examples:['let { iqr } = import("vector");\niqr([1, 2, 3, 4])','let { iqr } = import("vector");\niqr([5, 4, 3, 2, 1, 2, 3, 4, 5])','let { iqr } = import("vector");\niqr(range(1, 1000))','let { iqr, generate } = import("vector");\niqr(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { iqr, generate } = import("vector");\nlet { ln } = import("math");\niqr(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.moving-iqr","vector.centered-moving-iqr","vector.running-iqr","vector.quartiles","vector.median","vector.mad","vector.medad","vector.outliers?","vector.outliers"]},"moving-iqr":{category:"vector",description:"Calculates the **moving interquartile range** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving interquartile range** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 4)','let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 5)','let { moving-iqr } = import("vector");\nmoving-iqr([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.iqr","vector.centered-moving-iqr","vector.running-iqr"]},"centered-moving-iqr":{category:"vector",description:"Calculates the **centered moving interquartile range** of a `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving interquartile range** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-iqr } = import("vector");\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-iqr } = import("vector");\ncentered-moving-iqr([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.iqr","vector.moving-iqr","vector.running-iqr"]},"running-iqr":{category:"vector",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.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running interquartile range** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-iqr } = import("vector");\nrunning-iqr([1, 2, 3, 4, 5, 6])','let { running-iqr } = import("vector");\nrunning-iqr([-1, -2, -3, 1, 2, 3])'],seeAlso:["vector.iqr","vector.moving-iqr","vector.centered-moving-iqr"]},sum:{category:"vector",description:"Returns the sum of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to sum."}},variants:[{argumentNames:["vector"]}],examples:["sum([1, 2, 3])","sum([1, 2, -3])"],seeAlso:["sum","vector.moving-sum","vector.centered-moving-sum","vector.running-sum","vector.prod","vector.cumsum","vector.mean"]},"moving-sum":{category:"vector",description:"Returns the **moving sum** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sum** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sum } = import("vector");\nmoving-sum([1, 2, 3, 4, 5], 3)','let { moving-sum } = import("vector");\nmoving-sum([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.sum","vector.centered-moving-sum","vector.running-sum"]},"centered-moving-sum":{category:"vector",description:"Returns the **centered moving sum** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sum** of."},windowSize:{type:"integer",description:"The size of the centered moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3)','let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 0, 0)','let { centered-moving-sum } = import("vector");\ncentered-moving-sum([1, 2, 3, 4, 5], 3, 10)'],seeAlso:["vector.sum","vector.moving-sum","vector.running-sum"]},"running-sum":{category:"vector",description:"Returns the **running sum** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sum** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sum } = import("vector");\nrunning-sum([1, 2, 3])','let { running-sum } = import("vector");\nrunning-sum([1, -2, -3])'],seeAlso:["vector.sum","vector.moving-sum","vector.centered-moving-sum","vector.cumsum"]},prod:{category:"vector",description:"Returns the **product** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **product** of."}},variants:[{argumentNames:["vector"]}],examples:["prod([1, 2, 3])","prod([1, 2, -3])"],seeAlso:["prod","vector.moving-prod","vector.centered-moving-prod","vector.running-prod","vector.sum","vector.cumprod"]},"moving-prod":{category:"vector",description:"Returns the **moving product** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving product** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-prod } = import("vector");\nmoving-prod([1, 2, 3, 4, 5], 3)','let { moving-prod } = import("vector");\nmoving-prod([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.prod","vector.centered-moving-prod","vector.running-prod"]},"centered-moving-prod":{category:"vector",description:"Returns the **centered moving product** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving product** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-prod } = import("vector");\ncentered-moving-prod([1, 2, 3, 4, 5], 3)','let { centered-moving-prod } = import("vector");\ncentered-moving-prod([1, 2, 3, 4, 5], 3, 0, 0)'],seeAlso:["vector.prod","vector.moving-prod","vector.running-prod"]},"running-prod":{category:"vector",description:"Returns the **running product** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running product** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-prod } = import("vector");\nrunning-prod([1, 2, 3, 4, 5])','let { running-prod } = import("vector");\nrunning-prod([1, -2, -3])'],seeAlso:["vector.prod","vector.moving-prod","vector.centered-moving-prod","vector.cumprod"]},span:{category:"vector",description:"Returns the difference between the maximum and minimum values in a vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the span of."}},variants:[{argumentNames:["vector"]}],examples:['let { span } = import("vector");\nspan([1, 2, 3])','let { span } = import("vector");\nspan([1, 1, 2, 3, 3])','let { span } = import("vector");\nspan([1, 2, -3])'],seeAlso:["vector.moving-span","vector.centered-moving-span","vector.running-span","min","max"]},"moving-span":{category:"vector",description:"Calculates the **moving span** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving span** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 4)','let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 5)','let { moving-span } = import("vector");\nmoving-span([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.span","vector.centered-moving-span","vector.running-span"]},"centered-moving-span":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving span** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"The value to pad the result with on the left."},rightPadding:{type:"number",description:"The value to pad the result with on the right."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-span } = import("vector");\ncentered-moving-span([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-span } = import("vector");\ncentered-moving-span([1, 2, 4, 7, 11, 16], 3, 0, 100)'],seeAlso:["vector.span","vector.moving-span","vector.running-span"]},"running-span":{category:"vector",description:"Calculates the **running span** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running span** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-span } = import("vector");\nrunning-span([1, 2, 4])'],seeAlso:["vector.span","vector.moving-span","vector.centered-moving-span"]},skewness:{category:"vector",description:"Calculates the **skewness** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **skewness** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { skewness } = import("vector");\nskewness([1, 2, 3, 6, 20])','let { skewness } = import("vector");\nskewness([1, 2, 2, 3])'],seeAlso:["vector.moving-skewness","vector.centered-moving-skewness","vector.running-skewness","vector.kurtosis","vector.sample-skewness","vector.excess-kurtosis"]},"moving-skewness":{category:"vector",description:"Calculates the **moving skewness** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-skewness } = import("vector");\nmoving-skewness([1, 2, 4, 7, 11, 16], 4)','let { moving-skewness } = import("vector");\nmoving-skewness([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.skewness","vector.centered-moving-skewness","vector.running-skewness"]},"centered-moving-skewness":{category:"vector",description:"Calculates the **centered moving skewness** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-skewness } = import("vector");\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-skewness } = import("vector");\ncentered-moving-skewness([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.skewness","vector.moving-skewness","vector.running-skewness"]},"running-skewness":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running skewness** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-skewness } = import("vector");\nrunning-skewness([1, 2, 4, 7, 11])'],seeAlso:["vector.skewness","vector.moving-skewness","vector.centered-moving-skewness"]},"sample-skewness":{category:"vector",description:"Calculates the **sample skewness** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample skewness** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-skewness } = import("vector");\nsample-skewness([1, 2, 3, 6, 20])','let { sample-skewness } = import("vector");\nsample-skewness([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-skewness","vector.centered-moving-sample-skewness","vector.running-sample-skewness","vector.skewness","vector.sample-kurtosis"]},"moving-sample-skewness":{category:"vector",description:"Calculates the **moving sample skewness** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-skewness } = import("vector");\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-skewness } = import("vector");\nmoving-sample-skewness([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-skewness","vector.centered-moving-sample-skewness","vector.running-sample-skewness"]},"centered-moving-sample-skewness":{category:"vector",description:"Calculates the **centered moving sample skewness** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample skewness** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-skewness } = import("vector");\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-skewness } = import("vector");\ncentered-moving-sample-skewness([1, 2, 4, 7, 11, 16], 3, 0, 100)'],seeAlso:["vector.sample-skewness","vector.moving-sample-skewness","vector.running-sample-skewness"]},"running-sample-skewness":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample skewness** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-skewness } = import("vector");\nrunning-sample-skewness([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-skewness","vector.moving-sample-skewness","vector.centered-moving-sample-skewness"]},"excess-kurtosis":{category:"vector",description:"Calculates the **excess kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **excess kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { excess-kurtosis } = import("vector");\nexcess-kurtosis([1, 2, 3, 6, 20])','let { excess-kurtosis } = import("vector");\nexcess-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-excess-kurtosis","vector.centered-moving-excess-kurtosis","vector.running-excess-kurtosis","vector.kurtosis","vector.sample-excess-kurtosis","vector.skewness"]},"moving-excess-kurtosis":{category:"vector",description:"Calculates the **moving excess kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-excess-kurtosis } = import("vector");\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-excess-kurtosis } = import("vector");\nmoving-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.excess-kurtosis","vector.centered-moving-excess-kurtosis","vector.running-excess-kurtosis"]},"centered-moving-excess-kurtosis":{category:"vector",description:"Calculates the **centered moving excess kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-excess-kurtosis } = import("vector");\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-excess-kurtosis } = import("vector");\ncentered-moving-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.excess-kurtosis","vector.moving-excess-kurtosis","vector.running-excess-kurtosis"]},"running-excess-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running excess kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-excess-kurtosis } = import("vector");\nrunning-excess-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.excess-kurtosis","vector.moving-excess-kurtosis","vector.centered-moving-excess-kurtosis"]},kurtosis:{category:"vector",description:"Calculates the **kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { kurtosis } = import("vector");\nkurtosis([1, 2, 3, 6, 20])','let { kurtosis } = import("vector");\nkurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-kurtosis","vector.centered-moving-kurtosis","vector.running-kurtosis","vector.excess-kurtosis","vector.sample-kurtosis","vector.skewness"]},"moving-kurtosis":{category:"vector",description:"Calculates the **moving kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-kurtosis } = import("vector");\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-kurtosis } = import("vector");\nmoving-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.kurtosis","vector.centered-moving-kurtosis","vector.running-kurtosis"]},"centered-moving-kurtosis":{category:"vector",description:"Calculates the **centered moving kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-kurtosis } = import("vector");\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-kurtosis } = import("vector");\ncentered-moving-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 0)'],seeAlso:["vector.kurtosis","vector.moving-kurtosis","vector.running-kurtosis"]},"running-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-kurtosis } = import("vector");\nrunning-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.kurtosis","vector.moving-kurtosis","vector.centered-moving-kurtosis"]},"sample-excess-kurtosis":{category:"vector",description:"Calculates the **sample excess kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample excess kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-excess-kurtosis } = import("vector");\nsample-excess-kurtosis([1, 2, 3, 6, 20])','let { sample-excess-kurtosis } = import("vector");\nsample-excess-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis","vector.sample-kurtosis","vector.excess-kurtosis"]},"moving-sample-excess-kurtosis":{category:"vector",description:"Calculates the **moving sample excess kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-excess-kurtosis } = import("vector");\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-excess-kurtosis } = import("vector");\nmoving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis"]},"centered-moving-sample-excess-kurtosis":{category:"vector",description:"Calculates the **centered moving sample excess kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample excess kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-excess-kurtosis } = import("vector");\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-excess-kurtosis } = import("vector");\ncentered-moving-sample-excess-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)'],seeAlso:["vector.sample-excess-kurtosis","vector.moving-sample-excess-kurtosis","vector.running-sample-excess-kurtosis"]},"running-sample-excess-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample excess kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-excess-kurtosis } = import("vector");\nrunning-sample-excess-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-excess-kurtosis","vector.moving-sample-excess-kurtosis","vector.centered-moving-sample-excess-kurtosis"]},"sample-kurtosis":{category:"vector",description:"Calculates the **sample kurtosis** of a `vector`. Returns the third standardized moment.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **sample kurtosis** of. Minimum length is 3."}},variants:[{argumentNames:["vector"]}],examples:['let { sample-kurtosis } = import("vector");\nsample-kurtosis([1, 2, 3, 6, 20])','let { sample-kurtosis } = import("vector");\nsample-kurtosis([1, 2, 2, 3])'],seeAlso:["vector.moving-sample-kurtosis","vector.centered-moving-sample-kurtosis","vector.running-sample-kurtosis","vector.sample-excess-kurtosis","vector.kurtosis","vector.sample-skewness"]},"moving-sample-kurtosis":{category:"vector",description:"Calculates the **moving sample kurtosis** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving sample kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-sample-kurtosis } = import("vector");\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { moving-sample-kurtosis } = import("vector");\nmoving-sample-kurtosis([1, 2, 4, 7, 11, 16], 5)'],seeAlso:["vector.sample-kurtosis","vector.centered-moving-sample-kurtosis","vector.running-sample-kurtosis"]},"centered-moving-sample-kurtosis":{category:"vector",description:"Calculates the **centered moving sample kurtosis** of a `vector` with a given window size and padding.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving sample kurtosis** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-sample-kurtosis } = import("vector");\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-sample-kurtosis } = import("vector");\ncentered-moving-sample-kurtosis([1, 2, 4, 7, 11, 16], 4, 0, 100)'],seeAlso:["vector.sample-kurtosis","vector.moving-sample-kurtosis","vector.running-sample-kurtosis"]},"running-sample-kurtosis":{category:"vector",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.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running sample kurtosis** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-sample-kurtosis } = import("vector");\nrunning-sample-kurtosis([1, 2, 4, 7, 11])'],seeAlso:["vector.sample-kurtosis","vector.moving-sample-kurtosis","vector.centered-moving-sample-kurtosis"]},rms:{category:"vector",description:"Calculates the **root mean square** of a `vector`. Returns the square root of the average of the squares of the elements.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **root mean square** of. Minimum length is 1."}},variants:[{argumentNames:["vector"]}],examples:['let { rms } = import("vector");\nrms([1, 2, 3, 4])','let { rms } = import("vector");\nrms([5, 4, 3, 2, 1])','let { rms } = import("vector");\nrms(range(1, 1000))','let { rms, generate } = import("vector");\nrms(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { rms, generate } = import("vector");\nlet { ln } = import("math");\nrms(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.moving-rms","vector.centered-moving-rms","vector.running-rms","vector.mean","vector.stdev"]},"moving-rms":{category:"vector",description:"Calculates the **moving root mean square** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving root mean square** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 4)','let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 5)','let { moving-rms } = import("vector");\nmoving-rms([1, 2, 4, 7, 11, 16], 6)'],seeAlso:["vector.rms","vector.centered-moving-rms","vector.running-rms"]},"centered-moving-rms":{category:"vector",description:"Calculates the **centered moving root mean square** of a `vector` with a given window size and padding value.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving root mean square** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 4)','let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 5, 0)','let { centered-moving-rms } = import("vector");\ncentered-moving-rms([1, 2, 4, 7, 11, 16], 6, 0, 0)'],seeAlso:["vector.rms","vector.moving-rms","vector.running-rms"]},"running-rms":{category:"vector",description:"Calculates the **running root mean square** of a `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running root mean square** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-rms } = import("vector");\nrunning-rms([1, 2, 3, 4, 5, 6])','let { running-rms } = import("vector");\nrunning-rms([1, -3, 2])','let { running-rms } = import("vector");\nrunning-rms([-1, -2, -3])','let { running-rms } = import("vector");\nrunning-rms([0])'],seeAlso:["vector.rms","vector.moving-rms","vector.centered-moving-rms"]},mad:{category:"vector",description:"Returns the **mean absolute deviation** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **mean absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { mad } = import("vector");\nmad([1, 2, 3])','let { mad } = import("vector");\nmad([1, 2, -3])'],seeAlso:["vector.moving-mad","vector.centered-moving-mad","vector.running-mad","vector.medad","vector.stdev","vector.variance","vector.iqr"]},"moving-mad":{category:"vector",description:"Returns the **moving mean absolute deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving mean absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-mad } = import("vector");\nmoving-mad([1, 2, 3, 4, 5], 3)','let { moving-mad } = import("vector");\nmoving-mad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.mad","vector.centered-moving-mad","vector.running-mad"]},"centered-moving-mad":{category:"vector",description:"Returns the **centered moving mean absolute deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving mean absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-mad } = import("vector");\ncentered-moving-mad([1, 2, 3, 4, 5], 3)','let { centered-moving-mad } = import("vector");\ncentered-moving-mad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.mad","vector.moving-mad","vector.running-mad"]},"running-mad":{category:"vector",description:"Returns the **running mean absolute deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running mean absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-mad } = import("vector");\nrunning-mad([1, 2, 3])','let { running-mad } = import("vector");\nrunning-mad([1, 2, -3])'],seeAlso:["vector.mad","vector.moving-mad","vector.centered-moving-mad"]},medad:{category:"vector",description:"Returns the **median absolute deviation** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **median absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { medad } = import("vector");\nmedad([1, 2, 3])','let { medad } = import("vector");\nmedad([1, 2, -3])'],seeAlso:["vector.moving-medad","vector.centered-moving-medad","vector.running-medad","vector.mad","vector.median","vector.iqr"]},"moving-medad":{category:"vector",description:"Returns the **moving median absolute deviation** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving median absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-medad } = import("vector");\nmoving-medad([1, 2, 3, 4, 5], 3)','let { moving-medad } = import("vector");\nmoving-medad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.medad","vector.centered-moving-medad","vector.running-medad"]},"centered-moving-medad":{category:"vector",description:"Returns the **centered moving median absolute deviation** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving median absolute deviation** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-medad } = import("vector");\ncentered-moving-medad([1, 2, 3, 4, 5], 3)','let { centered-moving-medad } = import("vector");\ncentered-moving-medad([1, 2, 3, 4, 5], 5)'],seeAlso:["vector.medad","vector.moving-medad","vector.running-medad"]},"running-medad":{category:"vector",description:"Returns the **running median absolute deviation** of the `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running median absolute deviation** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-medad } = import("vector");\nrunning-medad([1, 2, 3])','let { running-medad } = import("vector");\nrunning-medad([1, 2, -3])'],seeAlso:["vector.medad","vector.moving-medad","vector.centered-moving-medad"]},"gini-coefficient":{category:"vector",description:"Returns the **gini coefficient** of all elements in the `vector`.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **gini coefficient** of."}},variants:[{argumentNames:["vector"]}],examples:['let { gini-coefficient } = import("vector");\ngini-coefficient([1, 2, 3])','let { gini-coefficient } = import("vector");\ngini-coefficient([1, 1, 3])'],seeAlso:["vector.moving-gini-coefficient","vector.centered-moving-gini-coefficient","vector.running-gini-coefficient","vector.entropy"]},"moving-gini-coefficient":{category:"vector",description:"Returns the **moving gini coefficient** of the `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving gini coefficient** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-gini-coefficient } = import("vector");\nmoving-gini-coefficient([1, 2, 3], 2)','let { moving-gini-coefficient } = import("vector");\nmoving-gini-coefficient([1, 1, 3], 2)'],seeAlso:["vector.gini-coefficient","vector.centered-moving-gini-coefficient","vector.running-gini-coefficient"]},"centered-moving-gini-coefficient":{category:"vector",description:"Returns the **centered moving gini coefficient** of the `vector` with a given window size.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving gini coefficient** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-gini-coefficient } = import("vector");\ncentered-moving-gini-coefficient([1, 2, 3], 2)','let { centered-moving-gini-coefficient } = import("vector");\ncentered-moving-gini-coefficient([1, 1, 3], 2)'],seeAlso:["vector.gini-coefficient","vector.moving-gini-coefficient","vector.running-gini-coefficient"]},"running-gini-coefficient":{category:"vector",description:"Returns the **running gini coefficient** of the `vector`.",returns:{type:"array"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running gini coefficient** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-gini-coefficient } = import("vector");\nrunning-gini-coefficient([1, 2, 3])','let { running-gini-coefficient } = import("vector");\nrunning-gini-coefficient([1, 1, 3])'],seeAlso:["vector.gini-coefficient","vector.moving-gini-coefficient","vector.centered-moving-gini-coefficient"]},entropy:{category:"vector",description:"Calculates the **entropy** of a `vector`. The entropy is a measure of the uncertainty associated with a random variable.",returns:{type:"number"},args:{vector:{type:"vector",description:"The `vector` to calculate the **entropy** of. Minimum length is 1."}},variants:[{argumentNames:["vector"]}],examples:['let { entropy } = import("vector");\nentropy([1, 1, 2, 3, 3, 3])','let { entropy } = import("vector");\nentropy([1, 2, 3])','let { entropy } = import("vector");\nentropy([1, 2, 2, 3])','let { entropy } = import("vector");\nentropy([0])','let { entropy } = import("vector");\nentropy([1])','let { entropy } = import("vector");\nentropy([1, 2])'],seeAlso:["vector.moving-entropy","vector.centered-moving-entropy","vector.running-entropy","vector.gini-coefficient"]},"moving-entropy":{category:"vector",description:"Calculates the **moving entropy** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **moving entropy** of."},windowSize:{type:"integer",description:"The size of the moving window."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]}],examples:['let { moving-entropy } = import("vector");\nmoving-entropy([1, 1, 2, 3, 3, 3], 4)','let { moving-entropy } = import("vector");\nmoving-entropy([1, 1, 2, 3, 3, 3], 3)','let { moving-entropy } = import("vector");\nmoving-entropy([1, 2], 2)'],seeAlso:["vector.entropy","vector.centered-moving-entropy","vector.running-entropy"]},"centered-moving-entropy":{category:"vector",description:"Calculates the **centered moving entropy** of a `vector` with a given window size.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **centered moving entropy** of."},windowSize:{type:"integer",description:"The size of the moving window."},leftPadding:{type:"number",description:"Optional value to use for padding. Default is `null`."},rightPadding:{type:"number",description:"Optional value to use for right padding. Default is `null`."},a:{type:"vector"},b:{type:"integer"}},variants:[{argumentNames:["vector","windowSize"]},{argumentNames:["vector","windowSize","leftPadding"]},{argumentNames:["vector","windowSize","leftPadding","rightPadding"]}],examples:['let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 4)','let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 1, 2, 3, 3, 3], 3)','let { centered-moving-entropy } = import("vector");\ncentered-moving-entropy([1, 2], 2)'],seeAlso:["vector.entropy","vector.moving-entropy","vector.running-entropy"]},"running-entropy":{category:"vector",description:"Calculates the **running entropy** of a `vector`.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The `vector` to calculate the **running entropy** of."}},variants:[{argumentNames:["vector"]}],examples:['let { running-entropy } = import("vector");\nrunning-entropy([1, 1, 2, 3, 3, 3])','let { running-entropy } = import("vector");\nrunning-entropy([1, 2])'],seeAlso:["vector.entropy","vector.moving-entropy","vector.centered-moving-entropy"]},"monotonic?":{category:"vector",description:"Checks if a vector is monotonic.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { monotonic? } = import("vector");\nmonotonic?([1, 2, 3])','let { monotonic? } = import("vector");\nmonotonic?([1, 2, 2, 3])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1, 1])','let { monotonic? } = import("vector");\nmonotonic?([3, 2, 1, 2])','let { monotonic? } = import("vector");\nmonotonic?([1])','let { monotonic? } = import("vector");\nmonotonic?([])'],seeAlso:["vector.strictly-monotonic?","vector.increasing?","vector.decreasing?"]},"strictly-monotonic?":{category:"vector",description:"Checks if a vector is strictly monotonic.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1, 2, 3])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1, 2, 2, 3])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1, 1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([3, 2, 1, 2])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([1])','let { strictly-monotonic? } = import("vector");\nstrictly-monotonic?([])'],seeAlso:["vector.monotonic?","vector.strictly-increasing?","vector.strictly-decreasing?"]},"increasing?":{category:"vector",description:"Checks if a vector is increasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { increasing? } = import("vector");\nincreasing?([1, 2, 3])','let { increasing? } = import("vector");\nincreasing?([1, 2, 2, 3])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1, 1])','let { increasing? } = import("vector");\nincreasing?([3, 2, 1, 2])','let { increasing? } = import("vector");\nincreasing?([1])','let { increasing? } = import("vector");\nincreasing?([])'],seeAlso:["vector.strictly-increasing?","vector.decreasing?","vector.strictly-decreasing?","vector.monotonic?"]},"decreasing?":{category:"vector",description:"Checks if a vector is decreasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { decreasing? } = import("vector");\ndecreasing?([1, 2, 3])','let { decreasing? } = import("vector");\ndecreasing?([1, 2, 2, 3])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1, 1])','let { decreasing? } = import("vector");\ndecreasing?([3, 2, 1, 2])','let { decreasing? } = import("vector");\ndecreasing?([1])','let { decreasing? } = import("vector");\ndecreasing?([])'],seeAlso:["vector.strictly-decreasing?","vector.increasing?","vector.strictly-increasing?","vector.monotonic?"]},"strictly-increasing?":{category:"vector",description:"Checks if a vector is strictly increasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1, 2, 3])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1, 2, 2, 3])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1, 1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([3, 2, 1, 2])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([1])','let { strictly-increasing? } = import("vector");\nstrictly-increasing?([])'],seeAlso:["vector.increasing?","vector.decreasing?","vector.strictly-decreasing?","vector.strictly-monotonic?"]},"strictly-decreasing?":{category:"vector",description:"Checks if a vector is strictly decreasing.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The vector to check."}},variants:[{argumentNames:["vector"]}],examples:['let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1, 2, 3])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1, 2, 2, 3])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1, 1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([3, 2, 1, 2])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([1])','let { strictly-decreasing? } = import("vector");\nstrictly-decreasing?([])'],seeAlso:["vector.increasing?","vector.strictly-increasing?","vector.decreasing?","vector.strictly-monotonic?"]},mode:{category:"vector",description:"Returns the mode of all elements in the vector.",returns:{type:"number"},args:{vector:{type:"vector",description:"The vector to calculate the mode of."}},variants:[{argumentNames:["vector"]}],examples:['let { mode } = import("vector");\nmode([1, 2, 3])','let { mode } = import("vector");\nmode([1, 2, -3, 1])','let { mode } = import("vector");\nmode([2, 2, 3, 3, 4])','let { mode } = import("vector");\nmode([2, 2, 3, 3])','let { mode } = import("vector");\nmode([1, 2, 3, 2, 1, 2])'],seeAlso:["vector.mean","vector.median"]},"min-index":{category:"vector",description:"Returns the index of the minimum value of all elements in the vector.",returns:{type:"integer"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the minimum index of."}},variants:[{argumentNames:["vector"]}],examples:['let { min-index } = import("vector");\nmin-index([1, 2, 3])','let { min-index } = import("vector");\nmin-index([1, 1, 2, 3, 3])','let { min-index } = import("vector");\nmin-index([1, 2, -3])','let { min-index } = import("vector");\nmin-index([1, 2, 3, 4])','let { min-index } = import("vector");\nmin-index([1, 2, -3, 4])'],seeAlso:["vector.max-index","min"]},"max-index":{category:"vector",description:"Returns the index of the maximum value of all elements in the vector.",returns:{type:"integer"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the maximum index of."}},variants:[{argumentNames:["vector"]}],examples:['let { max-index } = import("vector");\nmax-index([1, 2, 3])','let { max-index } = import("vector");\nmax-index([1, 1, 2, 3, 3])','let { max-index } = import("vector");\nmax-index([1, 2, -3])','let { max-index } = import("vector");\nmax-index([1, 2, 3, 4])','let { max-index } = import("vector");\nmax-index([1, 2, -3, 4])'],seeAlso:["vector.min-index","max"]},"sort-indices":{category:"vector",description:"Returns the indices of the elements in the vector sorted in ascending order.",returns:{type:"vector"},args:{vector:{type:"vector",description:"Non emtpy vector to calculate the sorted indices of."}},variants:[{argumentNames:["vector"]}],examples:['let { sort-indices } = import("vector");\nsort-indices([1, 2, 3])','let { sort-indices } = import("vector");\nsort-indices([1, 1, 2, 3, 3])','let { sort-indices } = import("vector");\nsort-indices([1, 2, -3])','let { sort-indices } = import("vector");\nsort-indices([1, 2, 3, 4])','let { sort-indices } = import("vector");\nsort-indices([1, 2, -3, 4])'],seeAlso:["sort"]},"count-values":{category:"vector",description:"Counts the number of occurrences of each value in the vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"Vector to count the values of."}},variants:[{argumentNames:["vector"]}],examples:['let { count-values } = import("vector");\ncount-values([1, 2, 3])','let { count-values } = import("vector");\ncount-values([1, 1, 2, 3, 3])','let { count-values } = import("vector");\ncount-values([1, 2, -3])','let { count-values } = import("vector");\ncount-values([1, 2, 2, 1, 3, 2, 4, 2, 1, 2, 2, 1, 3, 2, 4])'],seeAlso:["sequence.frequencies","vector.bincount"]},linspace:{category:"vector",description:"Generates a vector of evenly spaced numbers between two values.",returns:{type:"number",array:!0},args:{start:{type:"number",description:"The starting value."},stop:{type:"number",description:"The ending value."},n:{type:"integer",description:"The number of values to generate."}},variants:[{argumentNames:["start","stop","n"]}],examples:['let { linspace } = import("vector");\nlinspace(0, 10, 6)','let { linspace } = import("vector");\nlinspace(10, 20, 25)'],seeAlso:["range","vector.ones","vector.zeros","vector.fill","vector.generate"]},ones:{category:"vector",description:"Generates a vector of ones.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."}},variants:[{argumentNames:["length"]}],examples:['let { ones } = import("vector");\nones(5)','let { ones } = import("vector");\nones(10)','let { ones } = import("vector");\nones(0)'],seeAlso:["repeat","vector.zeros","vector.fill","vector.generate","vector.linspace"]},zeros:{category:"vector",description:"Generates a vector of zeros.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."}},variants:[{argumentNames:["length"]}],examples:['let { zeros } = import("vector");\nzeros(5)','let { zeros } = import("vector");\nzeros(10)','let { zeros } = import("vector");\nzeros(0)'],seeAlso:["repeat","vector.ones","vector.fill","vector.generate","vector.linspace"]},fill:{category:"vector",description:"Generates a vector filled with a number.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."},value:{type:"number",description:"The value to fill the vector with."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["length","value"]}],examples:['let { fill } = import("vector");\nfill(5, PI)','let { fill } = import("vector");\nfill(10, -1)'],seeAlso:["repeat","vector.ones","vector.zeros","vector.generate","vector.linspace","grid.fill"]},generate:{category:"vector",description:"Generates a vector of numbers based on a function.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the vector."},func:{type:"function",description:"A function that takes an index and returns a number."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["length","func"]}],examples:['let { generate } = import("vector");\ngenerate(5, -> $ * 2)','let { generate } = import("vector");\ngenerate(10, -> $ + 1)','let { generate } = import("vector");\ngenerate(0, -> $ + 1)'],seeAlso:["repeat","vector.ones","vector.zeros","vector.fill","vector.linspace","grid.generate"]},cumsum:{category:"vector",description:"Calculates the cumulative sum of a vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the cumulative sum of."}},variants:[{argumentNames:["vector"]}],examples:['let { cumsum } = import("vector");\ncumsum([1, 2, 3])','let { cumsum } = import("vector");\ncumsum([1, 2, -3])','let { cumsum } = import("vector");\ncumsum([])'],seeAlso:["vector.cumprod","vector.sum","vector.running-sum"]},cumprod:{category:"vector",description:"Calculates the cumulative product of a vector.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the cumulative product of."}},variants:[{argumentNames:["vector"]}],examples:['let { cumprod } = import("vector");\ncumprod([1, 2, 3])','let { cumprod } = import("vector");\ncumprod([1, 2, -3, 0, 10])','let { cumprod } = import("vector");\ncumprod([])'],seeAlso:["vector.cumsum","vector.prod","vector.running-prod"]},quartiles:{category:"vector",description:"Calculates the quartiles of a vector. Returns an array containing the first, second (median), and third quartiles.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The vector to calculate the quartiles of. Minimum length is 4."}},variants:[{argumentNames:["vector"]}],examples:['let { quartiles } = import("vector");\nquartiles([1, 2, 3, 4])','let { quartiles } = import("vector");\nquartiles([5, 4, 3, 2, 1, 2, 3, 4, 5])','let { quartiles } = import("vector");\nquartiles(range(1, 1000))','let { quartiles, generate } = import("vector");\nquartiles(generate(1000, -> 1e6 / ($ + 1) ^ 2))','let { quartiles, generate } = import("vector");\nlet { ln } = import("math");\nquartiles(generate(1000, -> ln($ + 1)))'],seeAlso:["vector.percentile","vector.quantile","vector.median","vector.iqr"]},percentile:{category:"vector",description:"Calculates the percentile of a vector. Returns the value at the specified percentile.",returns:{type:"number"},args:{vector:{type:"vector",description:"The non empty vector to calculate the percentile of."},percentile:{type:"number",description:"The percentile to calculate. Must be between 0 and 1."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","percentile"]}],examples:['let { percentile } = import("vector");\npercentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 35)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 0)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 10)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 20)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 30)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 40)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 50)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 60)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 70)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 80)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 90)','let { percentile } = import("vector");\npercentile(range(100) ^ 0.5, 100)'],seeAlso:["vector.quantile","vector.quartiles","vector.median","vector.ecdf","vector.winsorize"]},quantile:{category:"vector",description:"Calculates the quantile of a vector. Returns the value at the specified quantile.",returns:{type:"number"},args:{vector:{type:"vector",description:"The non empty vector to calculate the quantile of."},quantile:{type:"number",description:"The quantile to calculate. Must be between 0 and 1."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","quantile"]}],examples:['let { quantile } = import("vector");\nquantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0.35)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.1)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.2)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.3)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.4)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.5)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.6)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.7)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.8)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 0.9)','let { quantile } = import("vector");\nquantile(range(100) ^ 0.5, 1)'],seeAlso:["vector.percentile","vector.quartiles","vector.ecdf"]},histogram:{category:"vector",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.",returns:{type:"array",array:!0},args:{vector:{type:"vector",description:"The numeric array to create a histogram from."},bins:{type:"integer",description:"The number of bins to divide the data range into."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","bins"]}],examples:['let { histogram } = import("vector");\nhistogram([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9], 3)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 5)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 10)','let { histogram } = import("vector");\nhistogram([1, 2, 3, 4, 5], 1)'],seeAlso:["vector.bincount","vector.ecdf"]},ecdf:{category:"vector",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.",returns:{type:"number"},args:{vector:{type:"vector",description:"The numeric array to calculate the ECDF from."},threshold:{type:"number",description:"The threshold value to calculate the ECDF for."},a:{type:"number"},b:{type:"integer"}},variants:[{argumentNames:["vector","threshold"]}],examples:['let { ecdf } = import("vector");\necdf([1, 2, 2, 3, 2, 6, 4, 3, 2, 4, 1, 3, 2, 9, 10, 12], 5)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 3)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 0)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 10)','let { ecdf } = import("vector");\necdf([1, 2, 3, 4, 5], 2)'],seeAlso:["vector.histogram","vector.percentile","vector.quantile"]},"outliers?":{category:"vector",description:"Checks if the `vector` contains outliers based on the interquartile range (IQR) method. Returns `true` if outliers are present, `false` otherwise.",returns:{type:"boolean"},args:{vector:{type:"vector",description:"The `vector` to check for outliers."}},variants:[{argumentNames:["vector"]}],examples:['let { outliers? } = import("vector");\noutliers?([1, 2, 3])','let { outliers? } = import("vector");\noutliers?([1, 2, -3])','let { outliers? } = import("vector");\noutliers?([1, 2, 3, 2, 4, 120])'],seeAlso:["vector.outliers","vector.winsorize","vector.iqr"]},outliers:{category:"vector",description:"Identifies outliers in the `vector` based on the interquartile range (IQR) method. Returns an array of outlier values.",returns:{type:"number",array:!0},args:{vector:{type:"vector",description:"The `vector` to check for outliers."}},variants:[{argumentNames:["vector"]}],examples:['let { outliers } = import("vector");\noutliers([1, 2, 3])','let { outliers } = import("vector");\noutliers([1, 2, -3])','let { outliers } = import("vector");\noutliers([1, 2, 3, 2, 4, 120])'],seeAlso:["vector.outliers?","vector.winsorize","vector.iqr"]},bincount:{category:"vector",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**.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The vector to count occurrences in."},minSize:{type:"integer",description:"Optional minimum size of the output array."},weights:{type:"number",array:!0,description:"Optional weights for each element in the vector."}},variants:[{argumentNames:["vector"]},{argumentNames:["vector","minSize"]},{argumentNames:["vector","minSize","weights"]}],examples:['let { bincount } = import("vector");\nbincount([1, 2, 3])','let { bincount } = import("vector");\nbincount([1, 2, 2, 3, 3])'],seeAlso:["vector.count-values","vector.histogram"],hideOperatorForm:!0},winsorize:{category:"vector",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.",returns:{type:"vector"},args:{vector:{type:"vector",description:"The vector to winsorize."},"lower-quantile":{type:"number",description:"The lower quantile threshold (between 0 and 1)."},"upper-quantile":{type:"number",description:"Optional Upper quantile threshold (between 0 and 1). Defaults to `(1 - lower-quantile)` if `lower-quantile <= 0.5` otherwise `1`."}},variants:[{argumentNames:["vector","lower-quantile"]},{argumentNames:["vector","lower-quantile","upper-quantile"]}],examples:['let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25)','let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.75)','let { winsorize } = import("vector");\nwinsorize([2, 5, 8, 10, 15, 18, 20, 35, 60, 100], 0.25, 0.5)'],seeAlso:["vector.outliers","vector.outliers?","vector.percentile"],hideOperatorForm:!0},mse:{category:"vector",description:"Calculates the **Mean Squared Error (MSE)** between two vectors. Returns the average of the squared differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { mse } = import("vector");\nmse([1, 2, 3], [1, 2, 3])','let { mse } = import("vector");\nmse([1, 2, 3], [4, 5, 6])','let { mse } = import("vector");\nmse([1, 2, 3], [2, 2, 2])','let { mse } = import("vector");\nmse([1, 2], [3, 3])','let { mse } = import("vector");\nmse([1], [3])'],seeAlso:["vector.rmse","vector.mae","vector.smape"]},rmse:{category:"vector",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.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { rmse } = import("vector");\nrmse([1, 2, 3], [1, 2, 3])','let { rmse } = import("vector");\nrmse([1, 2, 3], [4, 5, 6])','let { rmse } = import("vector");\nrmse([1, 2, 3], [2, 2, 2])','let { rmse } = import("vector");\nrmse([1, 2], [3, 3])','let { rmse } = import("vector");\nrmse([1], [3])'],seeAlso:["vector.mse","vector.mae","vector.smape"]},mae:{category:"vector",description:"Calculates the **Mean Absolute Error (MAE)** between two vectors. Returns the average of the absolute differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { mae } = import("vector");\nmae([1, 2, 3], [1, 2, 3])','let { mae } = import("vector");\nmae([1, 2, 3], [4, 5, 6])','let { mae } = import("vector");\nmae([1, 2, 3], [2, 2, 2])','let { mae } = import("vector");\nmae([1, 2], [3, 3])','let { mae } = import("vector");\nmae([1], [3])'],seeAlso:["vector.mse","vector.rmse","vector.smape"]},smape:{category:"vector",description:"Calculates the **Symmetric Mean Absolute Percentage Error (SMAPE)** between two vectors. Returns the average of the absolute percentage differences between corresponding elements.",returns:{type:"number"},args:{a:{type:"vector",description:"The first vector."},b:{type:"vector",description:"The second vector."}},variants:[{argumentNames:["a","b"]}],examples:['let { smape } = import("vector");\nsmape([1, 2, 3], [1, 2, 3])','let { smape } = import("vector");\nsmape([1, 2, 3], [4, 5, 6])','let { smape } = import("vector");\nsmape([1, 2, 3], [2, 2, 2])','let { smape } = import("vector");\nsmape([1, 2], [3, 3])','let { smape } = import("vector");\nsmape([1], [3])'],seeAlso:["vector.mse","vector.rmse","vector.mae"]}};function T(e){if(e.length<=1)return[];const t=[...e].sort((e,t)=>e-t),r=Math.floor(.25*t.length),n=t.length%4==0?(t[r-1]+t[r])/2:t[r],o=Math.floor(.75*t.length),i=t.length%4==0?(t[o-1]+t[o])/2:t[o],s=i-n,c=n-1.5*s,a=i+1.5*s;return e.filter(e=>e<c||e>a)}function S(e,t){const r=[...e].sort((e,t)=>e-t);if(0===t)return r[0];if(100===t)return r[r.length-1];const n=t/100*(r.length-1);if(Number.isInteger(n))return r[n];const o=Math.floor(n),i=Math.ceil(n),s=n-o;return r[o]*(1-s)+r[i]*s}function q(e){const t=[...e].sort((e,t)=>e-t),r=t.length/2;let n;n=t.length%2==0?(t[r-1]+t[r])/2:t[Math.floor(r)];const o=t.slice(0,Math.floor(t.length/2)),i=t.slice(Math.ceil(t.length/2));let s,c;if(o.length%2==0){const e=o.length/2;s=(o[e-1]+o[e])/2}else s=o[Math.floor(o.length/2)];if(i.length%2==0){const e=i.length/2;c=(i[e-1]+i[e])/2}else c=i[Math.floor(i.length/2)];return[s,n,c]}function A(e){if(0===e.length)return 0;return e.reduce((e,t)=>e+t,0)/e.length}const P={"geometric-mean":e=>{if(e.some(e=>e<0))throw new Error("Geometric mean is not defined for non-positive numbers");return Math.exp(e.reduce((e,t)=>e+Math.log(t),0)/e.length)}};function R(e){const t=[...e].sort((e,t)=>e-t),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}const M={median:e=>R(e)};function C(e,t){const r=A(e);return e.reduce((e,t)=>e+(t-r)**2,0)/e.length}const O={variance:e=>C(e)},D={"sample-variance":e=>function(e){const t=A(e);return e.reduce((e,r)=>e+(r-t)**2,0)/(e.length-1)}(e),minLength:2};function $(e,t){const r=C(e);return Math.sqrt(r)}const E={stdev:e=>$(e)},L={"sample-stdev":e=>function(e){const t=C(e);return Math.sqrt(t*(e.length/(e.length-1)))}(e),minLength:2},F={iqr:e=>{const[t,,r]=q(e);return r-t},minLength:4},j={span:e=>0===e.length?0:Math.max(...e)-Math.min(...e),minLength:0};const I={skewness:e=>function(e){const t=A(e),r=$(e);if(0===r)throw new Error("Standard deviation is zero, skewness is undefined");return e.reduce((e,r)=>e+(r-t)**3,0)/(e.length*r**3)}(e),minLength:3},V={"sample-skewness":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t;let n=0,o=0;for(const t of e){const e=t-r;n+=e*e,o+=e*e*e}const i=n/(t-1),s=Math.sqrt(i);if(0===s)throw new Error("Cannot calculate sample skewness when standard deviation is 0");return t/((t-1)*(t-2))*o/s**3}(e),minLength:3};function G(e){const t=A(e),r=$(e);if(0===r)throw new Error("Standard deviation is zero, kurtosis is undefined");return e.reduce((e,r)=>e+(r-t)**4,0)/(e.length*r**4)}const B={kurtosis:e=>G(e),minLength:4},W={"excess-kurtosis":e=>function(e){return G(e)-3}(e),minLength:4},J={"sample-kurtosis":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t,n=e.reduce((e,t)=>e+(t-r)**2,0)/(t-1);if(0===n)throw new Error("Variance is zero, kurtosis is undefined");return t*(t+1)*e.reduce((e,t)=>e+(t-r)**4,0)/((t-1)*(t-2)*(t-3)*n**2)}(e),minLength:4},Q={"sample-excess-kurtosis":e=>function(e){const t=e.length,r=e.reduce((e,t)=>e+t,0)/t,n=e.reduce((e,t)=>e+(t-r)**2,0)/(t-1);if(0===n)throw new Error("Variance is zero, kurtosis is undefined");return t*(t+1)*e.reduce((e,t)=>e+(t-r)**4,0)/((t-1)*(t-2)*(t-3)*n**2)-3*(t-1)*(t-1)/((t-2)*(t-3))}(e),minLength:4},U={rms:e=>Math.sqrt(e.reduce((e,t)=>e+t**2,0)/e.length)};const Z={mad:e=>function(e){const t=R(e);return e.reduce((e,r)=>e+Math.abs(r-t),0)/e.length}(e)};const H={medad:e=>function(e){const t=R(e);return 1.4826*R(e.map(e=>Math.abs(e-t)))}(e)},K={"gini-coefficient":e=>{if(e.some(e=>e<0))throw new Error("Gini coefficient is not defined for negative values");const t=[...e].sort((e,t)=>e-t),r=t.length,n=t.reduce((e,t)=>e+t,0);if(0===n)return 0;return 2*t.reduce((e,t,r)=>e+(r+1)*t,0)/(r*n)-(r+1)/r},minLength:1};const X={entropy:e=>function(e){const t=new Map;for(const r of e)t.set(r,(t.get(r)||0)+1);const r=e.length;let n=0;for(const e of t.values()){const t=e/r;t>0&&(n-=t*Math.log2(t))}return n}(e),minLength:1},Y={};function _(e){for(const[t,r]of Object.entries(e)){if(Y[t])throw new Error(`Duplicate normal expression key found: ${t}`);if("minLength"!==t&&"padding"!==t&&"function"==typeof r){const n=r,o=t.replace(/^/,""),i=`moving-${o}`,s=`centered-moving-${o}`,c=`running-${o}`,a=e.minLength??1;g(a,void 0,{integer:!0,finite:!0,gte:0}),Y[t]=ee(n,a),Y[i]=te(n,a),Y[s]=re(n,a,e.padding??null),Y[c]=ne(n,a)}}}function ee(e,r){return{evaluate:([n],o)=>{if(h(n,o),n.length<r)throw new t(`Vector length must be at least ${r}`,o);try{return e(n)}catch(e){throw new t(e,o)}},arity:k(1)}}function te(e,r){return{evaluate:([n,o],i)=>{if(h(n,i),g(o,i,{integer:!0,finite:!0,gte:r,lte:n.length}),0===n.length)return[];try{if(o>=n.length)return[e(n)];const t=[];for(let r=0;r<n.length-o+1;r+=1)t.push(e(n.slice(r,r+o)));return t}catch(e){throw new t(e,i)}},arity:k(2)}}function re(e,r,n){return{evaluate:([o,i,s,c],a)=>{if(h(o,a),o.length<r)throw new t(`Vector length must be at least ${r}`,a);if(g(i,a,{integer:!0,finite:!0,gte:r,lte:o.length}),null!==(s=s??n)&&g(s,a,{finite:!0}),null!==(c=c??n)&&g(c,a,{finite:!0}),0===o.length)return[];const v=Math.floor(i/2),m=[...Array(v).fill(s),...o,...Array(v).fill(c)],l="number"==typeof s?0:v,p=o.length-("number"==typeof c?0:i-v-1),d=[...Array(l).fill(null)];try{for(let t=l;t<p;t+=1)d.push(e(m.slice(t,t+i)))}catch(e){throw new t(e,a)}return d.push(...Array(o.length-p).fill(null)),d},arity:{min:2,max:4}}}function ne(e,r){return{evaluate:([n],o)=>{if(h(n,o),n.length<r)throw new t(`Vector length must be at least ${r}`,o);if(0===n.length)return[];try{const t=Math.max(r-1,0),o=Array(t).fill(null);for(let r=t;r<n.length;r+=1)o.push(e(n.slice(0,r+1)));return o}catch(e){throw new t(e,o)}},arity:k(1)}}_({mean:e=>A(e)}),_(P),_({"harmonic-mean":e=>e.length/e.reduce((e,t)=>e+1/t,0)}),_(M),_({sum:e=>e.reduce((e,t)=>e+t,0),minLength:0}),_({prod:e=>e.reduce((e,t)=>e*t,1),padding:1,minLength:0}),_(O),_(D),_(E),_(L),_(F),_(j),_(I),_(V),_(W),_(B),_(Q),_(J),_(U),_(Z),_(H),_(K),_(X);const oe={"monotonic?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>=e[r-1])||e.every((t,r)=>0===r||t<=e[r-1])),arity:k(1)},"strictly-monotonic?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>e[r-1])||e.every((t,r)=>0===r||t<e[r-1])),arity:k(1)},"increasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>=e[r-1])),arity:k(1)},"decreasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t<=e[r-1])),arity:k(1)},"strictly-increasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t>e[r-1])),arity:k(1)},"strictly-decreasing?":{evaluate:([e],t)=>(h(e,t),e.every((t,r)=>0===r||t<e[r-1])),arity:k(1)},mode:{evaluate:([e],t)=>(y(e,t),function(e){const t=new Map;for(const r of e)t.set(r,(t.get(r)||0)+1);let r=0;for(const e of t.values())e>r&&(r=e);if(1===r)return e;const n=[];for(const[e,o]of t.entries())o===r&&n.push(e);return n}(e)),arity:k(1)},"min-index":{evaluate:([e],t)=>(y(e,t),e.reduce((t,r,n)=>r<e[t]?n:t,0)),arity:k(1)},"max-index":{evaluate:([e],t)=>(y(e,t),e.reduce((t,r,n)=>r>e[t]?n:t,0)),arity:k(1)},"sort-indices":{evaluate:([e],t)=>(h(e,t),[...e.keys()].sort((t,r)=>e[t]-e[r])),arity:k(1)},"count-values":{evaluate:([e],t)=>{h(e,t);const r=new Map;for(const t of e)r.set(t,(r.get(t)||0)+1);return[...r.entries()].sort((e,t)=>{const r=t[1]-e[1];return 0!==r?r:e[0]-t[0]})},arity:k(1)},linspace:{evaluate:([e,t,r],n)=>{if(g(e,n,{finite:!0}),g(t,n,{finite:!0}),g(r,n,{integer:!0,nonNegative:!0}),0===r)return[];if(1===r)return[e];const o=(t-e)/(r-1);return Array.from({length:r},(t,r)=>e+r*o)},arity:k(3)},ones:{evaluate:([e],t)=>(g(e,t,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>1)),arity:k(1)},zeros:{evaluate:([e],t)=>(g(e,t,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>0)),arity:k(1)},fill:{evaluate:([e,t],r)=>(g(e,r,{integer:!0,nonNegative:!0}),Array.from({length:e},()=>t)),arity:k(2)},generate:{evaluate:([e,t],r,n,{executeFunction:o})=>(g(e,r,{integer:!0,nonNegative:!0}),x(t,r),function(e,t){const r=[];for(let n=0;n<e.length;n++){const o=t(e[n],n);if(o instanceof Promise)return z(o,r,e,t,n);r.push(o)}return r}(Array.from({length:e}),(e,i)=>{return s=o(t,[i],n,r),c=e=>(g(e,r,{finite:!0}),e),s instanceof Promise?s.then(c):c(s);var s,c})),arity:k(2)},cumsum:{evaluate:([e],t)=>(h(e,t),e.reduce((e,t)=>{const r=e[e.length-1]??0;return e.push(r+t),e},[])),arity:k(1)},cumprod:{evaluate:([e],t)=>(h(e,t),e.reduce((e,t)=>{const r=e[e.length-1]??1;return e.push(r*t),e},[])),arity:k(1)},quartiles:{evaluate:([e],r)=>{if(h(e,r),e.length<4)throw new t("Quartiles require at least four values",r);return q(e)},arity:k(1)},percentile:{evaluate:([e,t],r)=>(y(e,r),g(t,r,{finite:!0,nonNegative:!0,lte:100}),S(e,t)),arity:k(2)},quantile:{evaluate:([e,t],r)=>(h(e,r),g(t,r,{finite:!0,nonNegative:!0,lte:1}),S(e,100*t)),arity:k(2)},histogram:{evaluate:([e,t],r)=>(h(e,r),g(t,r,{integer:!0,positive:!0}),function(e,t){if(0===e.length){const e=[];for(let r=0;r<t;r++)e.push([0,0,0]);return e}const r=Math.min(...e),n=Math.max(...e);if(r===n){const n=[];for(let e=0;e<t;e++)n.push([r,r,0]);return n[0][2]=e.length,n}const o=(n-r)/t,i=[];for(let e=0;e<t;e++){const s=r+e*o,c=e===t-1?n:r+(e+1)*o;i.push([s,c,0])}for(const s of e)s===n?i[t-1][2]+=1:i[Math.min(Math.floor((s-r)/o),t-1)][2]+=1;return i}(e,t)),arity:k(2)},ecdf:{evaluate:([e,t],r)=>{y(e,r),g(t,r,{finite:!0});const n=[...e].sort((e,t)=>e-t),o=n.findIndex(e=>e>t);return-1===o?1:o/n.length},arity:k(2)},"outliers?":{evaluate:([e],t)=>(h(e,t),function(e){return T(e).length>0}(e)),arity:k(1)},outliers:{evaluate:([e],t)=>(h(e,t),T(e)),arity:k(1)},bincount:{evaluate:(e,r)=>{const n=e[0];h(n,r),n.forEach(e=>g(e,r,{finite:!0,integer:!0,nonNegative:!0}));const o=e[1]??0;g(o,r,{integer:!0,nonNegative:!0});const i=e[2]??void 0;if(void 0!==i){if(h(i,r),i.length!==n.length)throw new t("Weights vector must be the same length as the input vector",r);i.forEach(e=>g(e,r,{finite:!0}))}return function(e,t=0,r){if(0===e.length)return Array.from({length:t},()=>0);const n=Math.max(...e),o=Math.max(n+1,t),i=Array.from({length:o},()=>0);for(let t=0;t<e.length;t++){const n=Math.floor(e[t]);n<o&&(i[n]+=r?r[t]:1)}return i}(n,o,i)},arity:{min:1,max:3}},winsorize:{evaluate:([e,t,r],n)=>{if(h(e,n),g(t,n,{finite:!0,gte:0,lte:1}),r??=t>.5?1:1-t,g(r,n,{finite:!0,gte:t,lte:1}),0===e.length)return[];const o=[...e].sort((e,t)=>e-t),i=Math.max(0,Math.floor(t*e.length)),s=Math.min(e.length-1,Math.max(0,Math.floor(r*e.length)-1)),c=o[i],a=o[s];return e.map(e=>Math.max(c,Math.min(e,a)))},arity:{min:2,max:3}},mse:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>e+(t-r[n])**2,0)/e.length},arity:k(2)},rmse:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return Math.sqrt(e.reduce((e,t,n)=>e+(t-r[n])**2,0)/e.length)},arity:k(2)},mae:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>e+Math.abs(t-r[n]),0)/e.length},arity:k(2)},smape:{evaluate:([e,r],n)=>{if(y(e,n),y(r,n),e.length!==r.length)throw new t("Vectors must be of the same length",n);return e.reduce((e,t,n)=>{const o=Math.abs(t-r[n]),i=(Math.abs(t)+Math.abs(r[n]))/2;return e+(0===i?0:o/i)},0)/e.length},arity:k(2)}};!function(e){for(const[t,r]of Object.entries(e)){if(oe[t])throw new Error(`Duplicate normal expression key found: ${t}`);oe[t]=r}}(Y);for(const[e,t]of Object.entries(N))oe[e]&&(oe[e].docs=t);const ie={name:"vector",functions:oe};exports.vectorModule=ie;
|
|
2
2
|
//# sourceMappingURL=vector.js.map
|