Skip to content

Commit f4bb0da

Browse files
authored
Merge pull request #184 from JoramSoch/master
added 4 definitions and 5 proofs
2 parents 5063bda + 46da6d0 commit f4bb0da

10 files changed

Lines changed: 556 additions & 44 deletions

File tree

D/betabin-data.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: definition
3+
mathjax: true
4+
5+
author: "Joram Soch"
6+
affiliation: "BCCN Berlin"
7+
e_mail: "joram.soch@bccn-berlin.de"
8+
date: 2022-10-20 08:20:00
9+
10+
title: "Beta-binomial data"
11+
chapter: "Statistical Models"
12+
section: "Frequency data"
13+
topic: "Beta-binomial data"
14+
definition: "Definition"
15+
16+
sources:
17+
18+
def_id: "D178"
19+
shortcut: "betabin-data"
20+
username: "JoramSoch"
21+
---
22+
23+
24+
**Definition:** Beta-binomial data are defined as a set of counts $y = \left\lbrace y_1, \ldots, y_N \right\rbrace$ with $y_i \in \mathbb{N}, \; i = 1,\ldots,N$, independent and identically distributed according to a [beta-binomial distribution](/D/betabin) with number of trials $n$ as well as shapes $\alpha$ and $\beta$:
25+
26+
$$ \label{eq:betabin-data}
27+
y_i \sim \mathrm{BetBin}(n,\alpha,\beta), \quad i = 1, \ldots, N \; .
28+
$$

D/betabin.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: definition
3+
mathjax: true
4+
5+
author: "Joram Soch"
6+
affiliation: "BCCN Berlin"
7+
e_mail: "joram.soch@bccn-berlin.de"
8+
date: 2022-10-20 08:09:00
9+
10+
title: "Beta-binomial distribution"
11+
chapter: "Probability Distributions"
12+
section: "Univariate discrete distributions"
13+
topic: "Beta-binomial distribution"
14+
definition: "Definition"
15+
16+
sources:
17+
- authors: "Wikipedia"
18+
year: 2022
19+
title: "Beta-binomial distribution"
20+
in: "Wikipedia, the free encyclopedia"
21+
pages: "retrieved on 2022-10-20"
22+
url: "https://en.wikipedia.org/wiki/Beta-binomial_distribution#Motivation_and_derivation"
23+
24+
def_id: "D177"
25+
shortcut: "betabin"
26+
username: "JoramSoch"
27+
---
28+
29+
30+
**Definition:** Let $p$ be a [random variable](/D/rvar) following a [beta distribution](/D/beta)
31+
32+
$$ \label{eq:beta}
33+
p \sim \mathrm{Bet}(\alpha, \beta)
34+
$$
35+
36+
and let $X$ be a [random variable](/D/rvar) following a [binomial distribution](/D/bin) conditional on $p$
37+
38+
$$ \label{eq:bin}
39+
X \mid p \sim \mathrm{Bin}(n, p) \; .
40+
$$
41+
42+
Then, the [marginal distribution](/D/dist-marg) of $X$ is called a beta-binomial distribution
43+
44+
$$ \label{eq:betabin}
45+
X \sim \mathrm{BetBin}(n, \alpha, \beta)
46+
$$
47+
48+
with [number of trials](/D/bin) $n$ and [shape parameters](/D/beta) $\alpha$ and $\beta$.

D/fe.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: definition
3+
mathjax: true
4+
5+
author: "Joram Soch"
6+
affiliation: "BCCN Berlin"
7+
e_mail: "joram.soch@bccn-berlin.de"
8+
date: 2022-10-20 09:57:00
9+
10+
title: "Family evidence"
11+
chapter: "Model Selection"
12+
section: "Bayesian model selection"
13+
topic: "Family evidence"
14+
definition: "Definition"
15+
16+
sources:
17+
- authors: "Soch J, Allefeld C"
18+
year: 2018
19+
title: "MACS – a new SPM toolbox for model assessment, comparison and selection"
20+
in: "Journal of Neuroscience Methods"
21+
pages: "vol. 306, pp. 19-31, eq. 16"
22+
url: "https://www.sciencedirect.com/science/article/pii/S0165027018301468"
23+
doi: "10.1016/j.jneumeth.2018.05.017"
24+
25+
def_id: "D180"
26+
shortcut: "fe"
27+
username: "JoramSoch"
28+
---
29+
30+
31+
**Definition:** Let $f$ be a family of $M$ [generative models](/D/gm) $m_1, \ldots, m_M$, such that the following statement holds true:
32+
33+
$$ \label{eq:fam}
34+
f \Leftrightarrow m_1 \vee \ldots \vee m_M \; .
35+
$$
36+
37+
Then, the family evidence (FE) of $f$ is defined as the [marginal probability](/D/prob-marg) relative to the [model evidences](/D/me) $p(y \vert m_i), conditional only on $f$:
38+
39+
$$ \label{eq:fe}
40+
\mathrm{FE}(f) = p(y|f) \; .
41+
$$

