<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Probability Distributions |</title><link>https://kristianeschenburg.netlify.app/tag/probability-distributions/</link><atom:link href="https://kristianeschenburg.netlify.app/tag/probability-distributions/index.xml" rel="self" type="application/rss+xml"/><description>Probability Distributions</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Thu, 08 Nov 2018 01:12:32 -0700</lastBuildDate><image><url>https://kristianeschenburg.netlify.app/img/Bayes.jpg</url><title>Probability Distributions</title><link>https://kristianeschenburg.netlify.app/tag/probability-distributions/</link></image><item><title>Overview of Poisson-Multinomial Relationship</title><link>https://kristianeschenburg.netlify.app/post/overview-of-poisson-multinomial-relationship/</link><pubDate>Thu, 08 Nov 2018 01:12:32 -0700</pubDate><guid>https://kristianeschenburg.netlify.app/post/overview-of-poisson-multinomial-relationship/</guid><description>&lt;p>In this post, I&amp;rsquo;m going to briefly cover the relationship between the Poisson distribution and the Multinomial distribution.&lt;/p>
&lt;p>Let&amp;rsquo;s say that we have a set of independent, Poisson-distributed random variables $Y_{1}, Y_{2}&amp;hellip; Y_{k}$ with rate parameters $\lambda_{1}, \lambda_{2}, &amp;hellip;\lambda_{k}$. We can model the sum of these random variables as a new random variable $N = \sum_{i=1}^{k} Y_{i}$.&lt;/p>
&lt;p>Let start with $k=2$. We can define the distrbution of $F_{N}(n)$ as follows:&lt;/p>
&lt;p>$$\begin{align}
&amp;amp;= P(N \leq n) \\
&amp;amp;= P(Y_{1} + Y_{2} \leq n) \\
&amp;amp;= P(Y_{1} = y_{1}, Y_{2} = n - y_{1}) \\
&amp;amp;= P(Y_{1} = y_{1}) \cdot P(Y_{2} = n-y_{1}) \\
&amp;amp;= \sum_{y_{1}=0}^{n} \frac{e^{-\lambda_{1}}\lambda_{1}^{y_{1}}}{y_{1}!} \cdot \frac{e^{-\lambda_{2}}\lambda_{2}^{n-y_{1}}}{(n-y_{1})!} \\
&amp;amp;= e^{-(\lambda_{1}+\lambda_{2})} \sum_{y_{1}=0}^{n} \frac{\lambda_{1}^{y_{1}}\lambda_{2}^{n-y_{1}}}{y_{1}!(n-y_{1})!} \\
&amp;amp;= e^{-(\lambda_{1}+\lambda_{2})} \sum_{y_{1}=0}^{n} \frac{n!}{n!}\frac{\lambda_{1}^{y_{1}}\lambda_{2}^{n-y_{1}}}{y_{1}!(n-y_{1})!} \\
&amp;amp;= \frac{e^{-(\lambda_{1}+\lambda_{2})}}{n!} \sum_{y_{1}=0}^{n} {n\choose y_{1}} \lambda_{1}^{y_{1}}\lambda_{2}^{n-y_{1}}
\end{align}$$&lt;/p>
&lt;p>Here, we can apply the Binomial Theorem to the summation to get the following (remember that the Binomial Theorem says, for two numbers $x$ and $y$, that $(x+y)^{n} = \sum_{i=0}^{n} {n \choose i}x^{i}y^{n-i}$):&lt;/p>
&lt;p>$$\begin{align}
\frac{e^{-(\lambda_{1}+\lambda_{2})}(\lambda_{1} + \lambda_{2})^{n}}{n!} \\
\end{align}$$&lt;/p>
&lt;p>which we see is in fact just another Poisson distribution with rate parameter equal to $\lambda_{1} + \lambda_{2}$. This shows that the sum of independent Poisson distributed random variables is also a Poisson random variable, with rate parameter equal to the sum of the univariate rates. By induction, we see that for $k$ independent Poisson distributed random variables $Y_{1}&amp;hellip;Y_{k}$, their sum $\sum_{i=1}^{k} Y_{i} \sim Poisson(\sum_{i=1}^{k} \lambda_{i})$.&lt;/p>
&lt;p>Now let&amp;rsquo;s say we&amp;rsquo;re interested in modeling the conditional distribution of $(Y_{1}&amp;hellip;Y_{k}) \mid \sum_{i=1}^{k} = n$. By definition of conditional probability, we have that&lt;/p>
&lt;p>$$\begin{align}
P(\bar{Y} \mid N=n) &amp;amp;= \frac{P(\bar{Y} ; \cap ; N=n)}{P(N=n)} \\
&amp;amp;= \frac{P(\bar{Y})}{P(N=n)}
\end{align}$$&lt;/p>
&lt;p>We have the following:&lt;/p>
&lt;p>$$\begin{align}
P(\bar{Y} \mid N=n) &amp;amp;= \frac{P(\bar{Y} \; \cap \; N=n)}{P(N=n)} \\
&amp;amp;= \Big( \prod_{i=1}^{k} \frac{e^{-\lambda_{i}} \cdot \lambda_{i}^{y_{i}}}{y_{i}!} \Big) \Big/ \frac{e^{-\sum_{i=1}^{k} \lambda_{i}}(\sum_{i}^{k} \lambda_{i})^{n}}{n!} \\
&amp;amp;= \Big( \frac{ e^{-\sum_{i=1}^{k}} \prod_{i=1}^{k} \lambda_{i}^{y_{i}}}{\prod_{i=1}^{k} y_{i}!} \Big) \Big/ \frac{e^{-\sum_{i=1}^{k} \lambda_{i}}(\sum_{i}^{k} \lambda_{i})^{n}}{n!} \\
&amp;amp;= { n \choose y_{1}, y_{2}, &amp;hellip;y_{k}} \frac{\prod_{i=1}^{k} \lambda_{i}^{y_{i}}} { \sum_{i}^{k} \lambda_{i})^{n}} \\
&amp;amp;= { n \choose y_{1}, y_{2}, &amp;hellip;y_{k}} \prod_{i=1}^{k} \Big( \frac{ \lambda_{i} }{\sum_{i}^{k} \lambda_{i}} \Big)^{y_{i}} \\
&amp;amp;\sim MultiNom(n; \frac{\lambda_{1}}{\sum_{i=1}^{k}}, \frac{\lambda_{2}}{\sum_{i=1}^{k}}, &amp;hellip; \frac{\lambda_{k}}{\sum_{i=1}^{k}})
\end{align}$$&lt;/p>
&lt;p>So finally, we see that, given the sum of independent Poisson random variables, that conditional distribution of each element of the Poisson vector is Multinomial distributed, with count probabilities scaled by the sum of the individual rates. Importantly, we can extend these ideas (specifically the sum of independent Poisson random variables) to other models, such as splitting and merging homogenous and non-homogenous Poisson Point Processes.&lt;/p></description></item><item><title>Multivariate Normal Distribution</title><link>https://kristianeschenburg.netlify.app/post/multivariate-normal-distribution/</link><pubDate>Sat, 12 May 2018 03:14:14 -0700</pubDate><guid>https://kristianeschenburg.netlify.app/post/multivariate-normal-distribution/</guid><description>&lt;p>In this post, I&amp;rsquo;ll be covering the basics of Multivariate Normal Distributions, with special emphasis on deriving the conditional and marginal distributions.&lt;/p>
&lt;p>Given a random variable under the usual Gauss-Markov assumptions, with $y_{i} \sim N(\mu, \sigma^{2})$ with $e \sim N(0,\sigma^{2})$, and $N$ independent samples $y_{1}&amp;hellip;y_{n}$, we can define vector $\mathbf{y} = [y_{1}, y_{2},&amp;hellip;y_{n}] \sim N_{n}(\mathbf{\mu},\sigma^{2}I)$ with $\mathbf{e} \sim N_{n}(\mathbf{0},\sigma^{2}I)$. We can see from the covariance structure of the errors that all off-diagonal elements are 0, indicating that our samples are independent with equal variances.&lt;/p>
&lt;p>&lt;strong>Marginal Distributions&lt;/strong>&lt;/p>
&lt;p>Now assume that $\mathbf{y} = [\mathbf{y_{1}}, \mathbf{y_{2}} ] \sim N(\mathbf{\mu},\Sigma)$, where $\mathbf{\mu} = \begin{bmatrix} \mu_{1} \ \mu_{2} \end{bmatrix}$, and $\Sigma$ is an arbitrary covariance matrix, where we cannot assume independence. If $\Sigma$ is non-singular, we can decompose $\Sigma$ as&lt;/p>
&lt;p>$$ \Sigma = \begin{bmatrix}
\Sigma_{11} &amp;amp; \Sigma_{21}^{T} \\
\Sigma_{21} &amp;amp; \Sigma_{22}
\end{bmatrix}$$&lt;/p>
&lt;p>and, using the inversion lemmas from
&lt;a href="https://kristianeschenburg.netlify.app/post/blockwise-matrix-inversion/">Blockwise Matrix Inversion&lt;/a>, define its inverse $\Sigma^{-1} = V$ as&lt;/p>
&lt;p>$$
V = \begin{bmatrix}
V_{11} &amp;amp; V_{21}^{T} \\
V_{21} &amp;amp; V_{22} \\
\end{bmatrix}
\begin{bmatrix}
(\Sigma_{11} - \Sigma_{12}\Sigma_{22}^{-1}\Sigma_{21})^{-1} &amp;amp; -\Sigma^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1} \\
-\Sigma_{22}^{-1}\Sigma_{21}(\Sigma_{11}-\Sigma_{12}\Sigma_{22}^{-1}\Sigma_{21})^{-1} &amp;amp; (\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}
\end{bmatrix}$$&lt;/p>
&lt;p>From the properties of transformations of Normal random variables, we can define the marginal of $$y_{1}$$ as&lt;/p>
&lt;p>$$\begin{align}
By \sim N(B\mu,B\Sigma B^{T})
\end{align}$$&lt;/p>
&lt;p>where $B = \begin{bmatrix} \mathbf{I} &amp;amp; 0 \end{bmatrix}$ such that&lt;/p>
&lt;p>$$ \begin{bmatrix} \mathbf{I} &amp;amp; 0 \end{bmatrix} \begin{bmatrix} \mathbf{\mu_{1}} \ \mathbf{\mu_{2}} \end{bmatrix} = \mathbf{\mu_{1}}$$
$$\begin{bmatrix} \mathbf{I} &amp;amp; 0
\end{bmatrix} \begin{bmatrix}
\Sigma_{11} &amp;amp; \Sigma_{12} \\
\Sigma_{21} &amp;amp; \Sigma_{22}
\end{bmatrix}
\begin{bmatrix}
\mathbf{I} \\
0
\end{bmatrix} = \Sigma_{11}$$&lt;/p>
&lt;p>so that $\mathbf{y_{1}} \sim N(\mathbf{\mu_{1}},\Sigma_{11})$.&lt;/p>
&lt;p>&lt;strong>Conditional Distributions&lt;/strong>&lt;/p>
&lt;p>Showing the conditional distribution is a bit long-winded, so bear with me. We are interested in finding the distribution of $y_{2}\mid y_{1}$, which we can explicitly represent as&lt;/p>
&lt;p>$$\begin{align}
f_{y_{1}}(y_{2} \mid y_{1}) = \frac{f_{y_{1},y_{2}}(y_{1},y_{2})}{f_{y_{1}}(y_{1})}
\end{align}$$&lt;/p>
&lt;p>Writing out the joint density for $y$, we have the following&lt;/p>
&lt;p>$$\begin{align}
f(y) = \frac{1}{(2\pi)^{n/2}\mid \Sigma \mid ^{1/2}}\exp^{(-1/2)(y-\mu)^{T}\Sigma^{-1}(y-\mu)}
\end{align}$$&lt;/p>
&lt;p>Partitioning this expression up into the individual terms related to $y_{1}$ and $y_{2}$, the exponent becomes&lt;/p>
&lt;p>$$ (y-\mu)^{T}V(y-\mu) = \begin{bmatrix}
y_{1} - \mu_{1} \\
y_{2} - \mu_{2} \end{bmatrix}^{T}
\begin{bmatrix}
V_{11} &amp;amp; V_{12} \\
V_{21} &amp;amp; V_{22} \end{bmatrix}
\begin{bmatrix}
y_{1} - \mu_{1} \\
y_{2} - \mu_{2}
\end{bmatrix}$$&lt;/p>
&lt;p>Expanding this quadratic form out, we see that we end up with&lt;/p>
&lt;p>$$\begin{align}
(y_{1} - \mu_{1})^{T} V_{11}^{-1}(y_{1}-\mu_{1}) + 2(y_{1}-\mu_{1})^{T}V_{12}(y_{2}-\mu_{2}) + (y_{2} - \mu_{2})^{T}V_{22}(y_{2}-\mu_{2})
\end{align}$$&lt;/p>
&lt;p>Let us, for simplicity, set $z_{1} = (y_{1} - \mu_{1})$ and $z_{2} = (y_{2} - \mu_{2})$. Substituting back in our definitions of $V_{11}$,$V_{12}$,$V_{21}$, and $V_{22}$, and using the Sherman-Morrison-Woodbury definition for $V_{11}$, we have the following&lt;/p>
&lt;p>$$\begin{align}
&amp;amp;z_{1}^{T}(\Sigma_{11}^{-1} + \Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}\Sigma_{21}\Sigma_{11})z_{1} \\
&amp;amp;- 2z_{1}^{T}(\Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12}^{-1})^{-1})z_{2} \\
&amp;amp;+ z_{2}^{T}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1})z_{2}
\end{align}$$&lt;/p>
&lt;p>which, by distribution of $z_{1}$ across the first term and splitting the second term into its two sums, we have&lt;/p>
&lt;p>$$\begin{align}
&amp;amp;z_{1}^{T}\Sigma_{11}^{-1}z_{11} + z_{1}^{T}\Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}V_{11}^{-1}\Sigma_{12})^{-1}\Sigma_{21}\Sigma_{11}^{-1}z_{1} \\
&amp;amp;- z_{1}^{T}(\Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1})z_{2} - z_{1}^{T}(\Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1})z_{2} \\
&amp;amp;+ z_{2}^{T}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1})z_{2}
\end{align}$$&lt;/p>
&lt;p>We can pull out forms $z_{1}^{T}\Sigma_{11}^{-1}\Sigma_{12}(\Sigma_{22}-\Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}$ to the left and $(\Sigma_{22}-\Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}z_{2}$ to the right and, after applying a transpose, have&lt;/p>
&lt;p>$$\begin{align}
=z_{1}^{T}\Sigma_{11}^{-1}z_{11} + (z_{2} -\Sigma_{21}\Sigma_{11}^{-1}z_{1})^{T}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}(z_{2} - \Sigma_{21}\Sigma_{11}^{-1}z_{1})
\end{align}$$&lt;/p>
&lt;p>Plugging the above back into our exponential term in our original density function, we see that we have a product of two exponential terms&lt;/p>
&lt;p>$$\begin{align}
&amp;amp;\frac{1}{C_{1}} \exp(\frac{-1}{2}(z_{1}^{T}\Sigma_{11}^{-1}z_{11})) \\
\end{align}$$&lt;/p>
&lt;p>and&lt;/p>
&lt;p>$$\begin{align}
&amp;amp;\frac{1}{C_{2}}\exp(\frac{-1}{2}(z_{2} - z_{1}\Sigma_{11}^{-1}\Sigma_{12})^{T}(\Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12})^{-1}(z_{2} - \Sigma_{21}\Sigma_{11}^{-1}z_{1}))
\end{align}$$&lt;/p>
&lt;p>where&lt;/p>
&lt;p>$$\begin{align}
C_{1} &amp;amp;= (2\pi)^{p/2}\mid \Sigma_{11} \mid^{1/2} \\
C_{2} &amp;amp;= (2\pi)^{q/2}\mid \Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12} \mid ^{1/2}
\end{align}$$&lt;/p>
&lt;p>The first term is the marginal density of $y_{1}$ and the second is the conditional density of $y_{2} \mid y_{1}$ with conditional mean $\mu_{2\mid 1} = \mu_{2} + \Sigma_{11}^{-1}\Sigma_{12}(y_{1} - \mu_{1})$ and conditional variance $\Sigma_{2\mid 1} = \Sigma_{22} - \Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12}$.&lt;/p>
&lt;p>While long and drawn out, the formulas show that the conditional distribution of any subset of Normal random variables, given another subset, is also a Normal distribution, with conditional mean and variance defined by functions of the means and covariances of the original random vector.&lt;/p></description></item></channel></rss>