User:Akuna acount/sandbox

$$ g = \sum_n g_n H_n $$

$$ \langle g, H_n \rangle_{_G} = \left\langle \sum_m g_m H_m, H_n \right\rangle_{_G} = \sum_m g_m \langle H_m, H_n\rangle_{_G} = g_n \sqrt{ \pi} 2^n n!$$

$$ \langle \phi, \psi \rangle_{_G} = \int_{-\infty}^{\infty} \phi(x) \psi(x)e^{-x^2} dx $$

$$ \langle \psi_n, \psi_m \rangle = \delta_{n,m} $$

$$ P(k) = e^{r T} \frac{\partial^2 C}{\partial k^2} $$

$$H_n(x)=(-1)^n e^{x^2}\frac{d^n}{dx^n}e^{-x^2} $$

$$ \sigma(Z) = \sum_n \sigma_n \frac{H_n(Z)}{\sqrt{\sqrt{ \pi} 2^n n!}} $$

$$ P(Z) = \sum_n c_n \psi_n(Z) $$

$$ T:(\sigma_0, \sigma_1, \dots) \to (c_0, c_1, \dots) $$

$$ T(\sigma_0, 0, 0, \dots) = (\frac{1}{\sqrt{2\sqrt{\pi}}}, 0, 0, \dots) \approx (0.531, 0, 0, \dots) $$

$$ T(\sigma_0, \sigma_1, \dots) = T(\sigma_0, 0, 0, \dots) + (\sum_{j} \frac{\partial c_i}{\partial \sigma_j} \sigma_j)_i + \dots $$

$$ {\bf J}(\vec\sigma) = \frac{1}{i}\left.\frac{\partial c_j}{\partial \sigma_i}\right|_{(\sigma_0, \sigma_1, \dots)} $$

$$ {\bf J}(\sigma_0, 0, 0, \dots) \approx \frac{1}{\sigma_0} {\bf J}(1, 0, 0, \dots) $$

$$ {\bf J}(0.2, 0, 0, \dots) \approx \frac{1}{0.2} {\bf J}(1, 0, 0, \dots) $$

$$ Z = \frac{\log\left(\frac{k}{F}\right)+\frac{1}{2} \sigma^2 T}{\sigma \sqrt{T}} $$

$$ C = e^{-rT} \langle F \rangle = e^{-r T} \int \max(F-k) P(F) dF $$

$$ \gamma^* = \frac{\partial^2 C}{\partial k^2} = e^{-r T} \int \frac{\partial^2}{\partial k^2}\max(F-k) P(F) dF = e^{-r T} \int \delta(F-k) P(F) dF = e^{-r T} P(k)$$

$$ P(k) = e^{r T} \gamma^* $$

$$ P(Z) = P(k(Z)) \frac{d k}{d Z} $$

new section
$$He_n(x)=(-1)^n e^{\frac{x^2}{2}}\frac{d^n}{dx^n}e^{-\frac{x^2}{2}}$$

$$G(x) = \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}$$

$$ \langle \phi, \psi \rangle_{_G} = \int_{-\infty}^{\infty} \phi(x) \psi(x) G(x) dx $$

$$ \langle He_n, He_m \rangle_{_G} = n! \delta_{n,m} $$

$$ h_n(x) = \frac{He_n(x)}{n!} $$

$$ \phi_n(x) = \frac{1}{n!} G(x) He_n(x) = \frac{1}{n!} \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}} He_n(x) $$

$$ P(x) = \sum_n b_n \phi_n(x) $$

$$ \int He_m(x) P(x) dx = \sum_n b_n \int He_m(x) \phi_n(x) dx = \sum_n b_n \frac{1}{n!} \int He_m(x) G(x) He_n(x) dx = b_m $$

interesting properties
$$ \int P(x) dx = \sum_n b_n \int \phi_n(x) dx = \sum_n b_n \int He_0(x) \phi_n(x) dx = b_0 $$

$$ \langle x \rangle = \int x P(x) dx = \sum_n b_n \int He_1(x) \phi_n(x) dx = b_1 $$

$$ \begin{align} \langle x^n \rangle &= \int x^n P(x) dx = \sum_m b_m \int x^n \phi_m(x) dx \\ &=\sum_m b_m \int n!\sum_{p=0}^{\lfloor \frac{n}{2} \rfloor} \frac{1}{2^m ~ p!(n-2p)!} ~He_{n-2p}(x) \phi_m(x) dx \\ &= n!\sum_{p=0}^{\lfloor \frac{n}{2} \rfloor} \frac{1}{2^m ~ p!(n-2p)!} ~b_{n-2p} \end{align} $$

$$ x^n = n! \sum_{m=0}^{\lfloor \frac{n}{2} \rfloor} \frac{1}{2^m ~ m!(n-2m)!} ~He_{n-2m}(x)$$

$$ \begin{align} \mu'_1 &= \langle x \rangle = b_1 \text{(mean)}\\ \mu'_2 &= \langle x^2 \rangle = b_2 + b_0 = b_2 + 1\\ \mu'_3 &= \langle x^3 \rangle = b_3 + 3b_1\\ \mu'_4 &= \langle x^4 \rangle = b_4 + 6b_2 + 3\\ \mu'_5 &= \langle x^5 \rangle = b_5 + 10b_3 + 15b_1 \end{align} $$

