Skip to content

Commit

Permalink
kb autocommit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Mar 8, 2024
1 parent 399ecd2 commit f62b5cb
Show file tree
Hide file tree
Showing 13 changed files with 551 additions and 4 deletions.
62 changes: 61 additions & 1 deletion content/posts/KBhfourier_transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Where,
\end{equation}

\begin{equation}
f(x) = \frac{1}{2\pi} \int\_{\infty}^{\infty} e^{ix\lambda} \hat{f}(\lambda) \dd{\lambda}
f(x) = \frac{1}{2\pi} \int\_{\infty}^{-\infty} e^{ix\lambda} \hat{f}(\lambda) \dd{\lambda}
\end{equation}

We sometimes write:
Expand Down Expand Up @@ -91,6 +91,66 @@ Consider also:
you can show this in a similar way, by attempting to distribute a \\(\dv \lambda\\) into the Fourier transform and showing that they are equal.


### Fourier Transform of a Gaussian {#fourier-transform-of-a-gaussian}

\begin{equation}
\mathcal{F}\qty(e^{-\frac{ax^{2}}{2}}) = \sqrt{\frac{2\pi}{a}}e^{-\frac{\lambda^{2}}{2a}}
\end{equation}

and:

\begin{equation}
\mathcal{F}^{-1}\qty(e^{-a\frac{\lambda^{2}}{2}}) = \frac{e^{-\frac{x^{2}}{2a}}}{\sqrt{2\pi a}}
\end{equation}

---

we obtain this:

\begin{equation}
u = e^{-\frac{x^{2}}{2}}
\end{equation}

and:

\begin{equation}
\dv{u}{x} = -xe^{-\frac{x^{2}}{2}} = -xu
\end{equation}

and if we took a Fourier transform on both sides, we obtain:

\begin{equation}
\mathcal{F}\qty(\dv{u}{x} + xu) = 0 = i \lambda \hat{u} + i \pdv{\hat{u}} = 0
\end{equation}

and note that this is the same equation. Meaning:

\begin{equation}
\mathcal{F}\qty(\dv{u}{x} + xu) = \dv{\lambda}{x} + \lambda u
\end{equation}

this gives:

\begin{equation}
\mathcal{F}(u) = Cu
\end{equation}

which is what we see.


### Look! A table {#look-a-table}

{{< figure src="/ox-hugo/2024-03-06_21-36-14_screenshot.png" >}}

where:

\begin{equation}
\Lambda\_{a}
\end{equation}

is the triangle between \\([-a, a]\\), that goes up to \\(1\\).


### interpreting \\(\lambda\\) {#interpreting-lambda}


Expand Down
172 changes: 172 additions & 0 deletions content/posts/KBhgaussian.md
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}
2 changes: 1 addition & 1 deletion content/posts/KBhgaussian_distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Z=\mathcal{N}(0,1)
mean 0, variance 1. You can transform anything into a standard normal via the following linear transform:


#### transformation into [standard normal](#standard-normal) {#transformation-into-standard-normal--orgb5839a8}
#### transformation into [standard normal](#standard-normal) {#transformation-into-standard-normal--org430b977}

\begin{equation}
X \sim \mathcal{N}(\mu, \sigma^{2})
Expand Down
8 changes: 7 additions & 1 deletion content/posts/KBhheat_equation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ and with [Neumann Conditions]({{< relref "KBhsu_math53_feb232024.md#neumann-cond
u\_{k}(t,x) = \sum b\_{k} e^{ - \frac{k^{2} \pi^{2}}{l^{2}} t } \cos \qty( \frac{k \pi x}{l})
\end{equation}

with infinite boundaries:

\begin{equation}
U(t,x) =\frac{1}{\sqrt{4 \pi \alpha t}} \int\_{\mathbb{R}} f(y) e^{-\frac{(x-y)^{2}}{4\alpha t}} \dd{y}
\end{equation}

general system:

\begin{equation}
Expand All @@ -47,7 +53,7 @@ you can remove the constant by finanglisng because the constant drops out when s

## damping {#damping}

[damped heat equation]({{< relref "KBhdamped_heat_equation.md#damped-heat-equation" >}})
[damped heat equation]({{< relref "KBhdamped_heat_equation.md" >}})


## Solving Heat Equation {#solving-heat-equation}
Expand Down
6 changes: 6 additions & 0 deletions content/posts/KBhlanguage_information_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,9 @@ DP costs \\(O(nm)\\), backtrace costs \\(O(n+m)\\).
### Neural Nets {#neural-nets}

- [Neural Networks]({{< relref "KBhneural_networks.md" >}})


### The Web {#the-web}

- [Web Graph]({{< relref "KBhweb_graph.md" >}})
- [Social Network]({{< relref "KBhsocial_network.md" >}})
45 changes: 45 additions & 0 deletions content/posts/KBhmarkov_chain.md
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\\).
Loading

0 comments on commit f62b5cb

Please sign in to comment.