D/me.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: definition
3+
mathjax: true
4+
5+
author: "Joram Soch"
6+
affiliation: "BCCN Berlin"
7+
e_mail: "joram.soch@bccn-berlin.de"
8+
date: 2022-10-20 09:43:00
9+
10+
title: "Model evidence"
11+
chapter: "Model Selection"
12+
section: "Bayesian model selection"
13+
topic: "Model evidence"
14+
definition: "Definition"
15+
16+
sources:
17+
- authors: "Penny WD"
18+
year: 2012
19+
title: "Comparing Dynamic Causal Models using AIC, BIC and Free Energy"
20+
in: "NeuroImage"
21+
pages: "vol. 59, iss. 2, pp. 319-330, eq. 15"
22+
url: "https://www.sciencedirect.com/science/article/pii/S1053811911008160"
23+
doi: "10.1016/j.neuroimage.2011.07.039"
24+
25+
def_id: "D179"
26+
shortcut: "me"
27+
username: "JoramSoch"
28+
---
29+
30+
31+
**Definition:** Let $m$ be a [generative model](/D/gm) with [likelihood function](/D/lf) $p(y \vert \theta, m)$ and [prior distribution](/D/prior) $p(\theta \vert m)$. Then, the model evidence (ME) of $m$ is defined as the [marginal likelihood](/D/ml) of this model:
32+
33+
$$ \label{eq:ME}
34+
\mathrm{ME}(m) = p(y|m) \; .
35+
$$

I/ToC.md

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,17 @@ title: "Table of Contents"
329329
&emsp;&ensp; 1.3.7. **[Shannon entropy](/P/bin-ent)** <br>
330330
&emsp;&ensp; 1.3.8. **[Conditional binomial](/P/bin-margcond)** <br>
331331

332-
1.4. Poisson distribution <br>
333-
&emsp;&ensp; 1.4.1. *[Definition](/D/poiss)* <br>
334-
&emsp;&ensp; 1.4.2. **[Probability mass function](/P/poiss-pmf)** <br>
335-
&emsp;&ensp; 1.4.3. **[Mean](/P/poiss-mean)** <br>
336-
&emsp;&ensp; 1.4.4. **[Variance](/P/poiss-var)** <br>
332+
1.4. Beta-binomial distribution <br>
333+
&emsp;&ensp; 1.4.1. *[Definition](/D/betabin)* <br>
334+
&emsp;&ensp; 1.4.2. **[Probability mass function](/P/betabin-pmf)** <br>
335+
&emsp;&ensp; 1.4.3. **[Probability mass function in terms of gamma function](/P/betabin-pmfitogf)** <br>
336+
&emsp;&ensp; 1.4.4. **[Cumulative distribution function](/P/betabin-cdf)** <br>
337+
338+
1.5. Poisson distribution <br>
339+
&emsp;&ensp; 1.5.1. *[Definition](/D/poiss)* <br>
340+
&emsp;&ensp; 1.5.2. **[Probability mass function](/P/poiss-pmf)** <br>
341+
&emsp;&ensp; 1.5.3. **[Mean](/P/poiss-mean)** <br>
342+
&emsp;&ensp; 1.5.4. **[Variance](/P/poiss-var)** <br>
337343

338344
2. Multivariate discrete distributions
339345

@@ -678,7 +684,8 @@ title: "Table of Contents"
678684
&emsp;&ensp; 4.2.2. **[Maximum likelihood estimation](/P/dir-mle)** <br>
679685

