-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
551 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
+++ | ||
title = "Gaussian" | ||
author = ["Houjun Liu"] | ||
draft = false | ||
+++ | ||
|
||
The [Gaussian]({{< relref "KBhgaussian.md" >}}), in general, gives: | ||
|
||
\begin{equation} | ||
e^{-\frac{ax^{2}}{2}} | ||
\end{equation} | ||
|
||
which is a Bell-Shaped curve. It's pretty darn important | ||
|
||
|
||
## [Heat Equation]({{< relref "KBhheat_equation.md" >}}) and [Gaussian]({{< relref "KBhgaussian.md" >}}) {#heat-equation--kbhheat-equation-dot-md--and-gaussian--kbhgaussian-dot-md} | ||
|
||
\begin{equation} | ||
H(t,x) = \frac{1}{\sqrt{2\pi} t}e^{-\frac{x^{2}}{2t}} | ||
\end{equation} | ||
|
||
You will note that \\(H\\) **does** satisfy the heat equation: | ||
|
||
\begin{equation} | ||
\pdv{U}{t} = \pdv[2]{U}{x} | ||
\end{equation} | ||
|
||
|
||
### solving [Heat Equation]({{< relref "KBhheat_equation.md" >}}) without boundary {#solving-heat-equation--kbhheat-equation-dot-md--without-boundary} | ||
|
||
Consider the partial [Fourier Transform]({{< relref "KBhfourier_transform.md" >}}) on the \\(x\\) variable of the heat equation. | ||
|
||
\begin{equation} | ||
U(t,x) = \frac{1}{2\pi} \int\_{\mathbb{R}} e^{ix\lambda} \hat{U} \qty(t,\lambda) \dd{\lambda} | ||
\end{equation} | ||
|
||
Taking derivatives of this: | ||
|
||
\begin{equation} | ||
\pdv{U}{t} (t,x) = \frac{1}{2\pi} \int\_{\mathbb{R}} e^{i\lambda x} \pdv{\hat{U}}{t} (t,\lambda) \dd{\lambda} | ||
\end{equation} | ||
|
||
and: | ||
|
||
\begin{equation} | ||
\pdv[2]{U}{x} = \frac{1}{2\pi} \int\_{\mathbb{R}} \qty(-\lambda^{2}) e^{ix \lambda } \hat{U}(t,\lambda) \dd{\lambda} | ||
\end{equation} | ||
|
||
Because these two are equal, it gives us that: | ||
|
||
\begin{equation} | ||
\hat{U}(t,\lambda) = -\lambda^{2} \hat{U}(t,\lambda) | ||
\end{equation} | ||
|
||
meaning: | ||
|
||
\begin{equation} | ||
\hat{U}(t,\lambda) = a(\lambda)e^{-\lambda^{2}(t)} | ||
\end{equation} | ||
|
||
Finally, at: | ||
|
||
\begin{equation} | ||
\hat{U}(0,\lambda) = a(\lambda) = \hat{f}(\lambda) | ||
\end{equation} | ||
|
||
We see that: | ||
|
||
\begin{equation} | ||
\hat{U}(t,\lambda) = \hat{f}(\lambda)e^{-\lambda^{2}(t)} | ||
\end{equation} | ||
|
||
To get our original function back, we need to inverse Fourier transform it: | ||
|
||
\begin{equation} | ||
U(t,x) = \frac{1}{2\pi} \int\_{\mathbb{R}} e^{ix\lambda - \lambda^{2}t} \hat{f}(\lambda) \dd{\lambda} | ||
\end{equation} | ||
|
||
|
||
### closed form solution {#closed-form-solution} | ||
|
||
\begin{equation} | ||
U(t,x) = \frac{1}{\sqrt{2\pi} t} \int\_{\mathbb{R}} f(y) e^{-\frac{(x-y)^{2}}{2t}} \dd{y} | ||
\end{equation} | ||
|
||
this is exactly: | ||
|
||
\begin{equation} | ||
\int\_{\mathbb{R}}f(y) H(t,(x-y)) \dd{y} = \int\_{\mathbb{R}}\frac{1}{\sqrt{2\pi} t}e^{-\frac{(x-y)^{2}}{2t}} f(y) \dd{y} | ||
\end{equation} | ||
|
||
We can understand this when \\(t \to 0\\), where there is a single, narrow, area \\(1\\) band which we sweep across all of \\(y\\). Because its thin and \\(1\\), its basically \\(f(x)\\) at each \\(y\\). | ||
|
||
|
||
## Integrating Gaussian, more Generally {#integrating-gaussian-more-generally} | ||
|
||
Let's integrate: | ||
|
||
\begin{equation} | ||
\int\_{-\infty}^{\infty} e^{-\frac{{ax}^{2}}{2}} \dd{x} | ||
\end{equation} | ||
|
||
Let's replace: \\(s = \sqrt{a} x\\) | ||
|
||
This gives us that (based on [Integrating Gaussian](#integrating-gaussian)): | ||
|
||
\begin{equation} | ||
x = \sqrt{\frac{2\pi}{a}} | ||
\end{equation} | ||
|
||
If we replace \\(a\\) by \\(\frac{1}{t}\\), we obtain: | ||
|
||
\begin{equation} | ||
\frac{1}{\sqrt{2\pi}t} \int\_{-\infty}^{\infty} e^{-\frac{x^{2}}{2t}} \dd{x} = 1 | ||
\end{equation} | ||
|
||
by rescaling \\(x(a)\\) function above. | ||
|
||
If \\(t\\) increases, you will see that this function diffuses from a single point at \\(0\\) and spreading out. Notice, that over the whole real line, no matter what the \\(t\\) is, you always end up with integral \\(1\\). | ||
|
||
|
||
## Integrating Gaussian {#integrating-gaussian} | ||
|
||
Let's integrate: | ||
|
||
\begin{equation} | ||
\int\_{-\infty}^{\infty} e^{-\frac{x^{2}}{2}} \dd{x} | ||
\end{equation} | ||
|
||
--- | ||
|
||
computing this is funny: | ||
|
||
\begin{equation} | ||
A \cdot A = \int\_{-\infty}^{\infty} e^{-\frac{x^{2}}{2}} \dd{x} \int\_{-\infty}^{\infty} e^{-\frac{y^{2}}{2}} \dd{y} | ||
\end{equation} | ||
|
||
We can think of this as a double integral: | ||
|
||
\begin{equation} | ||
A \cdot A = \int\_{-\infty}^{\infty} \int\_{-\infty}^{\infty} e^{-\frac{x^{2}}{2}} e^{-\frac{y^{2}}{2}} \dd{x} \dd{y} | ||
\end{equation} | ||
|
||
meaning we get: | ||
|
||
\begin{equation} | ||
A \cdot A = \int\_{-\infty}^{\infty} \int\_{-\infty}^{\infty} e^{-\frac{x^{2}+y^{2}}{2}} \dd{x} \dd{y} | ||
\end{equation} | ||
|
||
Its polar time; recall: | ||
|
||
\begin{equation} | ||
x^{2} + y^{2} = r^{2} | ||
\end{equation} | ||
|
||
we can now go over this whole thing by converting into polar (notice the extra factor \\(r\\)): | ||
|
||
\begin{equation} | ||
A \cdot A = \int\_{0}^{2\pi} \int\_{0}^{\infty} e^{-\frac{r^{2}}{2}} r \dd{r} \dd{\theta} | ||
\end{equation} | ||
|
||
very suddenly we can use u sub on \\(r\\) to obtain: | ||
|
||
\begin{equation} | ||
2\pi \int\_{0}^{\infty} e^{-u} \dd{u} = 2\pi \cdot 1 = 2\pi | ||
\end{equation} | ||
|
||
Meaning: | ||
|
||
\begin{equation} | ||
A = \sqrt{2\pi} | ||
\end{equation} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
+++ | ||
title = "Markov Chain" | ||
author = ["Houjun Liu"] | ||
draft = false | ||
+++ | ||
|
||
A [Markov Chain]({{< relref "KBhmarkov_chain.md" >}}) is a chain of \\(N\\) states, with an \\(N \times N\\) transition matrix. | ||
|
||
1. at each step, we are in exactly one of those states | ||
2. the matrix \\(P\_{ij}\\) tells us \\(P(j|i)\\), the probability of going to state \\(j\\) given you are at state \\(i\\) | ||
|
||
And therefore: | ||
|
||
\begin{equation} | ||
\sum\_{j=1}^{N} P\_{ij} = 1 | ||
\end{equation} | ||
|
||
|
||
## Ergotic Markov Chain {#ergotic-markov-chain} | ||
|
||
a markov chain is [Ergotic](#ergotic-markov-chain) if... | ||
|
||
1. you have a path from any one state to any other | ||
2. for any start state, after some time \\(T\_0\\), the probability of being in any state at any \\(T > T\_0\\) is non-zero | ||
|
||
Every [Ergotic Markov Chain](#ergotic-markov-chain) has a long-term visit rate: | ||
|
||
i.e. a steady state visitation count exists. We usually call it: | ||
|
||
\begin{equation} | ||
\pi = \qty(\pi\_{i}, \dots, \pi\_{n}) | ||
\end{equation} | ||
|
||
|
||
### Computing steady state {#computing-steady-state} | ||
|
||
Fact: | ||
|
||
let's declare that \\(\pi\\) is the steady state to a transition matrix \\(T\\); recall that the FROM states are the rows, which means that \\(\pi\\) has to be a row vector; \\(\pi\\) being a steady state makes: | ||
|
||
\begin{equation} | ||
\pi T = \pi | ||
\end{equation} | ||
|
||
This is a left e.v. with [eigenvalue]({{< relref "KBheigenvalue.md" >}}) \\(1\\), which is the principle [eigenvector]({{< relref "KBheigenvalue.md" >}}) of \\(T\\) as transition matricies always have [eigenvector]({{< relref "KBheigenvalue.md" >}}) eigenvalue to \\(1\\). |
Oops, something went wrong.