-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchisquare.html
65 lines (53 loc) · 2.01 KB
/
chisquare.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
65
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>Chi-square 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>Chi-square distribution</h1>
<p class="description">
A sum of the squares of $k$ independent <a href="./standardnormal.html">standard normal</a> random variables
</p>
<div id="chart"></div>
<div class="controls">
<div class="slider-label">$k$</div>
<div id="slider_0"></div>
</div>
<div class="formula">
$$
Z_1^2 + Z_2^2 + \cdots + Z_k^2 \;\sim\; \chi^2(k)
$$
</div>
<div class="formula">
$$
f(x) =
\begin{cases}
\frac{x^{\frac{k}{2}-1}e^{-\frac{x}{2}}}{2^{\frac{k}{2}}\Gamma\big(\frac{k}{2}\big)}, & \text{if $x > 0$,} \\
0, & \text{otherwise.}
\end{cases}
\\[24pt]
\text{where $k$ is the degree of freedom (the number of the squares)} \\
\\
\text{and $\Gamma\bigg(\frac{k}{2}\bigg)$ is the gamma function.}
$$
</div>
</div>
</body>
<script src="./js/dist/chisquare.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>