This file is indexed.

/usr/share/doc/racket/math/stats.html is in racket-doc 6.7-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>8&nbsp;Statistics Functions</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Math Library</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="base.html" class="tocviewlink" data-pltdoc="x">Constants and Elementary Functions</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="flonum.html" class="tocviewlink" data-pltdoc="x">Flonums</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="special.html" class="tocviewlink" data-pltdoc="x">Special Functions</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="number-theory.html" class="tocviewlink" data-pltdoc="x">Number Theory</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="bigfloat.html" class="tocviewlink" data-pltdoc="x">Arbitrary-<wbr></wbr>Precision Floating-<wbr></wbr>Point Numbers (<a name="(tech._bigfloat)"></a><span style="font-style: italic">Bigfloats</span>)</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="array.html" class="tocviewlink" data-pltdoc="x">Arrays</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="matrices.html" class="tocviewlink" data-pltdoc="x">Matrices and Linear Algebra</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Statistics Functions</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="dist.html" class="tocviewlink" data-pltdoc="x">Probability Distributions</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="utils.html" class="tocviewlink" data-pltdoc="x">Stuff That Doesn&rsquo;t Belong Anywhere Else</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9658;</a></td><td>8&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Statistics Functions</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">8.1&nbsp;</td><td><a href="#%28part._stats~3aexpected-values%29" class="tocviewlink" data-pltdoc="x">Expected Values</a></td></tr><tr><td align="right">8.2&nbsp;</td><td><a href="#%28part._stats~3arunning%29" class="tocviewlink" data-pltdoc="x">Running Expected Values</a></td></tr><tr><td align="right">8.3&nbsp;</td><td><a href="#%28part._.Correlation%29" class="tocviewlink" data-pltdoc="x">Correlation</a></td></tr><tr><td align="right">8.4&nbsp;</td><td><a href="#%28part._.Counting_and_.Binning%29" class="tocviewlink" data-pltdoc="x">Counting and Binning</a></td></tr><tr><td align="right">8.5&nbsp;</td><td><a href="#%28part._.Order_.Statistics%29" class="tocviewlink" data-pltdoc="x">Order Statistics</a></td></tr><tr><td align="right">8.6&nbsp;</td><td><a href="#%28part._.Simulations%29" class="tocviewlink" data-pltdoc="x">Simulations</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">8.1<tt>&nbsp;</tt></span><a href="#%28part._stats~3aexpected-values%29" class="tocsubseclink" data-pltdoc="x">Expected Values</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">variance</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">stddev</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">skewness</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._kurtosis%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">kurtosis</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">variance/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">stddev/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">skewness/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._kurtosis%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">kurtosis/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><span class="tocsublinknumber">8.2<tt>&nbsp;</tt></span><a href="#%28part._stats~3arunning%29" class="tocsubseclink" data-pltdoc="x">Running Expected Values</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">empty-<wbr></wbr>statistics</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">update-<wbr></wbr>statistics</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">update-<wbr></wbr>statistics*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-range%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>range</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-variance%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>variance</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-stddev%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>stddev</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-skewness%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>skewness</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-kurtosis%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">statistics-<wbr></wbr>kurtosis</span></span></a></td></tr><tr><td><span class="tocsublinknumber">8.3<tt>&nbsp;</tt></span><a href="#%28part._.Correlation%29" class="tocsubseclink" data-pltdoc="x">Correlation</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._covariance%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">covariance</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">correlation</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._covariance%2Fmeans%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">covariance/<span class="mywbr"> &nbsp;</span>means</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%2Fmeans%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">correlation/<span class="mywbr"> &nbsp;</span>means</span></span></a></td></tr><tr><td><span class="tocsublinknumber">8.4<tt>&nbsp;</tt></span><a href="#%28part._.Counting_and_.Binning%29" class="tocsubseclink" data-pltdoc="x">Counting and Binning</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">samples-<wbr></wbr>&gt;hash</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">count-<wbr></wbr>samples</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sample-<wbr></wbr>bin</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">bin-<wbr></wbr>samples</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%2Fkey%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">bin-<wbr></wbr>samples/<span class="mywbr"> &nbsp;</span>key</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-compact%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sample-<wbr></wbr>bin-<wbr></wbr>compact</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-total%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sample-<wbr></wbr>bin-<wbr></wbr>total</span></span></a></td></tr><tr><td><span class="tocsublinknumber">8.5<tt>&nbsp;</tt></span><a href="#%28part._.Order_.Statistics%29" class="tocsubseclink" data-pltdoc="x">Order Statistics</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sort-<wbr></wbr>samples</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._median%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">median</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">quantile</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._absdev%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">absdev</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._absdev%2Fmedian%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">absdev/<span class="mywbr"> &nbsp;</span>median</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hpd-<wbr></wbr>interval</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%2Fsorted%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hpd-<wbr></wbr>interval/<span class="mywbr"> &nbsp;</span>sorted</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">real-<wbr></wbr>hpd-<wbr></wbr>interval</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%2Fsorted%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">real-<wbr></wbr>hpd-<wbr></wbr>interval/<span class="mywbr"> &nbsp;</span>sorted</span></span></a></td></tr><tr><td><span class="tocsublinknumber">8.6<tt>&nbsp;</tt></span><a href="#%28part._.Simulations%29" class="tocsubseclink" data-pltdoc="x">Simulations</a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-variance%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>variance</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>stddev</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>stddev/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-variance%2Fmean%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>variance/<span class="mywbr"> &nbsp;</span>mean</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._indicator%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">indicator</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-probability%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>probability</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-prob-dist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mc-<wbr></wbr>prob-<wbr></wbr>dist</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.7</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="matrix_op-norm.html" title="backward to &quot;7.12 Operator Norms and Comparing Matrices&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Math Library&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="dist.html" title="forward to &quot;9 Probability Distributions&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;stats&quot;">8<tt>&nbsp;</tt><a name="(part._stats)"></a><a name="(mod-path._math/statistics)"></a>Statistics Functions</h3><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Neil Toronto &lt;<a href="mailto:ntoronto@racket-lang.org">ntoronto@racket-lang.org</a>&gt;</p></span></div><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">math/statistics</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">math-lib</span></span></td></tr></table></p><p>This module exports functions that compute <a name="(tech._statistic)"></a><span style="font-style: italic">statistics</span>, meaning summary values for
collections of samples, and functions for managing sequences of weighted or unweighted samples.</p><p>Most of the functions that compute statistics accept a sequence of nonnegative reals that
correspond one-to-one with sample values.
These are used as weights; equivalently counts, pseudocounts or unnormalized probabilities.
While this makes it easy to work with weighted samples, it introduces some subtleties
in bias correction.
In particular, central moments must be computed without bias correction by default.
See <a href="#%28part._stats~3aexpected-values%29" data-pltdoc="x">Expected Values</a> for a discussion.</p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._stats~3aexpected-values%29" class="toclink" data-pltdoc="x">8.1<span class="hspace">&nbsp;</span>Expected Values</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._stats~3arunning%29" class="toclink" data-pltdoc="x">8.2<span class="hspace">&nbsp;</span>Running Expected Values</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._.Correlation%29" class="toclink" data-pltdoc="x">8.3<span class="hspace">&nbsp;</span>Correlation</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._.Counting_and_.Binning%29" class="toclink" data-pltdoc="x">8.4<span class="hspace">&nbsp;</span>Counting and Binning</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._.Order_.Statistics%29" class="toclink" data-pltdoc="x">8.5<span class="hspace">&nbsp;</span>Order Statistics</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="#%28part._.Simulations%29" class="toclink" data-pltdoc="x">8.6<span class="hspace">&nbsp;</span>Simulations</a></p></td></tr></table><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;stats:expected-values&quot;">8.1<tt>&nbsp;</tt><a name="(part._stats~3aexpected-values)"></a>Expected Values</h4><p>Functions documented in this section that compute higher central moments, such as <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span>,
<span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValLink" data-pltdoc="x">stddev</a></span> and <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%29%29" class="RktValLink" data-pltdoc="x">skewness</a></span>, can optionally apply bias correction to their estimates.
For example, when <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span> is given the argument <span class="RktPn">#:bias</span><span class="stt"> </span><span class="RktVal">#t</span>, it
multiplies the result by <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252F%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">/</a></span><span class="stt"> </span><span class="RktSym">n</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="stt"> </span><span class="RktSym">n</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span>, where <span class="RktSym">n</span> is the number of samples.</p><p><div class="SIntrapara">The meaning of &ldquo;bias correction&rdquo; becomes less clear with weighted samples, however. Often, the
weights represent counts, so when moment-estimating functions receive <span class="RktPn">#:bias</span><span class="stt"> </span><span class="RktVal">#t</span>, they
interpret it as &ldquo;use the sum of <span class="RktSym">ws</span> for <span class="RktSym">n</span>.&rdquo;
In the following example, the sample <span class="RktVal">4</span> is first counted twice and then given weight
<span class="RktVal">2</span>; therefore <span class="RktSym">n</span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">=</a></span><span class="stt"> </span><span class="RktVal">5</span> in both cases:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">17/10</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">17/10</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">However, sample weights often do not represent counts. For these cases, the <span class="RktPn">#:bias</span>
keyword can be followed by a real-valued pseudocount, which is used for <span class="RktSym">n</span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">17/10</span></p></td></tr></table></blockquote></div></p><p>Because the magnitude of the bias correction for weighted samples cannot be known without user
guidance, in all cases, the bias argument defaults to <span class="RktVal">#f</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValDef RktValLink" data-pltdoc="x">mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">When <span class="RktVar">ws</span> is <span class="RktVal">#f</span> (the default), returns the sample mean of the values in <span class="RktVar">xs</span>.
Otherwise, returns the weighted sample mean of the values in <span class="RktVar">xs</span> with corresponding weights
<span class="RktVar">ws</span>.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real</span></p></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">10.0</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real</span></p></td></tr><tr><td><p><span class="RktRes">4.285714285714286</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">d</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktSym">d</span><span class="hspace">&nbsp;</span><span class="RktVal">10000</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real</span></p></td></tr><tr><td><p><span class="RktRes">-0.009894536997503067</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="array_strict.html#%28form._%28%28lib._math%2Farray..rkt%29._array-strict%29%29" class="RktStxLink" data-pltdoc="x">array-strict</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="array_construct.html#%28def._%28%28lib._math%2Farray..rkt%29._build-array%29%29" class="RktValLink" data-pltdoc="x">build-array</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#</span><span class="RktVal">(</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">1000</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._%7Ece%7Ebb%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529.__%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">_</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktSym">d</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="array_pointwise.html#%28def._%28%28lib._math%2Farray..rkt%29._array-map%29%29" class="RktValLink" data-pltdoc="x">array-map</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="array_fold.html#%28def._%28%28lib._math%2Farray..rkt%29._array-~3elist-array%29%29" class="RktValLink" data-pltdoc="x">array-&gt;list-array</a></span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (Array Real)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">(array</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">#[0.006207572211194696</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktRes">0.009961320011163184</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktRes">0.012713586983649371</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktRes">0.0010361844214524293</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktRes">0.025515478926889507])</span></p></td></tr></table></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._variance))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValDef RktValLink" data-pltdoc="x">variance</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._stddev))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValDef RktValLink" data-pltdoc="x">stddev</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._skewness))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%29%29" class="RktValDef RktValLink" data-pltdoc="x">skewness</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._kurtosis))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._kurtosis%29%29" class="RktValDef RktValLink" data-pltdoc="x">kurtosis</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">If <span class="RktVar">ws</span> is <span class="RktVal">#f</span>, these compute the sample variance, standard deviation, skewness
and excess kurtosis the samples in <span class="RktVar">xs</span>.
If <span class="RktVar">ws</span> is not <span class="RktVal">#f</span>, they compute weighted variations of the same.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValLink" data-pltdoc="x">stddev</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">1.4142135623730951</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValLink" data-pltdoc="x">stddev</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">1.2777531299998799</span></p></td></tr></table></blockquote></div></p></div><div class="SIntrapara">See <a href="#%28part._stats~3aexpected-values%29" data-pltdoc="x">Expected Values</a> for the meaning of the <span class="RktVar">bias</span> keyword argument.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._variance/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">variance/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._stddev/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">stddev/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._skewness/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">skewness/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._kurtosis/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._kurtosis%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">kurtosis/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._variance%29%29" class="RktValLink" data-pltdoc="x">variance</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValLink" data-pltdoc="x">stddev</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._skewness%29%29" class="RktValLink" data-pltdoc="x">skewness</a></span> and <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._kurtosis%29%29" class="RktValLink" data-pltdoc="x">kurtosis</a></span>, but computed
using known mean <span class="RktVar">m</span>.</div></p><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;stats:running&quot;">8.2<tt>&nbsp;</tt><a name="(part._stats~3arunning)"></a>Running Expected Values</h4><p>The <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span> object allows computing the sample minimum, maximum, count, mean, variance,
skewness, and excess kurtosis of a sequence of samples in O(1) space.</p><p><div class="SIntrapara">To use it, start with <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span>, then use <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span> to obtain a
new statistics object with updated values. Use <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-min%29%29" class="RktValLink" data-pltdoc="x">statistics-min</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="RktValLink" data-pltdoc="x">statistics-mean</a></span>,
and similar functions to get the current estimates.
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=let.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._let%252A%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">let*</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">s</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">s</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">s</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">s</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">s</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=values.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._values%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">values</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="RktValLink" data-pltdoc="x">statistics-mean</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-stddev%29%29" class="RktValLink" data-pltdoc="x">statistics-stddev</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : (values Flonum Flonum) [more precisely: (Values Flonum Nonnegative-Flonum)]</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">2.8</span></p></td></tr><tr><td><p><span class="RktRes">1.3038404810405297</span></p></td></tr></table></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span><span class="stt"> </span><a name="(def._((lib._math/statistics..rkt)._statistics-count))"></a><a name="(def._((lib._math/statistics..rkt)._statistics-max))"></a><a name="(def._((lib._math/statistics..rkt)._statistics-min))"></a><a name="(def._((lib._math/statistics..rkt)._statistics~3f))"></a><a name="(def._((lib._math/statistics..rkt)._struct~3astatistics))"></a><a name="(def._((lib._math/statistics..rkt)._statistics))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics</a></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">min</span><span class="stt"> </span><span class="RktSym">max</span><span class="stt"> </span><span class="RktSym">count</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">min</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Flonum</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">max</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Flonum</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">count</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Flonum</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Represents running statistics.</div></p><p>The <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._min%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">min</a></span> and <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._max%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">max</a></span> fields are the minimum and maximum
value observed so far, and the <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Flist..rkt%2529._count%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">count</a></span> field is the total weight of the samples (which is the
number of samples if all samples are unweighted).
The remaining, hidden fields are used to compute moments, and their number and meaning may change in
future releases.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._math/statistics..rkt)._empty-statistics))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValDef RktValLink" data-pltdoc="x">empty-statistics</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The empty statistics object.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-min%29%29" class="RktValLink" data-pltdoc="x">statistics-min</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">+inf.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-max%29%29" class="RktValLink" data-pltdoc="x">statistics-max</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">-inf.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-range%29%29" class="RktValLink" data-pltdoc="x">statistics-range</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">+nan.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-count%29%29" class="RktValLink" data-pltdoc="x">statistics-count</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">0.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="RktValLink" data-pltdoc="x">statistics-mean</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">+nan.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-variance%29%29" class="RktValLink" data-pltdoc="x">statistics-variance</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">+nan.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-skewness%29%29" class="RktValLink" data-pltdoc="x">statistics-skewness</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">+nan.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-kurtosis%29%29" class="RktValLink" data-pltdoc="x">statistics-kurtosis</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">+nan.0</span></p></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._update-statistics))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValDef RktValLink" data-pltdoc="x">update-statistics</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>[<span class="RktVar">w</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">w</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">1.0</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a new statistics object that includes <span class="RktVar">x</span> in the computed statistics. If <span class="RktVar">w</span>
is given, <span class="RktVar">x</span> is weighted by <span class="RktVar">w</span> in the moment computations.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._update-statistics*))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">update-statistics*</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%29%29" class="RktValLink" data-pltdoc="x">update-statistics</a></span>, but includes all of <span class="RktVar">xs</span>, possibly weighted by corresponding
elements in <span class="RktVar">ws</span>, in the returned statistics object.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._update-statistics%2A%29%29" class="RktValLink" data-pltdoc="x">update-statistics*</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._empty-statistics%29%29" class="RktValLink" data-pltdoc="x">empty-statistics</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="RktValLink" data-pltdoc="x">statistics-mean</a></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">2.8</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-stddev%29%29" class="RktValLink" data-pltdoc="x">statistics-stddev</a></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">1.3038404810405297</span></p></td></tr></table></blockquote></div></p></div><div class="SIntrapara">This function uses O(1) space regardless of the length of <span class="RktVar">xs</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-range))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-range%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-range</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-mean%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-variance))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-variance%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-variance</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>[<span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-stddev))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-stddev%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-stddev</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>[<span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-skewness))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-skewness%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-skewness</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>[<span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._statistics-kurtosis))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics-kurtosis%29%29" class="RktValDef RktValLink" data-pltdoc="x">statistics-kurtosis</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>[<span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Flonum%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Flonum</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._statistics%29%29" class="RktValLink" data-pltdoc="x">statistics</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Compute the range, mean, variance, standard deviation, skewness, and excess kurtosis of the
observations summarized in <span class="RktVar">s</span>.</div></p><p>See <a href="#%28part._stats~3aexpected-values%29" data-pltdoc="x">Expected Values</a> for the meaning of the <span class="RktVar">bias</span> keyword argument.</p><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;Correlation&quot;">8.3<tt>&nbsp;</tt><a name="(part._.Correlation)"></a>Correlation</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._covariance))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._covariance%29%29" class="RktValDef RktValLink" data-pltdoc="x">covariance</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._correlation))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%29%29" class="RktValDef RktValLink" data-pltdoc="x">correlation</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Compute the sample covariance and correlation of <span class="RktVar">xs</span> and <span class="RktVar">ys</span>, optionally
weighted by <span class="RktVar">ws</span>.</div></p><p><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">10000</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmap..rkt%2529._map%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">map</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">&#955;:</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%29%29" class="RktValLink" data-pltdoc="x">correlation</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real</span></p></td></tr><tr><td><p><span class="RktRes">0.7079754306805294</span></p></td></tr></table></blockquote></div></p></div><div class="SIntrapara">Removing the correlation using importance weights:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmap..rkt%2529._map%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">map</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">&#955;:</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252F%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">/</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._pdf%29%29" class="RktValLink" data-pltdoc="x">pdf</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._pdf%29%29" class="RktValLink" data-pltdoc="x">pdf</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%29%29" class="RktValLink" data-pltdoc="x">correlation</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._ann%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">ann</a></span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real</span></p></td></tr><tr><td><p><span class="RktRes">0.022082953518300395</span></p></td></tr></table></blockquote></div></p><p>See <a href="#%28part._stats~3aexpected-values%29" data-pltdoc="x">Expected Values</a> for the meaning of the <span class="RktVar">bias</span> keyword argument.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._covariance/means))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._covariance%2Fmeans%29%29" class="RktValDef RktValLink" data-pltdoc="x">covariance/means</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">mx</span><span class="hspace">&nbsp;</span><span class="RktVar">my</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">mx</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">my</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._correlation/means))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%2Fmeans%29%29" class="RktValDef RktValLink" data-pltdoc="x">correlation/means</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">mx</span><span class="hspace">&nbsp;</span><span class="RktVar">my</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">mx</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">my</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._covariance%29%29" class="RktValLink" data-pltdoc="x">covariance</a></span> and <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._correlation%29%29" class="RktValLink" data-pltdoc="x">correlation</a></span>, but computed using known means
<span class="RktVar">mx</span> and <span class="RktVar">my</span>.</div></p><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;Counting_and_Binning&quot;">8.4<tt>&nbsp;</tt><a name="(part._.Counting_and_.Binning)"></a>Counting and Binning</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._samples-~3ehash))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="RktValDef RktValLink" data-pltdoc="x">samples-&gt;hash</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Hash.Table%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">HashTable</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Positive-.Integer%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Positive-Integer</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="RktValDef RktValLink" data-pltdoc="x">samples-&gt;hash</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Hash.Table%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">HashTable</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a hash table mapping each unique element in <span class="RktVar">xs</span> (under <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._equal%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">equal?</a></span>) to its
count, or, if <span class="RktVar">ws</span> is not <span class="RktVal">#f</span>, to its total weight.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="RktValLink" data-pltdoc="x">samples-&gt;hash</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (HashTable Integer Positive-Integer)</span></p></td></tr><tr><td><p><span class="RktRes">'#hash((4 . 2) (3 . 1) (2 . 1) (1 . 1))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="RktValLink" data-pltdoc="x">samples-&gt;hash</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (HashTable Integer Nonnegative-Real)</span></p></td></tr><tr><td><p><span class="RktRes">'#hash((4 . 2) (3 . 1) (2 . 1) (1 . 1))</span></p></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._count-samples))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="RktValDef RktValLink" data-pltdoc="x">count-samples</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Positive-.Integer%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Positive-Integer</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="RktValDef RktValLink" data-pltdoc="x">count-samples</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._samples-~3ehash%29%29" class="RktValLink" data-pltdoc="x">samples-&gt;hash</a></span>, but returns two lists.
The elements in the returned <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="stt"> </span><span class="RktSym">A</span><span class="RktPn">)</span> are in order of first appearance in <span class="RktVar">xs</span>.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="RktValLink" data-pltdoc="x">count-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values (Listof Positive-Byte) (Listof Positive-Integer))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">'(1 2 3 4)</span></p></td></tr><tr><td><p><span class="RktRes">'(1 1 1 2)</span></p></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="RktValLink" data-pltdoc="x">count-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1/2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values (Listof Positive-Byte) (Listof Nonnegative-Real))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">'(1 2 3 4)</span></p></td></tr><tr><td><p><span class="RktRes">'(1 1 1 2)</span></p></td></tr></table></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span><span class="stt"> </span><a name="(def._((lib._math/statistics..rkt)._sample-bin-weights))"></a><a name="(def._((lib._math/statistics..rkt)._sample-bin-values))"></a><a name="(def._((lib._math/statistics..rkt)._sample-bin-max))"></a><a name="(def._((lib._math/statistics..rkt)._sample-bin-min))"></a><a name="(def._((lib._math/statistics..rkt)._sample-bin~3f))"></a><a name="(def._((lib._math/statistics..rkt)._struct~3asample-bin))"></a><a name="(def._((lib._math/statistics..rkt)._sample-bin))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValDef RktValLink" data-pltdoc="x">sample-bin</a></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">min</span><span class="stt"> </span><span class="RktSym">max</span><span class="stt"> </span><span class="RktSym">values</span><span class="stt"> </span><span class="RktSym">weights</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">min</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">B</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">max</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">B</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">values</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">weights</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Represents a <span style="font-style: italic">bin</span>, or a group of samples within an interval in a total order.
The values and bounds have a different type to allow <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%2Fkey%29%29" class="RktValLink" data-pltdoc="x">bin-samples/key</a></span>
to group elements based on a function of their values.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._bin-samples))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValDef RktValLink" data-pltdoc="x">bin-samples</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">bounds</span><span class="hspace">&nbsp;</span><span class="RktVar">lte?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bounds</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lte?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Flist..rkt%2529._sort%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">sort</a></span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">lte?</span><span class="RktPn">)</span>, but additionally groups samples into bins.
The bins&rsquo; <span class="RktVar">bounds</span> are sorted before binning <span class="RktVar">xs</span>.</div></p><p>If <span class="RktSym">n</span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">=</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._length%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">length</a></span><span class="stt"> </span><span class="RktVar">bounds</span><span class="RktPn">)</span>, then <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span> returns <span style="font-style: italic">at least</span> <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="stt"> </span><span class="RktSym">n</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span>
bins, one for each pair of adjacent (sorted) bounds.
If some values in <span class="RktVar">xs</span> are less than the smallest bound, they are grouped into a single bin in
front.
If some are greater than the largest bound, they are grouped into a single bin at the end.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (Listof (sample-bin Byte Byte))</span></p></td></tr><tr><td><p><span class="RktRes">(list (sample-bin 0 6 '(0 1 2 3 4 5 6) #f))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (Listof (sample-bin Byte Byte))</span></p></td></tr><tr><td><p><span class="RktRes">(list (sample-bin 0 3 '(0 1 2 3) #f) (sample-bin 3 6 '(4 5 6) #f))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (Listof (sample-bin Byte Byte))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">(list</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 0 2 '(0 1 2) #f)</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 2 4 '(3 4) #f)</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 4 6 '(5 6) #f))</span></p></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;=</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktVal">20</span><span class="hspace">&nbsp;</span><span class="RktVal">30</span><span class="hspace">&nbsp;</span><span class="RktVal">40</span><span class="hspace">&nbsp;</span><span class="RktVal">50</span><span class="hspace">&nbsp;</span><span class="RktVal">60</span><span class="hspace">&nbsp;</span><span class="RktVal">70</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : (Listof (sample-bin Byte Byte))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">(list</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 0 2 '(0 1 2) '(10 20 30))</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 2 4 '(3 4) '(40 50))</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 4 6 '(5 6) '(60 70)))</span></p></td></tr></table></td></tr></table></blockquote></div></p><p>If <span class="RktVar">lte?</span> is a less-than-or-equal relation, the bins represent half-open intervals
(<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._min%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">min</a></span>, <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._max%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">max</a></span>] (except possibly the first, which may be closed).
If <span class="RktVar">lte?</span> is a less-than relation, the bins represent half-open intervals
[<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._min%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">min</a></span>, <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._max%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">max</a></span>) (except possibly the last, which may be closed).
In either case, the sorts applied to <span class="RktVar">bounds</span> and <span class="RktVar">xs</span> are stable.</p><p>Because intervals used in probability measurements are normally open on the left, prefer to use
less-than-or-equal relations for <span class="RktVar">lte?</span>.</p><p>If <span class="RktVar">ws</span> is <span class="RktVal">#f</span>, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span> returns bins with <span class="RktVal">#f</span> weights.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._bin-samples/key))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%2Fkey%29%29" class="RktValDef RktValLink" data-pltdoc="x">bin-samples/key</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">bounds</span><span class="hspace">&nbsp;</span><span class="RktVar">lte?</span><span class="hspace">&nbsp;</span><span class="RktVar">key</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bounds</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lte?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">B</span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">key</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Flist..rkt%2529._sort%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">sort</a></span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">lte?</span><span class="stt"> </span><span class="RktPn">#:key</span><span class="stt"> </span><span class="RktVar">key</span><span class="stt"> </span><span class="RktPn">#:cache-keys?</span><span class="stt"> </span><span class="RktVal">#t</span><span class="RktPn">)</span>, but additionally groups samples into
bins.
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%2Fkey%29%29" class="RktValLink" data-pltdoc="x">bin-samples/key</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._inst%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">inst</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._car%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">car</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.String%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">String</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">. </span><span class="RktVal">"1"</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">. </span><span class="RktVal">"2"</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">. </span><span class="RktVal">"3"</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">. </span><span class="RktVal">"4"</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">. </span><span class="RktVal">"5"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : (Listof (sample-bin (Pairof Positive-Byte String) Real))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">(list</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 1 2 '((1 . "1") (2 . "2")) #f)</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 2 4 '((3 . "3") (4 . "4")) #f)</span></p></td></tr><tr><td><p><span class="RktRes"></span><span class="hspace">&nbsp;</span><span class="RktRes">(sample-bin 4 5 '((5 . "5")) #f))</span></p></td></tr></table></td></tr></table></blockquote></div></p></div><div class="SIntrapara">See <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._bin-samples%29%29" class="RktValLink" data-pltdoc="x">bin-samples</a></span> for the simpler, one-type variant.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._sample-bin-compact))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-compact%29%29" class="RktValDef RktValLink" data-pltdoc="x">sample-bin-compact</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">bin</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bin</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Compacts <span class="RktVar">bin</span> by applying <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._count-samples%29%29" class="RktValLink" data-pltdoc="x">count-samples</a></span> to its values and weights.
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-compact%29%29" class="RktValLink" data-pltdoc="x">sample-bin-compact</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (sample-bin Positive-Byte Positive-Byte)</span></p></td></tr><tr><td><p><span class="RktRes">(sample-bin 1 4 '(1 2 3 4) '(1 1 1 2))</span></p></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._sample-bin-total))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-total%29%29" class="RktValDef RktValLink" data-pltdoc="x">sample-bin-total</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">bin</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bin</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">B</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">If <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-weights%29%29" class="RktValLink" data-pltdoc="x">sample-bin-weights</a></span><span class="stt"> </span><span class="RktVar">bin</span><span class="RktPn">)</span> is <span class="RktVal">#f</span>, returns the number of samples in <span class="RktVar">bin</span>;
otherwise, returns the sum of their weights.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-total%29%29" class="RktValLink" data-pltdoc="x">sample-bin-total</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-total%29%29" class="RktValLink" data-pltdoc="x">sample-bin-total</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin-compact%29%29" class="RktValLink" data-pltdoc="x">sample-bin-compact</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sample-bin%29%29" class="RktValLink" data-pltdoc="x">sample-bin</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr></table></blockquote></div></p></div></p><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;Order_Statistics&quot;">8.5<tt>&nbsp;</tt><a name="(part._.Order_.Statistics)"></a>Order Statistics</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._sort-samples))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValDef RktValLink" data-pltdoc="x">sort-samples</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValDef RktValLink" data-pltdoc="x">sort-samples</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Sorts possibly weighted samples according to <span class="RktVar">lt?</span>, which is assumed to define a total
order over the elements in <span class="RktVar">xs</span>.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValLink" data-pltdoc="x">sort-samples</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (Listof Positive-Byte)</span></p></td></tr><tr><td><p><span class="RktRes">'(1 2 3 5)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValLink" data-pltdoc="x">sort-samples</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">50</span><span class="hspace">&nbsp;</span><span class="RktVal">20</span><span class="hspace">&nbsp;</span><span class="RktVal">30</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values (Listof Positive-Byte) (Listof Nonnegative-Real))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">'(1 2 3 5)</span></p></td></tr><tr><td><p><span class="RktRes">'(10 20 30 50)</span></p></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValLink" data-pltdoc="x">sort-samples</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values (Listof Positive-Byte) (Listof Nonnegative-Real))</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">'(1 2 3 5)</span></p></td></tr><tr><td><p><span class="RktRes">'(1 1 1 1)</span></p></td></tr></table></td></tr></table></blockquote></div></p></div><div class="SIntrapara">Because <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValLink" data-pltdoc="x">sort-samples</a></span> is defined in terms of <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Flist..rkt%2529._sort%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">sort</a></span>, the sort is only guaranteed
to be stable if <span class="RktVar">lt?</span> is strictly a less-than relation.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._median))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._median%29%29" class="RktValDef RktValLink" data-pltdoc="x">median</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">A</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Equivalent to <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span><span class="stt"> </span><span class="RktVal">1/2</span><span class="stt"> </span><span class="RktVar">lt?</span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._quantile))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValDef RktValLink" data-pltdoc="x">quantile</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">A</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the inverse of the empirical <a href="dist_dist-objects.html#%28tech._cdf%29" class="techoutside" data-pltdoc="x"><span class="techinside">cdf</span></a> represented by the samples <span class="RktVar">xs</span>,
which are optionally weighted by <span class="RktVar">ws</span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Integer [more precisely: Positive-Byte]</span></p></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0.5</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Integer [more precisely: Positive-Byte]</span></p></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0.5</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0.25</span><span class="hspace">&nbsp;</span><span class="RktVal">0.2</span><span class="hspace">&nbsp;</span><span class="RktVal">0.2</span><span class="hspace">&nbsp;</span><span class="RktVal">0.35</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Integer [more precisely: Positive-Byte]</span></p></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div></p><p>If <span class="RktVar">p</span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">=</a></span><span class="stt"> </span><span class="RktVal">0</span>, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span> returns the smallest element of <span class="RktVar">xs</span> under the
ordering relation <span class="RktVar">lt?</span>. If <span class="RktVar">p</span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3d%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">=</a></span><span class="stt"> </span><span class="RktVal">1</span>, it returns the largest element.</p><p>For weighted samples, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span> sorts <span class="RktVar">xs</span> and <span class="RktVar">ws</span> together
(using <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._sort-samples%29%29" class="RktValLink" data-pltdoc="x">sort-samples</a></span>), then finds the least <span class="RktSym">x</span> for which the proportion of its
cumulative weight is greater than or equal to <span class="RktVar">p</span>.</p><p>For unweighted samples, <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._quantile%29%29" class="RktValLink" data-pltdoc="x">quantile</a></span> uses the quickselect algorithm to find the element that
would be at index <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._ceiling%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">ceiling</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252A%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">*</a></span><span class="stt"> </span><span class="RktVar">p</span><span class="stt"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span> if <span class="RktVar">xs</span> were sorted, where <span class="RktSym">n</span>
is the length of <span class="RktVar">xs</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._absdev))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._absdev%29%29" class="RktValDef RktValLink" data-pltdoc="x">absdev</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the average absolute difference between the elements in <span class="RktVar">xs</span> and
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._median%29%29" class="RktValLink" data-pltdoc="x">median</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>. If <span class="RktVar">ws</span> is not <span class="RktVal">#f</span>, it is a weighted average.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._absdev/median))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._absdev%2Fmedian%29%29" class="RktValDef RktValLink" data-pltdoc="x">absdev/median</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">median</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">median</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._absdev%29%29" class="RktValLink" data-pltdoc="x">absdev</a></span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>, but computed using known median <span class="RktVar">median</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._hpd-interval))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%29%29" class="RktValDef RktValLink" data-pltdoc="x">hpd-interval</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span><span class="RktVar">&#948;</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">lt?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">&#948;</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._hpd-interval/sorted))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%2Fsorted%29%29" class="RktValDef RktValLink" data-pltdoc="x">hpd-interval/sorted</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">&#948;</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">&#948;</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Estimates the smallest interval for which the distribution that produced <span class="RktVar">xs</span> (optionally
weighted by <span class="RktVar">ws</span>) assigns probability <span class="RktVar">p</span>, which must be positive.
The type <span class="RktSym">A</span> represents an ordered metric space with order <span class="RktVar">lt?</span> and metric <span class="RktVar">&#948;</span>.</div></p><p>To compute an HPD interval from sorted samples, use <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%2Fsorted%29%29" class="RktValLink" data-pltdoc="x">hpd-interval/sorted</a></span>.</p><p>You almost certainly want to use <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%29%29" class="RktValLink" data-pltdoc="x">real-hpd-interval</a></span> or <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%2Fsorted%29%29" class="RktValLink" data-pltdoc="x">real-hpd-interval/sorted</a></span>
instead, which are defined in terms of these.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._real-hpd-interval))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%29%29" class="RktValDef RktValLink" data-pltdoc="x">real-hpd-interval</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._real-hpd-interval/sorted))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%2Fsorted%29%29" class="RktValDef RktValLink" data-pltdoc="x">real-hpd-interval/sorted</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Values%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Values</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Equivalent to <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%29%29" class="RktValLink" data-pltdoc="x">hpd-interval</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="stt"> </span><span class="RktVar">p</span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span> and <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._hpd-interval%2Fsorted%29%29" class="RktValLink" data-pltdoc="x">hpd-interval/sorted</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="stt"> </span><span class="RktVar">p</span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">beta32</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._beta-dist%29%29" class="RktValLink" data-pltdoc="x">beta-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._real-dist-hpd-interval%29%29" class="RktValLink" data-pltdoc="x">real-dist-hpd-interval</a></span><span class="hspace">&nbsp;</span><span class="RktSym">beta32</span><span class="hspace">&nbsp;</span><span class="RktVal">0.8</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values Flonum Flonum)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">0.36542991742846176</span></p></td></tr><tr><td><p><span class="RktRes">0.8939657937826784</span></p></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._real-hpd-interval%29%29" class="RktValLink" data-pltdoc="x">real-hpd-interval</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0.8</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktSym">beta32</span><span class="hspace">&nbsp;</span><span class="RktVal">10000</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : (values Real Real)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">0.35935019085703573</span></p></td></tr><tr><td><p><span class="RktRes">0.8816695279553421</span></p></td></tr></table></td></tr></table></blockquote></div></p></div></p><h4 x-source-module="(lib &quot;math/scribblings/math.scrbl&quot;)" x-source-pkg="math-doc" x-part-tag="&quot;Simulations&quot;">8.6<tt>&nbsp;</tt><a name="(part._.Simulations)"></a>Simulations</h4><p>The functions in this section support Monte Carlo simulation; for example, quantifying uncertainty
about statistics estimated from samples.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-variance))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-variance%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-variance</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-stddev))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-stddev</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Estimate the variance and standard deviation of expected values computed from random samples.</div></p><p><div class="SIntrapara">If <span class="RktVar">xs</span> are random variable samples, then
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">&#952;</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></div><div class="SIntrapara">is also a random variable sample.
These two values:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-variance%29%29" class="RktValLink" data-pltdoc="x">mc-variance</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%29%29" class="RktValLink" data-pltdoc="x">mc-stddev</a></span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">estimate the variance and standard deviation of <span class="RktSym">&#952;</span>.
The latter is simply the square root of the variance, and bias correction is applied as described in
<a href="#%28part._stats~3aexpected-values%29" data-pltdoc="x">Expected Values</a>.</div></p><p><div class="SIntrapara">Two different ways to estimate the standard deviation of a mean computed from 1000 samples are
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%29%29" class="RktValLink" data-pltdoc="x">mc-stddev</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">1000</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">0.03138792060593431</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._stddev%29%29" class="RktValLink" data-pltdoc="x">stddev</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=for.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._for%252Flist%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">for/list</a></span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Listof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529.__%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">_</a></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=sequences.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._in-range%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">in-range</a></span><span class="hspace">&nbsp;</span><span class="RktVal">100</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">1000</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : Real [more precisely: Nonnegative-Real]</span></p></td></tr><tr><td><p><span class="RktRes">0.03468618684335975</span></p></td></tr></table></blockquote></div><div class="SIntrapara">Using <span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%29%29" class="RktValLink" data-pltdoc="x">mc-stddev</a></span> is 100 times faster in this case, and in most statistical applications,
replicating a sampling process 100 times is infeasible.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-stddev/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-stddev%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-stddev/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-variance/mean))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-variance%2Fmean%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-variance/mean</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span><span class="hspace">&nbsp;</span><span class="RktPn">#:bias</span><span class="hspace">&nbsp;</span><span class="RktVar">bias</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">m</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">bias</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Use these in the exceedingly rare cases in which you know the mean <span class="RktVar">m</span> but are estimating
uncertainty in an estimate of the mean anyway.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._indicator))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._indicator%29%29" class="RktValDef RktValLink" data-pltdoc="x">indicator</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">pred?</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">pred?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a predicate into an indicator function.
</div><div class="SIntrapara"><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="flonum.html#%28def._%28%28lib._math%2Fflonum..rkt%29._fl%29%29" class="RktValLink" data-pltdoc="x">fl</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmap..rkt%2529._map%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">map</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._indicator%29%29" class="RktValLink" data-pltdoc="x">indicator</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._%7Ece%7Ebb%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-i</span>nf.0</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">5000</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">0.1556</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._real-dist-prob%29%29" class="RktValLink" data-pltdoc="x">real-dist-prob</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-i</span>nf.0</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">- : Flonum</span></p></td></tr><tr><td><p><span class="RktRes">0.15865525393145705</span></p></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-probability))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-probability%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-probability</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">pred?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Nonnegative-.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Nonnegative-Real</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">pred?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Estimates the probability of <span class="RktVar">pred?</span> from possibly weighted samples.
Equivalent to <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mean%29%29" class="RktValLink" data-pltdoc="x">mean</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=sequences.html%23%2528def._%2528%2528lib._racket%252Fsequence..rkt%2529._sequence-map%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">sequence-map</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._indicator%29%29" class="RktValLink" data-pltdoc="x">indicator</a></span><span class="stt"> </span><span class="RktVar">pred?</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVar">xs</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="flonum.html#%28def._%28%28lib._math%2Fflonum..rkt%29._fl%29%29" class="RktValLink" data-pltdoc="x">fl</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-probability%29%29" class="RktValLink" data-pltdoc="x">mc-probability</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._%7Ece%7Ebb%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-i</span>nf.0</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">5000</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : Flonum [more precisely: Nonnegative-Flonum]</span></p></td></tr><tr><td><p><span class="RktRes">0.1586</span></p></td></tr></table></blockquote></div></p></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._math/statistics..rkt)._mc-prob-dist))"></a><span title="Provided from: math/statistics | Package: math-lib"><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-prob-dist%29%29" class="RktValDef RktValLink" data-pltdoc="x">mc-prob-dist</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">pred?</span><span class="hspace">&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>[<span class="RktVar">ws</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28form._%28%28lib._math%2Fdistributions..rkt%29._.Beta-.Dist%29%29" class="RktStxLink" data-pltdoc="x">Beta-Dist</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">pred?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">A</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Any%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">xs</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym">A</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ws</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.U%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">U</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._.Sequenceof%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Sequenceof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a beta distribution estimated from possibly weighted samples whose mean is
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-probability%29%29" class="RktValLink" data-pltdoc="x">mc-probability</a></span><span class="stt"> </span><span class="RktVar">pred?</span><span class="stt"> </span><span class="RktVar">xs</span><span class="stt"> </span><span class="RktVar">ws</span><span class="RktPn">)</span>.</div></p><p><div class="SIntrapara">Computing a confidence interval for a probability whose endpoints are guaranteed to be
between <span class="RktVal">0</span> and <span class="RktVal">1</span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._real-dist-hpd-interval%29%29" class="RktValLink" data-pltdoc="x">real-dist-hpd-interval</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._math%2Fstatistics..rkt%29._mc-prob-dist%29%29" class="RktValLink" data-pltdoc="x">mc-prob-dist</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._%7Ece%7Ebb%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">:</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&amp;rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%7E3c%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">&lt;</a></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-i</span>nf.0</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Distribution_Types_and_Operations.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._sample%29%29" class="RktValLink" data-pltdoc="x">sample</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="Real_Distribution_Families.html#%28def._%28%28lib._math%2Fdistributions..rkt%29._normal-dist%29%29" class="RktValLink" data-pltdoc="x">normal-dist</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">5000</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;</span><span class="RktVal">0.95</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">- : (values Flonum Flonum)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktRes">0.14150764112455805</span></p></td></tr><tr><td><p><span class="RktRes">0.16137059915076812</span></p></td></tr></table></td></tr></table></blockquote></div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="matrix_op-norm.html" title="backward to &quot;7.12 Operator Norms and Comparing Matrices&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Math Library&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="dist.html" title="forward to &quot;9 Probability Distributions&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>