680686
4.3. Beta-binomial data <br>
681-
&emsp;&ensp; 4.3.1. **[Method of moments](/P/betabin-mome)** <br>
687+
&emsp;&ensp; 4.3.1. *[Definition](/D/betabin-data)* <br>
688+
&emsp;&ensp; 4.3.2. **[Method of moments](/P/betabin-mome)** <br>
682689

683690
5. Categorical data
684691

@@ -727,41 +734,49 @@ title: "Table of Contents"
727734

728735
3. Bayesian model selection
729736

730-
3.1. Log model evidence <br>
731-
&emsp;&ensp; 3.1.1. *[Definition](/D/lme)* <br>
732-
&emsp;&ensp; 3.1.2. **[Derivation](/P/lme-der)** <br>
733-
&emsp;&ensp; 3.1.3. **[Expression using prior and posterior](/P/lme-pnp)** <br>
734-
&emsp;&ensp; 3.1.4. **[Partition into accuracy and complexity](/P/lme-anc)** <br>
735-
&emsp;&ensp; 3.1.5. *[Uniform-prior log model evidence](/D/uplme)* <br>
736-
&emsp;&ensp; 3.1.6. *[Cross-validated log model evidence](/D/cvlme)* <br>
737-
&emsp;&ensp; 3.1.7. *[Empirical Bayesian log model evidence](/D/eblme)* <br>
738-
&emsp;&ensp; 3.1.8. *[Variational Bayesian log model evidence](/D/vblme)* <br>
739-
740-
3.2. Log family evidence <br>
741-
&emsp;&ensp; 3.2.1. *[Definition](/D/lfe)* <br>
742-
&emsp;&ensp; 3.2.2. **[Derivation](/P/lfe-der)** <br>
743-
&emsp;&ensp; 3.2.3. **[Calculation from log model evidences](/P/lfe-lme)** <br>
744-
745-
3.3. Log Bayes factor <br>
746-
&emsp;&ensp; 3.3.1. *[Definition](/D/lbf)* <br>
747-
&emsp;&ensp; 3.3.2. **[Derivation](/P/lbf-der)** <br>
748-
&emsp;&ensp; 3.3.3. **[Calculation from log model evidences](/P/lbf-lme)** <br>
749-
750-
3.4. Bayes factor <br>
751-
&emsp;&ensp; 3.4.1. *[Definition](/D/bf)* <br>
752-
&emsp;&ensp; 3.4.2. **[Transitivity](/P/bf-trans)** <br>
753-
&emsp;&ensp; 3.4.3. **[Computation using Savage-Dickey Density Ratio](/P/bf-sddr)** <br>
754-
&emsp;&ensp; 3.4.4. **[Computation using Encompassing Prior Method](/P/bf-ep)** <br>
755-
&emsp;&ensp; 3.4.5. *[Encompassing model](/D/encm)* <br>
756-
757-
3.5. Posterior model probability <br>
758-
&emsp;&ensp; 3.5.1. *[Definition](/D/pmp)* <br>
759-
&emsp;&ensp; 3.5.2. **[Derivation](/P/pmp-der)** <br>
760-
&emsp;&ensp; 3.5.3. **[Calculation from Bayes factors](/P/pmp-bf)** <br>
761-
&emsp;&ensp; 3.5.4. **[Calculation from log Bayes factor](/P/pmp-lbf)** <br>
762-
&emsp;&ensp; 3.5.5. **[Calculation from log model evidences](/P/pmp-lme)** <br>
763-
764-
3.6. Bayesian model averaging <br>
765-
&emsp;&ensp; 3.6.1. *[Definition](/D/bma)* <br>
766-
&emsp;&ensp; 3.6.2. **[Derivation](/P/bma-der)** <br>
767-
&emsp;&ensp; 3.6.3. **[Calculation from log model evidences](/P/bma-lme)** <br>
737+
3.1. Model evidence <br>
738+
&emsp;&ensp; 3.1.1. *[Definition](/D/me)* <br>
739+
&emsp;&ensp; 3.1.2. **[Derivation](/P/me-der)** <br>
740+
741+
3.2. Log model evidence <br>
742+
&emsp;&ensp; 3.2.1. *[Definition](/D/lme)* <br>
743+
&emsp;&ensp; 3.2.2. **[Derivation](/P/lme-der)** <br>
744+
&emsp;&ensp; 3.2.3. **[Expression using prior and posterior](/P/lme-pnp)** <br>
745+
&emsp;&ensp; 3.2.4. **[Partition into accuracy and complexity](/P/lme-anc)** <br>
746+
&emsp;&ensp; 3.2.5. *[Uniform-prior log model evidence](/D/uplme)* <br>
747+
&emsp;&ensp; 3.2.6. *[Cross-validated log model evidence](/D/cvlme)* <br>
748+
&emsp;&ensp; 3.2.7. *[Empirical Bayesian log model evidence](/D/eblme)* <br>
749+
&emsp;&ensp; 3.2.8. *[Variational Bayesian log model evidence](/D/vblme)* <br>
750+
751+
3.3. Family evidence <br>
752+
&emsp;&ensp; 3.3.1. *[Definition](/D/fe)* <br>
753+
&emsp;&ensp; 3.3.2. **[Derivation](/P/fe-der)** <br>
754+
755+
3.4. Log family evidence <br>
756+
&emsp;&ensp; 3.4.1. *[Definition](/D/lfe)* <br>
757+
&emsp;&ensp; 3.4.2. **[Derivation](/P/lfe-der)** <br>
758+
&emsp;&ensp; 3.4.3. **[Calculation from log model evidences](/P/lfe-lme)** <br>
759+
760+
3.5. Bayes factor <br>
761+
&emsp;&ensp; 3.5.1. *[Definition](/D/bf)* <br>
762+
&emsp;&ensp; 3.5.2. **[Transitivity](/P/bf-trans)** <br>
763+
&emsp;&ensp; 3.5.3. **[Computation using Savage-Dickey Density Ratio](/P/bf-sddr)** <br>
764+
&emsp;&ensp; 3.5.4. **[Computation using Encompassing Prior Method](/P/bf-ep)** <br>
765+
&emsp;&ensp; 3.5.5. *[Encompassing model](/D/encm)* <br>
766+
767+
3.6. Log Bayes factor <br>
768+
&emsp;&ensp; 3.6.1. *[Definition](/D/lbf)* <br>
769+
&emsp;&ensp; 3.6.2. **[Derivation](/P/lbf-der)** <br>
770+
&emsp;&ensp; 3.6.3. **[Calculation from log model evidences](/P/lbf-lme)** <br>
771+
772+
3.7. Posterior model probability <br>
773+
&emsp;&ensp; 3.7.1. *[Definition](/D/pmp)* <br>
774+
&emsp;&ensp; 3.7.2. **[Derivation](/P/pmp-der)** <br>
775+
&emsp;&ensp; 3.7.3. **[Calculation from Bayes factors](/P/pmp-bf)** <br>
776+
&emsp;&ensp; 3.7.4. **[Calculation from log Bayes factor](/P/pmp-lbf)** <br>
777+
&emsp;&ensp; 3.7.5. **[Calculation from log model evidences](/P/pmp-lme)** <br>
778+
779+
3.8. Bayesian model averaging <br>
780+
&emsp;&ensp; 3.8.1. *[Definition](/D/bma)* <br>
781+
&emsp;&ensp; 3.8.2. **[Derivation](/P/bma-der)** <br>
782+
&emsp;&ensp; 3.8.3. **[Calculation from log model evidences](/P/bma-lme)** <br>

