-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnegbin.html
64 lines (50 loc) · 1.86 KB
/
negbin.html
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
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>Negative binomial distribution</title>
<meta name="viewport" content="width=device-width">
<link type="text/css" rel="stylesheet" media="screen" href="./css/page.css">
<link type="text/css" rel="stylesheet" media="screen" href="./css/chart.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.6.3/nouislider.min.css"/>
<script src="https://d3js.org/d3.v6.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.6.3/nouislider.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/wnumb/1.2.0/wNumb.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured"></script>
<script src="./js/mathjax_config.js"></script>
</head>
<body>
<div class="container">
<h1>Negative binomial distribution</h1>
<p class="description">
Keep tossing a coin until we have a total of $r$ heads (successes).
</p>
<p class="description">
How likely to have $k$ tails (failures) before we stop?
</p>
<div id="chart"></div>
<div class="controls">
<div class="slider-label">$r$</div>
<div id="slider_0"></div>
</div>
<div class="controls">
<div class="slider-label">$p$</div>
<div id="slider_1"></div>
</div>
<div class="formula">
$$
p(k) = {k+r-1 \choose k}\cdot (1-p)^r p^k
\\[16pt]
\text{where $r$ is the number of successes,}\\
\text{and $p$ is the probability of success.}
$$
</div>
</div>
</body>
<script src="./js/dist/negbin.js"></script>
<script src="./js/chart_config.js"></script>
<script src="./js/rand.js"></script>
<script src="./js/chart_function.js"></script>
<script src="./js/interact.js"></script>
</html>