Appendix B
Useful Facts from Probability Theory and
Statistics
B.1 Commonly Used Probability Distributions
Bernoulli Distribution
B ( x ∣ θ ) = θ x ( 1 − θ ) 1 − x , where x ∈ { 0 , 1 } i θ ∈ [ 0 , 1 ] \mathrm{B}(x|\theta) = \theta^x (1 - \theta)^{1-x}, \quad \text{where } x \in \{0, 1\} \text{ i } \theta \in [0, 1] B ( x ∣ θ ) = θ x ( 1 − θ ) 1 − x , where x ∈ { 0 , 1 } i θ ∈ [ 0 , 1 ]
E [ x ] = θ \mathbb{E}[x] = \theta E [ x ] = θ
V a r [ x ] = θ ( 1 − θ ) \mathrm{Var}[x] = \theta(1 - \theta) Var [ x ] = θ ( 1 − θ )
Categorical (Multinoulli) Distribution
M ( x ∣ θ ) = ∏ d = 1 D θ d x d , where x d ∈ { 0 , 1 } i θ d ∈ [ 0 , 1 ] for all d = 1 , 2 , … , D , \mathrm{M}(\mathbf{x}|\boldsymbol{\theta}) = \prod_{d=1}^{D} \theta_d^{x_d}, \quad \text{where } x_d \in \{0, 1\} \text{ i } \theta_d \in [0, 1] \text{ for all } d = 1, 2, \ldots, D, M ( x ∣ θ ) = d = 1 ∏ D θ d x d , where x d ∈ { 0 , 1 } i θ d ∈ [ 0 , 1 ] for all d = 1 , 2 , … , D ,
∑ d = 1 D θ d = 1 \sum_{d=1}^{D} \theta_d = 1 d = 1 ∑ D θ d = 1
E [ x d ] = θ d \mathbb{E}[x_d] = \theta_d E [ x d ] = θ d
V a r [ x d ] = θ d ( 1 − θ d ) \mathrm{Var}[x_d] = \theta_d(1 - \theta_d) Var [ x d ] = θ d ( 1 − θ d )
Normal Distribution
N ( x ∣ μ , σ 2 ) = 1 2 π σ exp { − ( x − μ ) 2 2 σ 2 } \mathcal{N}(x|\mu, \sigma^2) = \frac{1}{\sqrt{2\pi}\,\sigma} \exp \left\{ -\frac{(x - \mu)^2}{2\sigma^2} \right\} N ( x ∣ μ , σ 2 ) = 2 π σ 1 exp { − 2 σ 2 ( x − μ ) 2 }
E [ x ] = μ \mathbb{E}[x] = \mu E [ x ] = μ
V a r [ x ] = σ 2 \mathrm{Var}[x] = \sigma^2 Var [ x ] = σ 2
Multivariate Normal Distribution
N ( x ∣ μ , Σ ) = 1 ( 2 π ) D / 2 1 ∣ Σ ∣ 1 / 2 exp { − 1 2 ( x − μ ) T Σ − 1 ( x − μ ) } , \mathcal{N}(\mathbf{x}|\boldsymbol{\mu}, \boldsymbol{\Sigma}) = \frac{1}{(2\pi)^{D/2}} \frac{1}{|\boldsymbol{\Sigma}|^{1/2}} \exp \left\{ -\frac{1}{2} (\mathbf{x} - \boldsymbol{\mu})^T \boldsymbol{\Sigma}^{-1} (\mathbf{x} - \boldsymbol{\mu}) \right\}, N ( x ∣ μ , Σ ) = ( 2 π ) D /2 1 ∣ Σ ∣ 1/2 1 exp { − 2 1 ( x − μ ) T Σ − 1 ( x − μ ) } ,
where x \mathbf{x} x is D D D -dimensional vector, μ \boldsymbol{\mu} μ – D D D -dimensional vector of means, Σ \boldsymbol{\Sigma} Σ – D × D D \times D D × D covariance matrix
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022
J. M. Tomczak, Deep Generative Modeling,
https://doi.org/10.1007/978-3-030-93158-2
B Useful Facts from Probability Theory and Statistics
E [ x ] = μ \mathbb{E}[\mathbf{x}] = \boldsymbol{\mu} E [ x ] = μ
C o v [ x ] = Σ \mathrm{Cov}[\mathbf{x}] = \boldsymbol{\Sigma} Cov [ x ] = Σ
Beta Distribution
B e t a ( x ∣ a , b ) = Γ ( a + b ) Γ ( a ) Γ ( b ) x a − 1 ( 1 − x ) b − 1 , \mathrm{Beta}(x|a, b) = \frac{\Gamma(a + b)}{\Gamma(a)\Gamma(b)} x^{a-1} (1 - x)^{b-1}, Beta ( x ∣ a , b ) = Γ ( a ) Γ ( b ) Γ ( a + b ) x a − 1 ( 1 − x ) b − 1 ,
where x ∈ [ 0 , 1 ] x \in [0, 1] x ∈ [ 0 , 1 ] and a > 0 a > 0 a > 0 i b > 0 b > 0 b > 0 , Γ ( x ) = ∫ 0 ∞ t x − 1 e − t d t \Gamma(x) = \int_{0}^{\infty} t^{x-1} e^{-t} \mathrm{d}t Γ ( x ) = ∫ 0 ∞ t x − 1 e − t d t
E [ x ] = a a + b \mathbb{E}[x] = \frac{a}{a+b} E [ x ] = a + b a
V a r [ x ] = a b ( a + b ) 2 ( a + b + 1 ) \mathrm{Var}[x] = \frac{ab}{(a+b)^2(a+b+1)} Var [ x ] = ( a + b ) 2 ( a + b + 1 ) ab
Marginal Distribution
In the continuous case:
p ( x ) = ∫ p ( x , y ) d y p(x) = \int p(x, y) \mathrm{d}y p ( x ) = ∫ p ( x , y ) d y
and in the discrete case:
p ( x ) = ∑ y p ( x , y ) p(x) = \sum_{y} p(x, y) p ( x ) = y ∑ p ( x , y )
Conditional Distribution
p ( y ∣ x ) = p ( x , y ) p ( x ) p(y|x) = \frac{p(x, y)}{p(x)} p ( y ∣ x ) = p ( x ) p ( x , y )
Marginal Distribution and Conditional Distribution for Multivariate Normal Distribution
Assume x ∼ N ( μ , Σ ) \mathbf{x} \sim \mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma}) x ∼ N ( μ , Σ ) , where
x = [ x a x b ] , μ = [ μ a μ b ] , Σ = [ Σ a Σ c Σ c T Σ b ] , \mathbf{x} = \begin{bmatrix} \mathbf{x}_a \\ \mathbf{x}_b \end{bmatrix}, \quad \boldsymbol{\mu} = \begin{bmatrix} \boldsymbol{\mu}_a \\ \boldsymbol{\mu}_b \end{bmatrix}, \quad \boldsymbol{\Sigma} = \begin{bmatrix} \boldsymbol{\Sigma}_a & \boldsymbol{\Sigma}_c \\ \boldsymbol{\Sigma}_c^T & \boldsymbol{\Sigma}_b \end{bmatrix}, x = [ x a x b ] , μ = [ μ a μ b ] , Σ = [ Σ a Σ c T Σ c Σ b ] ,
then we get the following dependencies:
p ( x a ) = N ( x a ∣ μ a , Σ a ) , p(\mathbf{x}_a) = \mathcal{N}(\mathbf{x}_a | \boldsymbol{\mu}_a, \boldsymbol{\Sigma}_a), p ( x a ) = N ( x a ∣ μ a , Σ a ) ,
p ( x a ∣ x b ) = N ( x a ∣ μ ^ a , Σ ^ a ) , p(\mathbf{x}_a | \mathbf{x}_b) = \mathcal{N}(\mathbf{x}_a | \hat{\boldsymbol{\mu}}_a, \hat{\boldsymbol{\Sigma}}_a), p ( x a ∣ x b ) = N ( x a ∣ μ ^ a , Σ ^ a ) , where
μ ^ a = μ a + Σ c Σ b − 1 ( x b − μ b ) , \hat{\boldsymbol{\mu}}_a = \boldsymbol{\mu}_a + \boldsymbol{\Sigma}_c \boldsymbol{\Sigma}_b^{-1} (\mathbf{x}_b - \boldsymbol{\mu}_b), μ ^ a = μ a + Σ c Σ b − 1 ( x b − μ b ) ,
Σ ^ a = Σ a − Σ c Σ b − 1 Σ c T . \hat{\boldsymbol{\Sigma}}_a = \boldsymbol{\Sigma}_a - \boldsymbol{\Sigma}_c \boldsymbol{\Sigma}_b^{-1} \boldsymbol{\Sigma}_c^T. Σ ^ a = Σ a − Σ c Σ b − 1 Σ c T .
B Useful Facts from Probability Theory and Statistics
Sum Rule
p ( x ) = ∑ y p ( x , y ) p(x) = \sum_{y} p(x, y) p ( x ) = y ∑ p ( x , y )
Product Rule
p ( x , y ) = p ( x ∣ y ) p ( y ) p(x, y) = p(x|y)p(y) p ( x , y ) = p ( x ∣ y ) p ( y )
= p ( y ∣ x ) p ( x ) = p(y|x)p(x) = p ( y ∣ x ) p ( x )
Bayes’ Rule
p ( y ∣ x ) = p ( x ∣ y ) p ( y ) p ( x ) p(y|x) = \frac{p(x|y)p(y)}{p(x)} p ( y ∣ x ) = p ( x ) p ( x ∣ y ) p ( y )
B.2 Statistics
Maximum Likelihood Estimator
There are given N N N independent examples of x \mathbf{x} x from the identical distribution p ( x ∣ θ ) p(\mathbf{x}|\theta) p ( x ∣ θ ) , D = { x 1 … x N } \mathcal{D} = \{\mathbf{x}_1 \ldots \mathbf{x}_N\} D = { x 1 … x N } . The likelihood function is the following function:
p ( D ∣ θ ) = ∏ n = 1 N p ( x n ∣ θ ) . p(\mathcal{D}|\theta) = \prod_{n=1}^{N} p(\mathbf{x}_n|\theta). p ( D ∣ θ ) = n = 1 ∏ N p ( x n ∣ θ ) .
The logarithm of the likelihood function p ( D ∣ θ ) p(\mathcal{D}|\theta) p ( D ∣ θ ) is given by the following expression:
log p ( D ∣ θ ) = ∑ n = 1 N log p ( x n ∣ θ ) . \log p(\mathcal{D}|\theta) = \sum_{n=1}^{N} \log p(\mathbf{x}_n|\theta). log p ( D ∣ θ ) = n = 1 ∑ N log p ( x n ∣ θ ) .
Maximum likelihood estimator of the parameters θ M L \theta_{ML} θ M L minimizes the likelihood function:
p ( D ∣ θ M L ) = max θ p ( D ∣ θ ) . p(\mathcal{D}|\theta_{ML}) = \max_{\theta} p(\mathcal{D}|\theta). p ( D ∣ θ M L ) = θ max p ( D ∣ θ ) .
Maximum A Posteriori Estimator
There are given N N N independent examples of x \mathbf{x} x from the identical distribution p ( x ∣ θ ) p(\mathbf{x}|\theta) p ( x ∣ θ ) , D = { x 1 … x N } \mathcal{D} = \{\mathbf{x}_1 \ldots \mathbf{x}_N\} D = { x 1 … x N } . Maximum a posteriori (MAP) estimator of the parameters θ M A P \theta_{MAP} θ M A P
B Useful Facts from Probability Theory and Statistics
minimizes the a posteriori distribution:
p ( θ M A P ∣ D ) = max θ p ( θ ∣ D ) . p(\theta_{MAP}|\mathcal{D}) = \max_{\theta} p(\theta|\mathcal{D}). p ( θ M A P ∣ D ) = θ max p ( θ ∣ D ) .
Risk in Decision Making
Risk (expected loss) is defined as follows:
R [ y ˉ ] = ∬ L ( y , y ˉ ( x ) ) p ( x , y ) d x d y , \mathcal{R}[\bar{y}] = \iint L(y, \bar{y}(\mathbf{x})) \, p(\mathbf{x}, y) \mathrm{d}\mathbf{x} \mathrm{d}y, R [ y ˉ ] = ∬ L ( y , y ˉ ( x )) p ( x , y ) d x d y ,
where L ( ⋅ , ⋅ ) L(\cdot, \cdot) L ( ⋅ , ⋅ ) is the loss function.