P/betabin-cdf.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
layout: proof
3+
mathjax: true
4+
5+
author: "Joram Soch"
6+
affiliation: "BCCN Berlin"
7+
e_mail: "joram.soch@bccn-berlin.de"
8+
date: 2022-10-22 05:28:00
9+
10+
title: "Cumulative distribution function of the beta-binomial distribution"
11+
chapter: "Probability Distributions"
12+
section: "Univariate discrete distributions"
13+
topic: "Beta-binomial distribution"
14+
theorem: "Cumulative distribution function"
15+
16+
sources:
17+
18+
proof_id: "P366"
19+
shortcut: "betabin-cdf"
20+
username: "JoramSoch"
21+
---
22+
23+
24+
**Theorem:** Let $X$ be a [random variable](/D/rvar) following a [beta-binomial distribution](/D/betabin):
25+
26+
$$ \label{eq:betabin}
27+
X \sim \mathrm{BetBin}(n,\alpha,\beta) \; .
28+
$$
29+
30+
Then, the [cumulative distribution function](/D/cdf) of $X$ is
31+
32+
$$ \label{eq:betabin-cdf}
33+
F_X(x) = \frac{1}{\mathrm{B}(\alpha,\beta)} \cdot \frac{\Gamma(n+1)}{\Gamma(\alpha+\beta+n)} \cdot \sum_{i=0}^{x} \frac{\Gamma(\alpha+i) \cdot \Gamma(\beta+n-i)}{\Gamma(i+1) \cdot \Gamma(n-i+1)}
34+
$$
35+
36+
where $\mathrm{B}(x,y)$ is the beta function and $\Gamma(x)$ is the gamma function.
37+
38+
39+
**Proof:** The [cumulative distribution function](/D/cdf) is defined as
40+
41+
$$ \label{eq:cdf}
42+
F_X(x) = \mathrm{Pr}(X \leq x)
43+
$$
44+
45+
which, for a [discrete random variable](/D/rvar-disc), evaluates to
46+
47+
$$ \label{eq:cdf-disc}
48+
F_X(x) = \sum_{i=-\infty}^{x} f_X(i) \; .
49+
$$
50+
51+
With the [probability mass function of the beta-binomial distribution](/P/betabin-pmf), this becomes
52+
53+
$$ \label{eq:betabin-cdf-s1}
54+
F_X(x) = \sum_{i=0}^{x} {n \choose i} \cdot \frac{\mathrm{B}(\alpha+i,\beta+n-i)}{\mathrm{B}(\alpha,\beta)} \; .
55+
$$
56+
57+
Using the expression of binomial coefficients in terms of factorials
58+
59+
$$ \label{eq:bincoeff-facts}
60+
{n \choose k} = \frac{n!}{k! \, (n-k)!} \; ,
61+
$$
62+
63+
the relationship between factorials and the gamma function
64+
65+
$$ \label{eq:facts-gamfct}
66+
n! = \Gamma(n+1)
67+
$$
68+
69+
and the link between gamma function and beta function
70+
71+
$$ \label{eq:betafct-gamfct}
72+
\mathrm{B}(\alpha,\beta) = \frac{\Gamma(\alpha) \, \Gamma(\beta)}{\Gamma(\alpha+\beta)} \; ,
73+
$$
74+
75+
equation \eqref{eq:betabin-cdf-s1} can be further developped as follows:
76+
77+
$$ \label{eq:betabin-cdf-s2}
78+
\begin{split}
79+
F_X(x) &\overset{\eqref{eq:bincoeff-facts}}{=} \frac{1}{\mathrm{B}(\alpha,\beta)} \cdot \sum_{i=0}^{x} \frac{n!}{i! \, (n-i)!} \cdot \mathrm{B}(\alpha+i,\beta+n-i) \\
80+
&\overset{\eqref{eq:betafct-gamfct}}{=} \frac{1}{\mathrm{B}(\alpha,\beta)} \cdot \sum_{i=0}^{x} \frac{n!}{i! \, (n-i)!} \cdot
81+
\frac{\Gamma(\alpha+i) \cdot \Gamma(\beta+n-i)}{\Gamma(\alpha+\beta+n)} \\
82+
&= \frac{1}{\mathrm{B}(\alpha,\beta)} \cdot \frac{n!}{\Gamma(\alpha+\beta+n)} \cdot \sum_{i=0}^{x}
83+
\frac{\Gamma(\alpha+i) \cdot \Gamma(\beta+n-i)}{i! \, (n-i)!} \\
84+
&\overset{\eqref{eq:facts-gamfct}}{=} \frac{1}{\mathrm{B}(\alpha,\beta)} \cdot \frac{\Gamma(n+1)}{\Gamma(\alpha+\beta+n)} \cdot \sum_{i=0}^{x}
85+
\frac{\Gamma(\alpha+i) \cdot \Gamma(\beta+n-i)}{\Gamma(i+1) \cdot \Gamma(n-i+1)} \; .
86+
\end{split}
87+
$$
88+
89+
This completes the proof.

0 commit comments

Comments
 (0)