$$ \begin{align} \mu_2 &= \langle (x-\mu)^2 \rangle = b_2 - b_1^2 + 1 \text{(variance)}\\ \mu_3 &= \langle (x-\mu)^3 \rangle = b_3 - 3b_2b_1 + 2b_1^3\\ \mu_4 &= \langle (x-\mu)^4 \rangle = b_4 - 4b_3b_1 + 6b_2(1+b_1^2) - 6b_1^2 - 3b_1^4 + 3 \end{align} $$

$$ \begin{align} \kappa_1 &= b_1 \text{(mean)}\\ \kappa_2 &= b_2 - b_1^2 \text{(variance)} - 1 \\ \kappa_3 &= b_3 - 3b_2b_1 + 2b_1^3\\ \kappa_4 &= b_4-4b_3b_1-3b_2(b_2-4b_1^2)-6b_1^4 \end{align} $$

jacobian
$$ \sigma(Z) = \sum_n \sigma_n \frac{He_n(Z)}{n!} $$

$$ P(Z) = \sum b_n \phi_n(Z) $$

$$ \vec \sigma = (1, 0, 0, \dots) $$

$$ \vec b = (1, 0, 0, \dots) $$

$$ \vec b = \left(b_0,\, b_1,\, b_2,\, \dots\right) \approx \frac{1}{\sigma_0} \left(\sigma_0,\, -\sigma_1,\, -2\sigma_2,\, -3\sigma_3,\, \dots\right) $$

vol hermite fit
$$ \begin{align} (c_0, c_1, \dots) &= \text{Argmin} \left\{\int w(x)^2\, \big|y(x)-\sum_i c_i H_i(x)\big|^2 dx\right\}\\ &= \text{Argmin} \left\{\int w(x)^2\,  y(x)^2 dx + \int w(x)^2\sum_{i, j} c_i c_j H_i(x)H_j(x) dx - 2 \int w(x)^2 y(x) \sum_i c_i H_i(x) dx\right\}\\ &= \text{Argmin} \left\{\sum_{i, j} c_i c_j\int w(x)^2 H_i(x)H_j(x) dx - 2 \sum_i c_i \int w(x)^2 y(x) H_i(x) dx\right\}\\ \end{align} $$ $$ \int w(x)^2 H_i(x)H_j(x) dx = \delta_{i,j} $$

$$ \frac{\partial}{\partial c_j} \sum_{i} \left(c_i^2 - 2\, c_i \int w(x)^2 y(x) H_i(x) dx\right) = 0 $$

$$ c_j = \int w(x)^2 y(x) H_j(x) dx $$

$$ \int w(x)^2 H_i(x)H_j(x) dx = \delta_{i,j} $$

$$ \log(\frac{k}{F}) = z\sigma\sqrt{T} - \frac{\sigma^2 T}{2} $$

$$ \sigma\sqrt{T} \sim \sqrt{\log\left(\frac{k}{F}\right)} = \sqrt{z\,\sigma\sqrt{T} - \frac{\sigma^2 T}{2}} \implies \sigma^2\, T \sim z\,\sigma\sqrt{T} - \frac{\sigma^2 T}{2} \implies \sigma \sqrt{T} \sim \frac{2}{3} z $$

fit quality
$$ \begin{align} RMS_{hermite} &= \sqrt{\frac{\sum_k (\sigma_H(k)-\sigma_m(k))^2}{N}}\\ RMS_{spread} &= \sqrt{\frac{\sum_k (\sigma_a(k)-\sigma_b(k))^2}{N}}\\ RMS_{relative} &= \frac{RMS_{hermite}}{RMS_{spread}} \end{align} $$

$$  RMS_{relative} = \sqrt{ \frac{ \sum_k \left(\frac{\sigma_H(k)-\sigma_m(k)}{\sigma_a(k)-\sigma_b(k)}\right)^2 }{N} } $$

$$  \sigma = \sum \sigma_n H_n(z), \;\;\; \sigma_n = \int e^{-z^2} H_n(z) \sigma(z) dz $$

$$  \sigma(z) = \langle \sigma(z) \rangle + \eta(z), \;\;\; \langle \eta(z) \rangle = 0, \;\;\; \langle \eta(z) \eta(z')\rangle = \beta^2(z) \delta(z-z') $$

$$ \begin{align} \text{COV}(\sigma_n,\sigma_m) &= \left\langle \sigma_n\sigma_m\right\rangle -\langle \sigma_n\rangle \langle \sigma_m \rangle = \int \int e^{-(z^2 + y^2)} H_n(z) H_m(y) \langle \eta(z) \eta(y) \rangle dz dy\\ &= \int \int e^{-(z^2 + y^2)} H_n(z) H_m(y) \delta(z-y) dz dy \\ &= \int e^{-2z^2} H_n(z) H_m(z) \beta^2(z) dz \\ \end{align} $$

$$  \frac{d\sigma_n}{dt} = hcr_n \frac{d\log(F)}{dt} + \xi_n(t) $$

$$  \left(\sigma_0,\, hcr_0,\, \sigma_1,\, hcr_1,\, \dots\right) $$

Final
$$P(x) = \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}} (1 + b_1 H_1(x) + b_2 H_2(x) + \dots)$$