Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (65 loc) · 36 KB
/
Copy pathindex.html
File metadata and controls
65 lines (65 loc) · 36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html><html lang="en" dir="ltr" data-theme="dark" data-has-sidebar data-has-hero class="astro-pafe7qgy"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Simple Statistics | Simple Statistics</title><link rel="canonical" href="https://simple-statistics.github.io/"/><link rel="sitemap" href="/sitemap-index.xml"/><link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml"/><meta name="generator" content="Astro v7.4.2"/><meta name="generator" content="Starlight v0.42.7"/><meta property="og:title" content="Simple Statistics"/><meta property="og:type" content="article"/><meta property="og:url" content="https://simple-statistics.github.io/"/><meta property="og:locale" content="en"/><meta property="og:description" content="Statistical methods in readable JavaScript for browsers, servers, and people."/><meta property="og:site_name" content="Simple Statistics"/><meta name="twitter:card" content="summary_large_image"/><meta name="description" content="Statistical methods in readable JavaScript for browsers, servers, and people."/><script>
document.documentElement.dataset.theme = "light";
</script><link rel="stylesheet" href="/_astro/print.ehPL0gv-.css" media="print"><link rel="stylesheet" href="/_astro/common.BXQhKuHp.css"><script type="module" src="/_astro/page.cNngjUgL.js"></script></head><body class="astro-pafe7qgy"><a class="sl-skip-link astro-qs5v7lww" href="#_top">Skip to content</a><div class="page sl-flex astro-nwilvi35"><header class="header astro-nwilvi35"><div class="header astro-f5ypup3n"><div class="title-wrapper sl-flex astro-f5ypup3n"><a href="/" class="site-title sl-flex astro-o3umsgrk"><img class="astro-o3umsgrk" alt src="/_astro/logo.CTXWqpvW.jpg" width="1373" height="1373"><span class="astro-o3umsgrk" translate="no">Simple Statistics</span></a></div><div class="sl-flex print:hidden astro-f5ypup3n"><site-search class="astro-f5ypup3n astro-krhpmpoi" data-translations="{"placeholder":"Search"}"><button data-open-modal disabled aria-label="Search" aria-keyshortcuts="Control+K" class="astro-krhpmpoi"><svg aria-hidden="true" class="astro-krhpmpoi astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21.71 20.29 18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14Z"/></svg><span class="sl-hidden md:sl-block astro-krhpmpoi" aria-hidden="true">Search</span><kbd class="sl-hidden md:sl-flex astro-krhpmpoi" style="display: none;"><kbd class="astro-krhpmpoi">Ctrl</kbd><kbd class="astro-krhpmpoi">K</kbd></kbd></button><dialog style="padding:0" aria-label="Search" class="astro-krhpmpoi"><div class="dialog-frame sl-flex astro-krhpmpoi"><button data-close-modal class="sl-flex md:sl-hidden astro-krhpmpoi">Cancel</button><div class="search-container astro-krhpmpoi"><div id="starlight__search" class="astro-krhpmpoi"></div></div></div></dialog></site-search><script>
(() => {
const openBtn = document.querySelector('button[data-open-modal]');
const shortcut = openBtn?.querySelector('kbd');
if (!openBtn || !(shortcut instanceof HTMLElement)) return;
const platformKey = shortcut.querySelector('kbd');
if (platformKey && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)) {
platformKey.textContent = '⌘';
openBtn.setAttribute('aria-keyshortcuts', 'Meta+K');
}
shortcut.style.display = '';
})();
</script><script type="module" src="/_astro/Search.astro_astro_type_script_index_0_lang.Djc9ZKGJ.js"></script></div><div class="sl-hidden md:sl-flex print:hidden right-group astro-f5ypup3n"><div class="sl-flex social-icons astro-f5ypup3n"><a href="https://github.com/simple-statistics/simple-statistics" rel="me" class="sl-flex astro-eyjxt2ic"><span class="sr-only astro-eyjxt2ic">GitHub</span><svg aria-hidden="true" class="astro-eyjxt2ic astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg></a></div><script type="module">var e=class extends HTMLElement{constructor(){super();let e=this.querySelector(`select`);e&&(e.addEventListener(`change`,e=>{e.currentTarget instanceof HTMLSelectElement&&(window.location.pathname=e.currentTarget.value)}),window.addEventListener(`pageshow`,t=>{if(!t.persisted)return;let n=e.querySelector(`option[selected]`)?.index;n!==e.selectedIndex&&(e.selectedIndex=n??0)}))}};customElements.define(`starlight-lang-select`,e);</script></div></div></header><nav class="sidebar print:hidden astro-nwilvi35" aria-label="Main"><button popovertarget="starlight__sidebar" class="sl-menu-button sl-flex md:sl-hidden print:hidden astro-rq6om5wx"><svg aria-hidden="true" class="open-menu astro-rq6om5wx astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M3 8h18a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2Zm18 8H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Zm0-5H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Z"/></svg><svg aria-hidden="true" class="close-menu astro-rq6om5wx astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="m13.41 12 6.3-6.29a1.004 1.004 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 0 1.42.998.998 0 0 0 1.42 0l6.29-6.3 6.29 6.3a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.42L13.41 12Z"/></svg><span class="sr-only astro-rq6om5wx">Menu</span></button><script type="module">var e=class extends HTMLElement{constructor(){super();let e=matchMedia(`(min-width: 50em)`),t=()=>{this.popover=e.matches?null:`auto`};t(),e.addEventListener(`change`,()=>t()),this.addEventListener(`toggle`,({newState:e})=>this.trapFocus(e===`open`))}trapFocus(e){document.querySelectorAll(`.main-frame, .sl-skip-link`).forEach(t=>{t.toggleAttribute(`inert`,e)})}};customElements.define(`sl-sidebar-pane`,e);</script><sl-sidebar-pane popover id="starlight__sidebar" class="sidebar-pane astro-nwilvi35"><div class="sidebar-content sl-flex astro-nwilvi35"><sl-sidebar-state-persist data-hash="1468w4s" class="astro-7bqjkpqq"><script aria-hidden="true">
(() => {
try {
if (!matchMedia('(min-width: 50em)').matches) return;
/** @type {HTMLElement | null} */
const target = document.querySelector('sl-sidebar-state-persist');
const state = JSON.parse(sessionStorage.getItem('sl-sidebar-state') || '0');
if (!target || !state || target.dataset.hash !== state.hash) return;
window._starlightScrollRestore = state.scroll;
customElements.define(
'sl-sidebar-restore',
class SidebarRestore extends HTMLElement {
connectedCallback() {
try {
const idx = parseInt(this.dataset.index || '');
const details = this.closest('details');
if (details && typeof state.open[idx] === 'boolean') details.open = state.open[idx];
} catch {}
}
}
);
} catch {}
})();
</script><ul class="top-level astro-23uehblk"><li class="astro-23uehblk"><details open class="astro-23uehblk"><summary class="astro-23uehblk"><span class="group-label astro-23uehblk"><span class="large astro-23uehblk">API</span></span><svg aria-hidden="true" class="caret astro-23uehblk astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></summary><sl-sidebar-restore data-index="0"></sl-sidebar-restore><ul class="astro-23uehblk"><li class="astro-23uehblk"><details class="astro-23uehblk"><summary class="astro-23uehblk"><span class="group-label astro-23uehblk"><span class="large astro-23uehblk">Classes</span></span><svg aria-hidden="true" class="caret astro-23uehblk astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></summary><sl-sidebar-restore data-index="1"></sl-sidebar-restore><ul class="astro-23uehblk"><li class="astro-23uehblk"><a href="/api/classes/bayesianclassifier/" class="astro-23uehblk"><span class="astro-23uehblk">BayesianClassifier</span></a></li><li class="astro-23uehblk"><a href="/api/classes/perceptronmodel/" class="astro-23uehblk"><span class="astro-23uehblk">PerceptronModel</span></a></li></ul></details></li><li class="astro-23uehblk"><details class="astro-23uehblk"><summary class="astro-23uehblk"><span class="group-label astro-23uehblk"><span class="large astro-23uehblk">Variables</span></span><svg aria-hidden="true" class="caret astro-23uehblk astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></summary><sl-sidebar-restore data-index="2"></sl-sidebar-restore><ul class="astro-23uehblk"><li class="astro-23uehblk"><a href="/api/variables/chisquareddistributiontable/" class="astro-23uehblk"><span class="astro-23uehblk">chiSquaredDistributionTable</span></a></li><li class="astro-23uehblk"><a href="/api/variables/epsilon/" class="astro-23uehblk"><span class="astro-23uehblk">epsilon</span></a></li><li class="astro-23uehblk"><a href="/api/variables/standardnormaltable/" class="astro-23uehblk"><span class="astro-23uehblk">standardNormalTable</span></a></li></ul></details></li><li class="astro-23uehblk"><details class="astro-23uehblk"><summary class="astro-23uehblk"><span class="group-label astro-23uehblk"><span class="large astro-23uehblk">Functions</span></span><svg aria-hidden="true" class="caret astro-23uehblk astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></summary><sl-sidebar-restore data-index="3"></sl-sidebar-restore><ul class="astro-23uehblk"><li class="astro-23uehblk"><a href="/api/functions/addtomean/" class="astro-23uehblk"><span class="astro-23uehblk">addToMean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/approxequal/" class="astro-23uehblk"><span class="astro-23uehblk">approxEqual</span></a></li><li class="astro-23uehblk"><a href="/api/functions/average/" class="astro-23uehblk"><span class="astro-23uehblk">average</span></a></li><li class="astro-23uehblk"><a href="/api/functions/averagesimple/" class="astro-23uehblk"><span class="astro-23uehblk">averageSimple</span></a></li><li class="astro-23uehblk"><a href="/api/functions/bernoullidistribution/" class="astro-23uehblk"><span class="astro-23uehblk">bernoulliDistribution</span></a></li><li class="astro-23uehblk"><a href="/api/functions/binomialdistribution/" class="astro-23uehblk"><span class="astro-23uehblk">binomialDistribution</span></a></li><li class="astro-23uehblk"><a href="/api/functions/bisect/" class="astro-23uehblk"><span class="astro-23uehblk">bisect</span></a></li><li class="astro-23uehblk"><a href="/api/functions/chisquaredgoodnessoffit/" class="astro-23uehblk"><span class="astro-23uehblk">chiSquaredGoodnessOfFit</span></a></li><li class="astro-23uehblk"><a href="/api/functions/chunk/" class="astro-23uehblk"><span class="astro-23uehblk">chunk</span></a></li><li class="astro-23uehblk"><a href="/api/functions/ckmeans/" class="astro-23uehblk"><span class="astro-23uehblk">ckmeans</span></a></li><li class="astro-23uehblk"><a href="/api/functions/ckmeansbreaks/" class="astro-23uehblk"><span class="astro-23uehblk">ckmeansBreaks</span></a></li><li class="astro-23uehblk"><a href="/api/functions/coefficientofvariation/" class="astro-23uehblk"><span class="astro-23uehblk">coefficientOfVariation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/combinations/" class="astro-23uehblk"><span class="astro-23uehblk">combinations</span></a></li><li class="astro-23uehblk"><a href="/api/functions/combinationsreplacement/" class="astro-23uehblk"><span class="astro-23uehblk">combinationsReplacement</span></a></li><li class="astro-23uehblk"><a href="/api/functions/combinemeans/" class="astro-23uehblk"><span class="astro-23uehblk">combineMeans</span></a></li><li class="astro-23uehblk"><a href="/api/functions/combinevariances/" class="astro-23uehblk"><span class="astro-23uehblk">combineVariances</span></a></li><li class="astro-23uehblk"><a href="/api/functions/cumulativestdlogisticprobability/" class="astro-23uehblk"><span class="astro-23uehblk">cumulativeStdLogisticProbability</span></a></li><li class="astro-23uehblk"><a href="/api/functions/cumulativestdnormalprobability/" class="astro-23uehblk"><span class="astro-23uehblk">cumulativeStdNormalProbability</span></a></li><li class="astro-23uehblk"><a href="/api/functions/equalintervalbreaks/" class="astro-23uehblk"><span class="astro-23uehblk">equalIntervalBreaks</span></a></li><li class="astro-23uehblk"><a href="/api/functions/errorfunction/" class="astro-23uehblk"><span class="astro-23uehblk">errorFunction</span></a></li><li class="astro-23uehblk"><a href="/api/functions/extent/" class="astro-23uehblk"><span class="astro-23uehblk">extent</span></a></li><li class="astro-23uehblk"><a href="/api/functions/extentsorted/" class="astro-23uehblk"><span class="astro-23uehblk">extentSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/factorial/" class="astro-23uehblk"><span class="astro-23uehblk">factorial</span></a></li><li class="astro-23uehblk"><a href="/api/functions/gamma/" class="astro-23uehblk"><span class="astro-23uehblk">gamma</span></a></li><li class="astro-23uehblk"><a href="/api/functions/gammaln/" class="astro-23uehblk"><span class="astro-23uehblk">gammaln</span></a></li><li class="astro-23uehblk"><a href="/api/functions/geometricmean/" class="astro-23uehblk"><span class="astro-23uehblk">geometricMean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/harmonicmean/" class="astro-23uehblk"><span class="astro-23uehblk">harmonicMean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/interquartilerange/" class="astro-23uehblk"><span class="astro-23uehblk">interquartileRange</span></a></li><li class="astro-23uehblk"><a href="/api/functions/inverseerrorfunction/" class="astro-23uehblk"><span class="astro-23uehblk">inverseErrorFunction</span></a></li><li class="astro-23uehblk"><a href="/api/functions/jenks/" class="astro-23uehblk"><span class="astro-23uehblk">jenks</span></a></li><li class="astro-23uehblk"><a href="/api/functions/kerneldensityestimation/" class="astro-23uehblk"><span class="astro-23uehblk">kernelDensityEstimation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/kmeanscluster/" class="astro-23uehblk"><span class="astro-23uehblk">kMeansCluster</span></a></li><li class="astro-23uehblk"><a href="/api/functions/linearregression/" class="astro-23uehblk"><span class="astro-23uehblk">linearRegression</span></a></li><li class="astro-23uehblk"><a href="/api/functions/linearregressionline/" class="astro-23uehblk"><span class="astro-23uehblk">linearRegressionLine</span></a></li><li class="astro-23uehblk"><a href="/api/functions/logaverage/" class="astro-23uehblk"><span class="astro-23uehblk">logAverage</span></a></li><li class="astro-23uehblk"><a href="/api/functions/logit/" class="astro-23uehblk"><span class="astro-23uehblk">logit</span></a></li><li class="astro-23uehblk"><a href="/api/functions/max/" class="astro-23uehblk"><span class="astro-23uehblk">max</span></a></li><li class="astro-23uehblk"><a href="/api/functions/maxsorted/" class="astro-23uehblk"><span class="astro-23uehblk">maxSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/median/" class="astro-23uehblk"><span class="astro-23uehblk">median</span></a></li><li class="astro-23uehblk"><a href="/api/functions/medianabsolutedeviation/" class="astro-23uehblk"><span class="astro-23uehblk">medianAbsoluteDeviation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/mediansorted/" class="astro-23uehblk"><span class="astro-23uehblk">medianSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/min/" class="astro-23uehblk"><span class="astro-23uehblk">min</span></a></li><li class="astro-23uehblk"><a href="/api/functions/minsorted/" class="astro-23uehblk"><span class="astro-23uehblk">minSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/mode/" class="astro-23uehblk"><span class="astro-23uehblk">mode</span></a></li><li class="astro-23uehblk"><a href="/api/functions/modefast/" class="astro-23uehblk"><span class="astro-23uehblk">modeFast</span></a></li><li class="astro-23uehblk"><a href="/api/functions/modesorted/" class="astro-23uehblk"><span class="astro-23uehblk">modeSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/normaldistribution/" class="astro-23uehblk"><span class="astro-23uehblk">normalDistribution</span></a></li><li class="astro-23uehblk"><a href="/api/functions/permutationsheap/" class="astro-23uehblk"><span class="astro-23uehblk">permutationsHeap</span></a></li><li class="astro-23uehblk"><a href="/api/functions/permutationtest/" class="astro-23uehblk"><span class="astro-23uehblk">permutationTest</span></a></li><li class="astro-23uehblk"><a href="/api/functions/poissondistribution/" class="astro-23uehblk"><span class="astro-23uehblk">poissonDistribution</span></a></li><li class="astro-23uehblk"><a href="/api/functions/probit/" class="astro-23uehblk"><span class="astro-23uehblk">probit</span></a></li><li class="astro-23uehblk"><a href="/api/functions/product/" class="astro-23uehblk"><span class="astro-23uehblk">product</span></a></li><li class="astro-23uehblk"><a href="/api/functions/quantile/" class="astro-23uehblk"><span class="astro-23uehblk">quantile</span></a></li><li class="astro-23uehblk"><a href="/api/functions/quantilerank/" class="astro-23uehblk"><span class="astro-23uehblk">quantileRank</span></a></li><li class="astro-23uehblk"><a href="/api/functions/quantileranksorted/" class="astro-23uehblk"><span class="astro-23uehblk">quantileRankSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/quantilesorted/" class="astro-23uehblk"><span class="astro-23uehblk">quantileSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/quickselect/" class="astro-23uehblk"><span class="astro-23uehblk">quickselect</span></a></li><li class="astro-23uehblk"><a href="/api/functions/relativeerror/" class="astro-23uehblk"><span class="astro-23uehblk">relativeError</span></a></li><li class="astro-23uehblk"><a href="/api/functions/reservoirsample/" class="astro-23uehblk"><span class="astro-23uehblk">reservoirSample</span></a></li><li class="astro-23uehblk"><a href="/api/functions/rootmeansquare/" class="astro-23uehblk"><span class="astro-23uehblk">rootMeanSquare</span></a></li><li class="astro-23uehblk"><a href="/api/functions/rsquared/" class="astro-23uehblk"><span class="astro-23uehblk">rSquared</span></a></li><li class="astro-23uehblk"><a href="/api/functions/sample/" class="astro-23uehblk"><span class="astro-23uehblk">sample</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplecorrelation/" class="astro-23uehblk"><span class="astro-23uehblk">sampleCorrelation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplecovariance/" class="astro-23uehblk"><span class="astro-23uehblk">sampleCovariance</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplekurtosis/" class="astro-23uehblk"><span class="astro-23uehblk">sampleKurtosis</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplerankcorrelation/" class="astro-23uehblk"><span class="astro-23uehblk">sampleRankCorrelation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/sampleskewness/" class="astro-23uehblk"><span class="astro-23uehblk">sampleSkewness</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplestandarddeviation/" class="astro-23uehblk"><span class="astro-23uehblk">sampleStandardDeviation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplevariance/" class="astro-23uehblk"><span class="astro-23uehblk">sampleVariance</span></a></li><li class="astro-23uehblk"><a href="/api/functions/samplewithreplacement/" class="astro-23uehblk"><span class="astro-23uehblk">sampleWithReplacement</span></a></li><li class="astro-23uehblk"><a href="/api/functions/scaledrootmeansquare/" class="astro-23uehblk"><span class="astro-23uehblk">scaledRootMeanSquare</span></a></li><li class="astro-23uehblk"><a href="/api/functions/shuffle/" class="astro-23uehblk"><span class="astro-23uehblk">shuffle</span></a></li><li class="astro-23uehblk"><a href="/api/functions/shuffleinplace/" class="astro-23uehblk"><span class="astro-23uehblk">shuffleInPlace</span></a></li><li class="astro-23uehblk"><a href="/api/functions/silhouette/" class="astro-23uehblk"><span class="astro-23uehblk">silhouette</span></a></li><li class="astro-23uehblk"><a href="/api/functions/silhouettemetric/" class="astro-23uehblk"><span class="astro-23uehblk">silhouetteMetric</span></a></li><li class="astro-23uehblk"><a href="/api/functions/standarddeviation/" class="astro-23uehblk"><span class="astro-23uehblk">standardDeviation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/subtractfrommean/" class="astro-23uehblk"><span class="astro-23uehblk">subtractFromMean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/sum/" class="astro-23uehblk"><span class="astro-23uehblk">sum</span></a></li><li class="astro-23uehblk"><a href="/api/functions/sumnthpowerdeviations/" class="astro-23uehblk"><span class="astro-23uehblk">sumNthPowerDeviations</span></a></li><li class="astro-23uehblk"><a href="/api/functions/sumsimple/" class="astro-23uehblk"><span class="astro-23uehblk">sumSimple</span></a></li><li class="astro-23uehblk"><a href="/api/functions/ttest/" class="astro-23uehblk"><span class="astro-23uehblk">tTest</span></a></li><li class="astro-23uehblk"><a href="/api/functions/ttesttwosample/" class="astro-23uehblk"><span class="astro-23uehblk">tTestTwoSample</span></a></li><li class="astro-23uehblk"><a href="/api/functions/uniquecountsorted/" class="astro-23uehblk"><span class="astro-23uehblk">uniqueCountSorted</span></a></li><li class="astro-23uehblk"><a href="/api/functions/variance/" class="astro-23uehblk"><span class="astro-23uehblk">variance</span></a></li><li class="astro-23uehblk"><a href="/api/functions/weightedlinearregression/" class="astro-23uehblk"><span class="astro-23uehblk">weightedLinearRegression</span></a></li><li class="astro-23uehblk"><a href="/api/functions/weightedmean/" class="astro-23uehblk"><span class="astro-23uehblk">weightedMean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/weightedquantile/" class="astro-23uehblk"><span class="astro-23uehblk">weightedQuantile</span></a></li><li class="astro-23uehblk"><a href="/api/functions/weightedstandarddeviation/" class="astro-23uehblk"><span class="astro-23uehblk">weightedStandardDeviation</span></a></li><li class="astro-23uehblk"><a href="/api/functions/weightedvariance/" class="astro-23uehblk"><span class="astro-23uehblk">weightedVariance</span></a></li><li class="astro-23uehblk"><a href="/api/functions/wilcoxonranksum/" class="astro-23uehblk"><span class="astro-23uehblk">wilcoxonRankSum</span></a></li><li class="astro-23uehblk"><a href="/api/functions/zscore/" class="astro-23uehblk"><span class="astro-23uehblk">zScore</span></a></li></ul></details></li><li class="astro-23uehblk"><details open class="astro-23uehblk"><summary class="astro-23uehblk"><span class="group-label astro-23uehblk"><span class="large astro-23uehblk">References</span></span><svg aria-hidden="true" class="caret astro-23uehblk astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></summary><sl-sidebar-restore data-index="4"></sl-sidebar-restore><ul class="astro-23uehblk"><li class="astro-23uehblk"><a href="/api/classes/bayesianclassifier/" class="astro-23uehblk"><span class="astro-23uehblk">bayesian</span></a></li><li class="astro-23uehblk"><a href="/api/functions/errorfunction/" class="astro-23uehblk"><span class="astro-23uehblk">erf</span></a></li><li class="astro-23uehblk"><a href="/api/functions/interquartilerange/" class="astro-23uehblk"><span class="astro-23uehblk">iqr</span></a></li><li class="astro-23uehblk"><a href="/api/functions/kerneldensityestimation/" class="astro-23uehblk"><span class="astro-23uehblk">kde</span></a></li><li class="astro-23uehblk"><a href="/api/functions/medianabsolutedeviation/" class="astro-23uehblk"><span class="astro-23uehblk">mad</span></a></li><li class="astro-23uehblk"><a href="/api/functions/average/" class="astro-23uehblk"><span class="astro-23uehblk">mean</span></a></li><li class="astro-23uehblk"><a href="/api/functions/averagesimple/" class="astro-23uehblk"><span class="astro-23uehblk">meanSimple</span></a></li><li class="astro-23uehblk"><a href="/api/classes/perceptronmodel/" class="astro-23uehblk"><span class="astro-23uehblk">perceptron</span></a></li><li class="astro-23uehblk"><a href="/api/functions/rootmeansquare/" class="astro-23uehblk"><span class="astro-23uehblk">rms</span></a></li></ul></details></li></ul></details></li></ul><script aria-hidden="true">
(() => {
const scroller = document.getElementById('starlight__sidebar');
if (!window._starlightScrollRestore || !scroller) return;
scroller.scrollTop = window._starlightScrollRestore;
delete window._starlightScrollRestore;
})();
</script></sl-sidebar-state-persist><div class="md:sl-hidden"><div class="mobile-preferences sl-flex astro-wzoc6r3a"><div class="social-icons astro-wzoc6r3a"><a href="https://github.com/simple-statistics/simple-statistics" rel="me" class="sl-flex astro-eyjxt2ic"><span class="sr-only astro-eyjxt2ic">GitHub</span><svg aria-hidden="true" class="astro-eyjxt2ic astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg></a></div></div></div></div></sl-sidebar-pane></nav><div class="main-frame astro-nwilvi35"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-fpawmbxi"><div class="main-pane astro-fpawmbxi"><main data-pagefind-body class="astro-pafe7qgy" lang="en" dir="ltr"><div class="content-panel astro-volcfcxa"><div class="sl-container astro-volcfcxa"><div class="hero astro-jwmlldkc"><img src="/_astro/logo.CTXWqpvW_Z2sMGPl.webp" fetchpriority="high" loading="eager" decoding="async" alt width="400" height="400" class="astro-jwmlldkc"><div class="sl-flex stack astro-jwmlldkc"><div class="sl-flex copy astro-jwmlldkc"><h1 id="_top" data-page-title class="astro-jwmlldkc">Simple Statistics</h1><div class="tagline astro-jwmlldkc">Statistical methods in readable JavaScript for browsers, servers, and people.</div></div><div class="sl-flex actions astro-jwmlldkc"><a class="sl-link-button not-content minimal astro-jwmlldkc astro-lxypgza2" href="https://github.com/simple-statistics/simple-statistics">GitHub<svg aria-hidden="true" class="astro-lxypgza2 astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M19.33 10.18a1 1 0 0 1-.77 0 1 1 0 0 1-.62-.93l.01-1.83-8.2 8.2a1 1 0 0 1-1.41-1.42l8.2-8.2H14.7a1 1 0 0 1 0-2h4.25a1 1 0 0 1 1 1v4.25a1 1 0 0 1-.62.93Z"/><path d="M11 4a1 1 0 1 1 0 2H7a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h4Z"/></svg></a><a class="sl-link-button not-content minimal astro-jwmlldkc astro-lxypgza2" href="https://npmjs.com/package/simple-statistics">npm<svg aria-hidden="true" class="astro-lxypgza2 astro-uky2q3up" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M19.33 10.18a1 1 0 0 1-.77 0 1 1 0 0 1-.62-.93l.01-1.83-8.2 8.2a1 1 0 0 1-1.41-1.42l8.2-8.2H14.7a1 1 0 0 1 0-2h4.25a1 1 0 0 1 1 1v4.25a1 1 0 0 1-.62.93Z"/><path d="M11 4a1 1 0 1 1 0 2H7a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h4Z"/></svg></a></div></div></div><div class="sl-markdown-content">
<div class="sl-heading-wrapper level-h2"><h2 id="features">Features</h2><a class="sl-anchor-link" href="#features"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Features”</span></a></div>
<p><strong>Simple Statistics</strong> is a JavaScript library that implements statistical
methods. It helps coders harness the power of statistics and statisticians
understand code. The library is exhaustively documented, written in a simple
and friendly style, and thoroughly tested.</p>
<div class="sl-heading-wrapper level-h2"><h2 id="install">Install</h2><a class="sl-anchor-link" href="#install"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Install”</span></a></div>
<p>You can use simple-statistics with node.js by installing it with npm.</p>
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame is-terminal not-content"><figcaption class="header"><span class="title"></span><span class="sr-only">Terminal window</span></figcaption><pre data-language="sh"><code><div class="ec-line"><div class="code"><span style="--0:#82AAFF;--1:#3B61B0">npm</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#ECC48D;--1:#3B61B0">install</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">--save</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#ECC48D;--1:#3B61B0">simple-statistics</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="npm install --save simple-statistics"><div></div></button></div></figure></div>
<p>The npm package is usable in node.js and the web via bundlers like
<a href="https://esbuild.github.io/">esbuild</a>, <a href="https://webpack.js.org/">webpack</a>,
or <a href="https://rollupjs.org/">rollup</a>.</p>
<div class="sl-heading-wrapper level-h2"><h2 id="cdn">CDN</h2><a class="sl-anchor-link" href="#cdn"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “CDN”</span></a></div>
<p>You can also use simple-statistics in webpages from
<a href="https://unpkg.com/">unpkg</a>:</p>
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="html"><code><div class="ec-line"><div class="code"><span style="--1:#8844AE"><span style="--0:#7FDBCA"><</span><span style="--0:#CAECE6">script</span><span style="--0:#7FDBCA"> </span></span><span style="--0:#C5E478;--1:#3B61B0">src</span><span style="--0:#7FDBCA;--1:#8844AE">=</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">https://unpkg.com/simple-statistics@7/dist/simple-statistics.min.js</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--1:#8844AE"><span style="--0:#7FDBCA">></</span><span style="--0:#CAECE6">script</span><span style="--0:#7FDBCA">></span></span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="<script src="https://unpkg.com/simple-statistics@7/dist/simple-statistics.min.js"></script>"><div></div></button></div></figure></div>
<div class="sl-heading-wrapper level-h2"><h2 id="credits">Credits</h2><a class="sl-anchor-link" href="#credits"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Credits”</span></a></div>
<p>Made by <a href="https://macwright.org">Tom MacWright</a> &
<a href="https://github.com/simple-statistics/simple-statistics/graphs/contributors">Contributors</a>.
Also ported to
<a href="https://github.com/sheriferson/simplestatistics">Python as simplestatistics</a>.</p></div><footer class="sl-flex astro-7a2gwcar"><div class="meta sl-flex astro-7a2gwcar"></div><div class="pagination-links print:hidden astro-lj3rzpcm" dir="ltr"></div></footer></div></div></main></div></div></div></div></body></html>