-1
TABLE OF CONTENTS
economics
- Allocative Efficiency Condition
- Annuities Due
- Average Fixed Cost
- Average Product
- Average Revenue
- Average Total Cost
- Average Variable Cost
- Compound Interest
- Cross-Price Elasticity of Demand
- Effective Rate
nlp
- BLEU Bilingual Evaluation Understudy
- Conditional Random Field CRF
- Direct Policy Optimization DPO
- Hidden Markov Model
- LOW RANK ADAPTATION LORA
- Perplexity of Language Model
- Transformer
physics
- Amplitude of a driven oscillation
- Angular frequency for a damped oscillation
- Coupled Conductors and Transformers
- Cylindrical Waves
- Einstein Field Equations
- Electric Oscillations
- General Relativity
- Harmonic Oscillations
- Lorentz Transformation Latex
- Maxwell Equations Differential
math
- Arithmetic and Geometric Progressions
- Bessel Equation
- Binomial Expansion
- Convergence of Series
- Determinants of a Matrix
- Diffusion Conduction Equation
- Eigenvalues and Eigenvectors
- Fourier Series
- Fourier Transforms
- Heat Equation
machine learning
- Area Under Uplift Curve AUUC
- Average Treatment Effect ATE
- Bellman Equation
- Conditional Average Treatment Effect CATE
- Deep Kernel Learning
- Diffusion Model Forward Process
- Diffusion Model Forward Process Reparameterization
- Diffusion Model Reverse Process
- Diffusion Model Variational Lower Bound
- Diffusion Model Variational Lower Bound Loss
EQUATION LIST
-
Calls and Puts with Different Strikes
#Financial #Economics
$$K_{1} < K_{2} \\ 0 \le c(K_{1}) - c(K_{2}) \le (K_{2} - K_{1})e^{-rT} \\ 0 \le p(K_{2}) - p(K_{1}) \le (K_{2}) - K_{1})e^{-rT} \\ \frac{c(K_{1}) - c(K_{2})}{K_{2} - K_{1}} \ge \frac{c(K_{2}) - c(K_{3})}{K_{3} - K_{2}} \\ \frac{p(K_{1}) - p(K_{2})}{K_{2} - K_{1}} \le \frac{p(K_{3}) - p(K_{2})}{K_{3} - K_{2}}$$
READ MORE -
Black-Derman-Toy BDT
#Financial #Economics
$$\text{First Node: 1-year bond price} \\ P_{0} = \frac{1}{1 + R_{0}} \\ \text{Second Node} \\ P_{1} = \frac{1}{1+R_{0}} [\frac{1}{2} P(1,2,r_{u}) + \frac{1}{2} P(1,2,r_{d})] \\ = \frac{1}{1+R_{0}} [\frac{1}{2(1 + R_{1}e^{2\sigma_{1}})} + \frac{1}{2(1 + R_{1})}] \\ R_{0} = \frac{1}{2} \ln (\frac{R_{1} e^{2\sigma_{1}} }{R_{1}})$$
READ MORE -
Call and Put Price Bounds
#Financial #Economics
$$(F^{P}_{t,T}(S) - Ke^{-r(T-t)})_{+} \le c(S_{t},K,t,T) \le F^{P}_{t,T}(S) \\ (Ke^{-r(T-t)} - F^{P}_{t,T}(S))_{+} \le p(S_{t},K,t,T) \le Ke^{-r(T-t)} \\ c(S_{t},K,t,T) \le C(S_{t},K,t,T) \le S_{t} \\ p(S_{t},K,t,T) \le P(S_{t},K,t,T) \le K$$
READ MORE -
Cox-Ingersoll-Ross CIR
#Financial #Economics
$$\mathrm{d} r(t) = a[b - r(t)] \mathrm{d} t + \sigma \sqrt{r(t)} \mathrm{d} Z(t) \\ P(r, t, T) = A(T-t)e^{-rB(T-t)} \\ \gamma = \sqrt{(a-\bar{\phi})^{2} + 2 \sigma^{2}} \\ q(r, t, T) = \sigma \sqrt{r} B(T-t) \\ \text{yield to maturity} \\ \frac{2ab}{ a - \bar{\phi} + \gamma}$$
READ MORE -
Ito Lemma
#Financial #Economics
$$\mathrm{d}X(t) = a(t, X(t)) \mathrm{d}t + b(t, X(t))\mathrm{d} Z(t) \\ Y(t) = f(t, X(t)) \mathrm{d}t \\ \mathrm{d} Y(t) = f_{t}(t, X(t)) + f_{x}(t, X(t))\mathrm{d} X(t) + \frac{1}{2} f_{xx}(t, X(t))[\mathrm{d}X(t)]^{2} \\ [\mathrm{d} X(t)]^{2} = b^{2}(t, X(t))\mathrm{d} t$$
READ MORE -
Monte-Carlo Simulations
#Financial #Economics
$$S(T) = S(0) e^{(a - \delta - \frac{\sigma^2}{2})T + \sigma \sqrt{T} z} \\ S(T) = S(t) e^{(a - \delta - \frac{\sigma^2}{2})(T-t) + \sigma (Z(T) - Z(t))} \\ \text{Variance} \\ e^{-2rT} \times \frac{s^{2}}{n} \\ s^{2} = \frac{1}{n-1} \sum [(g(S_{i}) - \bar{g})]^{2}$$
READ MORE -
Risk-Neutral Valuation and Power Contracts
#Financial #Economics
$$\frac{\mathrm{d}S(t)}{S(t)} = (r - \delta) \mathrm{d}t + \sigma \mathrm{d} \tilt{Z}(t) \\ \tilt{Z}(t) = Z(t) + \phi t \\ V(S(t), t) = e^{-r(T-t)} E^{*}[V(S(T), T) | S(T)] \\ F^{p}_{t, T}(S^{a}) = S^{a}(t) e ^{ (-r + a(r-\delta) + \frac{1}{2} a(a-1)\sigma^{2})(T-t)}$$
READ MORE -
Stock Prices as Geometric Brownian Motion
#Financial #Economics
$$\frac{\mathrm{d}S(t)}{S(t)} = (a - \delta) \mathrm{d}t + \sigma \mathrm{d}Z(t) \\ S(t) = S(0) e^{(a - \delta - \frac{\sigma^{2}}{2})t + \sigma Z(t)} \\ \mathrm{d}[\ln S(t)] = (a - \delta - \frac{\sigma^{2}}{2}) \mathrm{d}t + \sigma \sigma \mathrm{d} Z(t) \\ S(t) \sim \ln( \ln S(0) + (a - \delta - \frac{\sigma^2}{2})t, \sigma^{2}t)$$
READ MORE -
BLEU Bilingual Evaluation Understudy
#nlp #BLEU #evaluation
$$ \text{BLEU}_{w}(\hat{S},S)=BP(\hat{S};S) \times \exp{\sum^{\infty}_{n=1}w_{n} \ln p_{n}(\hat{S};S)}, p_{n}(\hat{S};S)=\frac{\sum^{M}_{i=1}\sum_{s \in G_{n}(\hat{y})} \min(C(s,\hat{y}),\max_{y \in S_{i}} C(s,y))}{\sum^{M}_{i=1}\sum_{s \in G_{n}(\hat{y})}C(s, \hat{y})}, p_{n}(\hat{y};y)=\frac{\sum_{s \in G_{n}(\hat{y})} \min(C(s,\hat{y}), C(s,y))}{\sum_{s \in G_{n}(\hat{y})}C(s, \hat{y})}, BP(\hat{S};S) = e^{-(r/c-1)^{+}}$$
READ MORE -
Direct Policy Optimization DPO
#nlp #llm #RLHF
$$\pi_{r} (y|x) = \frac{1}{Z(x)} \pi_{ref} (y|x) \exp(\frac{1}{\beta} r(x,y) ) , r(x,y) = \beta \log \frac{\pi_{r} (y|x)}{\pi_{ref} (y|x)} + \beta \log Z(x) , p^{*}(y_{1} > y_{2} |x) = \frac{1}{1+\exp{(\beta \frac{\pi^{*} (y_{2}|x)}{\pi_{ref} (y_{2}|x)} - \beta \frac{\pi^{*} (y_{1}|x)}{\pi_{ref} (y_{1}|x)} )}} , \mathcal{L}_{DPO}(\pi_{\theta};\pi_{ref}) = -\mathbb{E}_{(x, y_{w},y_{l}) \sim D } [\log \sigma (\beta \frac{\pi_{\theta} (y_{w}|x)}{\pi_{ref} (y_{w}|x)} - \beta \frac{\pi_{\theta} (y_{l}|x)}{\pi_{ref} (y_{l}|x)} )] , \nabla \mathcal{L}_{DPO}(\pi_{\theta};\pi_{ref}) = - \beta \mathbb{E}_{(x, y_{w},y_{l}) \sim D } [ \sigma ( \hat{r}_{\theta} (x, y_{l}) - \hat{r}_{\theta} (x, y_{w})) [\nabla_{\theta} \log \pi (y_{w}|x) - \nabla_{\theta} \log \pi (y_{l}|x) ] ] , \hat{r}_{\theta} (x, y) = \beta \log (\frac{\pi_{\theta} (y|x)}{\pi_{ref} (y|x)})$$
READ MORE -
Hidden Markov Model
#machine learning #nlp
$$Q=\{q_{1},q_{2},...,q_{N}\}, V=\{v_{1},v_{2},...,v_{M}\} \\ I=\{i_{1},i_{2},...,i_{T}\},O=\{o_{1},o_{2},...,o_{T}\} \\ A=[a_{ij}]_{N \times N}, a_{ij}=P(i_{t+1}=q_{j}|i_{t}=q_{i}) \\ B=[b_{j}(k)]_{N \times M},b_{j}(k)=P(o_{t}=v_{k}|i_{t}=q_{j})$$
READ MORE -
Coupled Conductors and Transformers
#physics #coupled #conductors #transformers
$$M_{12}=M_{21}:=M=k\sqrt{L_1L_2}=\frac{N_1\Phi_1}{I_2}=\frac{N_2\Phi_2}{I_1}\sim N_1N_2 \\ \frac{V_1}{V_2}=\frac{I_2}{I_1}=-\frac{i\omega M}{i\omega L_2+R_{\rm load}}\approx-\sqrt{\frac{L_1}{L_2}}=-\frac{N_1}{N_2} \\ \Phi_{12}=M_{12}I_2 \\ \Phi_{21}=M_{21}I_1$$
READ MORE -
Electric Oscillations
#physics #oscillations
$$\text{Impedance} \\ Z=R+ix \\ \text{Series connection} \\ V=IZ, Z_{\rm tot}=\sum_i Z_i~,~~L_{\rm tot}=\sum_i L_i~,~~ \frac{1}{C_{\rm tot}}=\sum_i\frac{1}{C_i}~,~~Q=\frac{Z_0}{R}~,~~ Z=R(1+iQ\delta) \\ \text{Parallel connection} \\ \frac{1}{Z_{\rm tot}}=\sum_i\frac{1}{Z_i}~,~~ \frac{1}{L_{\rm tot}}=\sum_i\frac{1}{L_i}~,~~ C_{\rm tot}=\sum_i C_i~,~~Q=\frac{R}{Z_0}~,~~ Z=\frac{R}{1+iQ\delta}$$
READ MORE -
Harmonic Oscillations
#physics #harmonic #oscillations
$$\Psi(t)=\hat{\Psi}(t)e^{i(\omega t \pm \phi)}=\hat{\Psi}(t)\cos (\omega t \pm \phi) \\ \sum_{i} \hat{\Psi_{i}}\cos(\alpha_{i} \pm \omega t) =\hat{\Phi}\cos (\beta \pm \omega t) \\ \tan (\beta)=\frac{\sum_{i} \hat{\Psi_{i}} \sin (\alpha_{i})}{\sum_{i} \hat{\Psi_{i}} \cos (\alpha_{i})} \\ \hat{\Phi}^{2} = \sum_{i} \hat{\Psi_{i}^{2}} + 2 \sum_{j > i} \sum_{i} \hat{\Psi_{i}} \hat{\Psi_{j}} \cos (\alpha_{i} - \alpha_{j}) \\ \int x(t) dt=\frac{x(t)}{i \omega} \\ \frac{d^{n}(x(t))}{d t^{n}}=(i \omega)^{n} x(t)$$
READ MORE -
Lorentz Transformation Latex
#physics #relativity #lorentz #transformation
$$(\vec{x}^{'}, t^{'}) = (\vec{x}^{'}(\vec{x},t), t^{'}(\vec{x},t)) \\ \vec{x}^{'} = \vec{x} +\frac{(\gamma-1)(\vec{x}\vec{v}) \vec{v}}{|v|^{2}} - \gamma \vec{v}t \\ t^{'} = \frac{\gamma(t-\vec{x}\vec{v})}{c^{2}} \\ \gamma = \frac{1}{\sqrt{1-\frac{v^{2}}{c^{2}}}} \\ \frac{\partial^{2}}{\partial{x^{2}}} + \frac{\partial^{2}}{\partial{y^{2}}} + \frac{\partial^{2}}{\partial{z^{2}}} - \frac{1}{c^{2}} \frac{\partial^{2}}{\partial{t^{2}}} = \frac{\partial^{2}}{\partial{{x^{'}}^{2}}} + \frac{\partial^{2}}{\partial{{y^{'}}^{2}}} + \frac{\partial^{2}}{\partial{{z^{'}}^{2}}} - \frac{1}{c^{2}} \frac{\partial^{2}}{\partial{{t^{'}}^{2}}}$$
READ MORE -
Maxwell Equations Integral
#physics #maxwell #electricity #magnetism
$$\oiint (\vec{D}\cdot \vec{n}) \mathrm{d}^{2}A=Q_{\text{free,included}}\\ \oiint (\vec{B}\cdot \vec{n}) \mathrm{d}^{2}A=0 \\ \oint \vec{E} \mathrm{d}\vec{s}=-\frac{\mathrm{d}\Phi}{\mathrm{d}t}\\ \oint \vec{H} \mathrm{d}\vec{s}=I_{\text{free,included}}+\frac{\mathrm{d}\Psi }{\mathrm{d}t}$$
READ MORE -
Mechanic Oscillations
#physics #mechanic #oscillations
$$m\ddot{x}=F(t)-k\dot{x}-Cx \\ F(t)=\hat{F}\cos(\omega t) \\ -m\omega^2 x=F-Cx-ik\omega x \\ \omega_0^2=C/m \\ x=\frac{F}{m(\omega_0^2-\omega^2)+ik\omega} \\ \dot{x}=\frac{F}{i\sqrt{Cm}\delta+k} \\ \delta=\frac{\omega}{\omega_0}-\frac{\omega_0}{\omega} \\ Z=F/\dot{x} \\ Q=\frac{\sqrt{Cm}}{k}$$
READ MORE -
Riemannian Tensor
#physics #riemannian rensor
$$R^{\mu}_{v \alpha \beta}T^{v}=\triangledown_{\alpha}\triangledown_{\beta}T^{\mu}-\triangledown_{\beta}\triangledown_{\alpha}T^{\mu} \\ \triangledown_{j}a^{i}=\partial_{j}a^{i}+\Gamma^{i}_{jk}a^{k} \\ \triangledown_{j}a_{i}=\partial_{j}a_{i}-\Gamma^{k}_{ij}a_{k} \\ \Gamma^{i}_{jk}=\frac{\partial^{2} \bar{x}^{l}}{\partial{x^{j}}\partial{x^{k}}}\frac{\partial{x^{i}}}{\partial{\bar{x}^{l}}}$$
READ MORE -
Stress-energy Tensor
#physics #stress-energy tensor
$$T_{\mu v}=(\varrho c^{2}+p)u_{p}u_{v}+pg_{\mu v}+\frac{1}{c^{2}}(F^{\mu}_{\alpha}F^{\alpha v} + \frac{1}{4}g^{\mu v}F^{\alpha\beta}F_{\alpha\beta}) \\ \triangledown_{v} T_{\mu v}=0 \\ F_{\alpha\beta}=\frac{\partial{A_{\beta}}}{\partial{x^{\alpha}}} - \frac{\partial{A_{\alpha}}}{\partial{x^{\beta}}} \\ \frac{d p_{\alpha}}{d \tau}=qF_{\alpha\beta}u^{\beta}$$
READ MORE -
The general solution of Wave Equation
#physics #general solution #waves
$$\frac{\partial^2 u(x,t)}{\partial t^2}=\sum_{m=0}^{N}\left(b_m\frac{\partial ^m}{\partial x^m}\right)u(x,t) \\ u(x,t)=\int\limits_{-\infty}^{\infty}\left(a(k){\rm e}^{i(kx-\omega_1(k)t)}+ b(k){\rm e}^{i(kx-\omega_2(k)t)}\right)dk \\ u(x,t)=A{\rm e}^{i(kx-\omega t)} \\ \omega_j=\omega_j(k)$$
READ MORE -
Wave Equation
#physics #wave
$$\nabla^2u-\frac{1}{v^2}\frac{\partial^2 u}{\partial t^2}=\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}+\frac{\partial^2 u}{\partial z^2}-\frac{1}{v^2}\frac{\partial^2 u}{\partial t^2}=0 \\ v=f\lambda \\ k\lambda=2\pi \\ \omega=2\pi f \\ v_{\rm g}=\frac{d\omega}{dk}=v_{\rm ph}+k\frac{dv_{\rm ph}}{dk}= v_{\rm ph}\left(1-\frac{k}{n}\frac{dn}{dk}\right) \\ v=\sqrt{\kappa/\varrho}$$
READ MORE -
Bending of light Snell's law
#physics #optics #Snell's law
$$n_i\sin(\theta_i)=n_t\sin(\theta_t) \\ \frac{n_2}{n_1}=\frac{\lambda_1}{\lambda_2}=\frac{v_1}{v_2} \\ n^2=1+\frac{n_{\rm e}e^2}{\varepsilon_0m}\sum_j\frac{f_j}{\omega_{0,j}^2-\omega^2-i\delta\omega} \\ v_{\rm g}=c/(1+(n_{\rm e}e^2/2\varepsilon_0m\omega^2)) $$
READ MORE -
Fresnel Equations
#physics #optics #fresnel
$$r_\parallel=\frac{\tan(\theta_i-\theta_t)}{\tan(\theta_i+\theta_t)} \\ r_\perp =\frac{\sin(\theta_t-\theta_i)}{\sin(\theta_t+\theta_i)} \\ t_\parallel=\frac{2\sin(\theta_t)\cos(\theta_i)}{\sin(\theta_t+\theta_i)\cos(\theta_t-\theta_i)} \\ t_\perp =\frac{2\sin(\theta_t)\cos(\theta_i)}{\sin(\theta_t+\theta_i)}$$
READ MORE -
Non-linear Wave Equation
#physics #non-linear wave
$$\frac{d^2x}{dt^2}-\varepsilon\omega_0(1-\beta x^2)\frac{dx}{dt}+\omega_0^2x=0 \\ \frac{d}{dt}\left\{\frac{1}{2}\left(\frac{dx}{dt}\right)^2+\frac{1}{2} \omega_0^2x^2\right\}= \varepsilon\omega_0(1-\beta x^2)\left(\frac{dx}{dt}\right)^2 \\ \frac{\partial u}{\partial t}+\frac{\partial u}{\partial x}-\underbrace{au\frac{\partial u}{\partial x}}_{\rm non-lin}+ \underbrace{b^2\frac{\partial ^3u}{\partial x^3}}_{\rm dispersive}=0 \\ u(x-ct)=\frac{-d}{\cosh^2(e(x-ct))}$$
READ MORE -
Prisms and Dispersion
#physics #optics #prisms #dispersion
$$\delta=\theta_i+\theta_{i'}+\alpha \\ n=\frac{\sin(\frac{1}{2}(\delta_{\rm min}+\alpha))}{\sin(\frac{1}{2}\alpha)} \\ D=\frac{d\delta}{d\lambda}=\frac{d\delta}{dn}\frac{dn}{d\lambda} \\ \frac{d\delta}{dn}=\frac{2\sin(\frac{1}{2}\alpha)}{\cos(\frac{1}{2}(\delta_{\rm min}+\alpha))}$$
READ MORE -
Reflection and Transmission
#physics #optics #reflection #transmission
$$r_\parallel\equiv\left(\frac{E_{0r}}{E_{0i}}\right)_\parallel \\ r_\perp\equiv\left(\frac{E_{0r}}{E_{0i}}\right)_\perp \\ t_\parallel\equiv\left(\frac{E_{0t}}{E_{0i}}\right)_\parallel \\ t_\perp\equiv\left(\frac{E_{0t}}{E_{0i}}\right)_\perp$$
READ MORE -
Thermodynamics Statistical Basis
#physics #thermodynamics
$$P=N!\prod_i\frac{g_i^{n_i}}{n_i!} \\ n_i=\frac{N}{Z}g_i\exp\left(-\frac{W_i}{kT}\right) \\ Z=\sum\limits_ig_i\exp(-W_i/kT) \\ Z=\frac{V(2\pi mkT)^{3/2}}{h^3} \\ \text{Entropy in Thermodynamic Equilibrium} \\ S=\frac{U}{T}+kN\ln\left(\frac{Z}{N}\right)+kN\approx\frac{U}{T}+k\ln\left(\frac{Z^N}{N!}\right) \\ \text{Ideal gas} \\ S=kN+kN\ln\left(\frac{V(2\pi mkT)^{3/2}}{Nh^3}\right)$$
READ MORE -
Waveguides and resonating cavities
#physics #waveguides
$$\begin{array}{ll} \vec{n}\cdot(\vec{D}_2-\vec{D}_1)=\sigma~~&~~\vec{n}\times(\vec{E}_2-\vec{E}_1)=0\\ \vec{n}\cdot(\vec{B}_2-\vec{B}_1)=0~~&~~\vec{n}\times(\vec{H}_2-\vec{H}_1)=\vec{K} \end{array} \\ \vec{E}(\vec{x},t)=\vec{\cal E}(x,y){e}^{i(kz-\omega t)} \\ \vec{B}(\vec{x},t)=\vec{\cal{B}}(x,y){e}^{i(kz-\omega t)}$$
READ MORE -
Phase Transitions
#physics #thermodynamics #phase transitions
$$\Delta S_m=S_m^\alpha - S_m^\beta=\frac{r_{\beta\alpha}}{T_0} \\ S_m=\left(\frac{\partial G_m}{\partial T}\right)_{p} \\ \frac{dp}{dT}=\frac{S_m^\alpha-S_m^\beta}{V_m^\alpha-V_m^\beta}= \frac{r_{\beta\alpha}}{(V_m^\alpha-V_m^\beta)T} \\ p=p_0{\rm e}^{-r_{\beta\alpha/RT}} \\ r_{\beta\alpha}=r_{\alpha\beta} \\ r_{\beta\alpha}=r_{\gamma\alpha}-r_{\gamma\beta} \\ \frac{dp}{dT}=\frac{S_m^\alpha-S_m^\beta}{V_m^\alpha-V_m^\beta}= \frac{r_{\beta\alpha}}{(V_m^\alpha-V_m^\beta)T} \\ p=p_0{\rm e}^{-r_{\beta\alpha/RT}}$$
READ MORE -
State functions Maxwell Relations
#physics #thermodynamics
$$\left(\frac{\partial T}{\partial V}\right)_{S}=-\left(\frac{\partial p}{\partial S}\right)_{V}~,~~\left(\frac{\partial T}{\partial p}\right)_{S}=\left(\frac{\partial V}{\partial S}\right)_{p}~,~~ \left(\frac{\partial p}{\partial T}\right)_{V}=\left(\frac{\partial S}{\partial V}\right)_{T}~,~~\left(\frac{\partial V}{\partial T}\right)_{p}=-\left(\frac{\partial S}{\partial p}\right)_{T} \\ TdS=C_VdT+T\left(\frac{\partial p}{\partial T}\right)_{V}dV~~\mbox{and}~~TdS=C_pdT-T\left(\frac{\partial V}{\partial T}\right)_{p}dp$$
READ MORE -
Thermal Heat Capacity
#physics #thermodynamics #heat capacity
$$C_p-C_V=T\left(\frac{\partial p}{\partial T}\right)_{V}\cdot\left(\frac{\partial V}{\partial T}\right)_{p}=-T\left(\frac{\partial V}{\partial T}\right)_{p}^2\left(\frac{\partial p}{\partial V}\right)_{T}\geq0 \\ \displaystyle C_X=T\left(\frac{\partial S}{\partial T}\right)_{X} \\ \displaystyle C_p=\left(\frac{\partial H}{\partial T}\right)_{p} \\ \displaystyle C_V=\left(\frac{\partial U}{\partial T}\right)_{V} \\ C_{mp}-C_{mV}=R$$
READ MORE -
Thermodynamic Potential
#physics #thermodynamics
$$dG=-SdT+Vdp+\sum_i\mu_idn_i \\ \displaystyle\mu=\left(\frac{\partial G}{\partial n_i}\right)_{p,T,n_j} \\ V=\sum_{i=1}^c n_i\left(\frac{\partial V}{\partial n_i}\right)_{n_j,p,T}:=\sum_{i=1}^c n_i V_i \\ \begin{aligned} V_m&=&\sum_i x_i V_i\\ 0&=&\sum_i x_i dV_i\end{aligned}$$
READ MORE -
Thermodynamics Definitions
#physics #thermodynamics
$$f(x,y,z)=0 \\ dz=\left(\frac{\partial z}{\partial x}\right)_{y}dx+\left(\frac{\partial z}{\partial y}\right)_{x}dy \\ \left(\frac{\partial x}{\partial y}\right)_{z}\cdot\left(\frac{\partial y}{\partial z}\right)_{x}\cdot\left(\frac{\partial z}{\partial x}\right)_{y}=-1 \\ \varepsilon^m F(x,y,z)=F(\varepsilon x,\varepsilon y,\varepsilon z) \\ mF(x,y,z)=x\frac{\partial F}{\partial x}+y\frac{\partial F}{\partial y}+z\frac{\partial F}{\partial z}$$
READ MORE -
Harmonic Oscillator Quantum
#physics #quantum
$$H=\frac{p^2}{2m}+\frac{1}{2} m\omega^2 x^2= \frac{1}{2} \hbar\omega+\omega A^\dagger A \\ A=\sqrt{\mbox{$\frac{1}{2}$}m\omega}x+\frac{ip}{\sqrt{2m\omega}} \\ A^\dagger=\sqrt{\mbox{$\frac{1}{2}$}m\omega}x-\frac{ip}{\sqrt{2m\omega}} \\ HAu_E=(E-\hbar\omega)Au_E \\ u_n=\frac{1}{\sqrt{n!}}\left(\frac{A^\dagger}{\sqrt{\hbar}}\right)^nu_0 \\ u_0=\sqrt[4]{\frac{m\omega}{\pi\hbar}}\exp\left(-\frac{m\omega x^2}{2\hbar}\right) \\ E_n=( \frac{1}{2} +n)\hbar\omega$$
READ MORE -
Parity
#physics #quantum
$${\cal P}\psi(x)=\psi(-x) \\ \psi(x)= \underbrace{\frac{1}{2} (\psi(x)+\psi(-x))}_{\rm even:~\hbox{$\psi^+$}}+ \underbrace{\frac{1}{2} (\psi(x)-\psi(-x))}_{\rm odd:~\hbox{$\psi^-$}} \\ \psi^+= \frac{1}{2} (1+{\cal P})\psi(x,t) \\ \psi^-= \frac{1}{2} (1-{\cal P})\psi(x,t)$$
READ MORE -
Quantum Wave Functions
#physics #quantum #wave
$$\Phi(k,t)=\frac{1}{\sqrt{h}}\int\Psi(x,t){\rm e}^{-ikx}dx \\ \Psi(x,t)=\frac{1}{\sqrt{h}}\int\Phi(k,t){\rm e}^{ikx}dk \\ v_{\rm g}=p/m \\ E=\hbar\omega \\ \left\langle f(t) \right\rangle=\int\hspace{-1.5ex}\int\hspace{-1.5ex}\int\Psi^* f\Psi d^3V \\ \left\langle f_p(t) \right\rangle=\int\hspace{-1.5ex}\int\hspace{-1.5ex}\int\Phi^*f\Phi d^3V_p \\ \left\langle f(t) \right\rangle=\left\langle \Phi|f|\Phi \right\rangle \\ \left\langle \Phi|\Phi \right\rangle=\left\langle \Psi|\Psi \right\rangle=1$$
READ MORE -
The Schrödinger Equation
#physics #quantum
$$-\dfrac{\hbar^{2}}{2m}\bigtriangledown ^{2} \psi +U\psi=E\psi = i\hbar \dfrac{\partial \psi}{\partial t} \\ H=p^2/2m+U, H\psi=E\psi \\ \psi(x,t)=\left(\sum+\int dE\right)c(E)u_E(x)\exp\left(-\frac{iEt}{\hbar}\right) \\ \displaystyle J=\frac{\hbar}{2im}(\psi^*\nabla\psi-\psi\nabla\psi^*) \\ \displaystyle\frac{\partial P(x,t)}{\partial t}=-\nabla J(x,t)$$
READ MORE -
The Uncertainty Principle
#physics #quantum
$$(\Delta A)^2=\left\langle \psi|A_{\rm op}-\left\langle A \right\rangle|^2\psi \right\rangle=\left\langle A^2 \right\rangle-\left\langle A \right\rangle^2 \\ \Delta A\cdot\Delta B\geq \frac{1}{2} |\left\langle \psi|[A,B]|\psi \right\rangle| \\ \Delta E\cdot\Delta t\geq\hbar \\ \Delta p_x\cdot\Delta x\geq \frac{1}{2} \hbar \\ \Delta L_x\cdot\Delta L_y\geq \frac{1}{2} \hbar L_z$$
READ MORE -
Fourier Series
#math #fourier series
$$y(x)=c_{0}+\sum^{M}_{m=1}c_{m}\cos mx+\sum^{M^{'}}_{m=1}s_{m}\sin mx \\ c_{0}=\frac{1}{2\pi}\int^{\pi}_{-\pi}y(x) \mathrm{d} x \\ c_{m}=\frac{1}{\pi}\int^{\pi}_{-\pi}y(x) \cos mx \mathrm{d} x \\ s_{m}=\frac{1}{\pi}\int^{\pi}_{-\pi}y(x) \sin mx \mathrm{d} x$$
READ MORE -
Power Series with Real Variables
#math #power #series
$$e^{x}=1+x+\frac{x^{2}}{2!}+...+\frac{x^{n}}{n!}+... \\ \ln(1+x) = x - \frac{x^{2}}{2} + \frac{x^{3}}{3} + ... + (-1)^{n+1}\frac{x^{n}}{n!} +... \\ \cos(x) = \frac{e^{ix}+e^{-ix}}{2}=1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\frac{x^{6}}{6!}+...\\ \sin(x) = \frac{e^{ix}-e^{-ix}}{2i}=x-\frac{x^{3}}{3!}+\frac{x^{5}}{5!}+...$$
READ MORE -
Gamma Distribution
#Math #Statistics
$$\Gamma \left( a \right) = \int\limits_0^\infty {s^{a - 1} } e^{ - s} ds \\ P(x) = \frac{x^{\alpha-1} e^{-frac{x}{\theta}}}{\Gamma(\alpha) \theta^{\alpha}} \\ \mu = \alpha \theta \\ \sigma^{2} = \alpha \theta^{2} \\ \gamma_{1} = \frac{2}{\sqrt{\alpha}} \\ \gamma_{2} = \frac{6}{\alpha}$$
READ MORE -
Power Series for Complex Variables
#math #complex variables
$$e^{z}=1+z+\frac{z^{2}}{2!}+\frac{z^{3}}{3!}+...+\frac{z^{n}}{n!}+...\\ \sin z=z-\frac{z^{3}}{3!}+\frac{z^{5}}{5!}-...\\ \cos z=1-\frac{z^{2}}{2!}+\frac{z^{4}}{4!}-...\\ \ln (1+z)=1-\frac{z^{2}}{2!}+\frac{z^{3}}{3!}-...\\ (1+z)^{n}=1+nz+\frac{n(n-1)}{2!}z^{2}+\frac{n(n-1)(n-2)}{3!}z^{3}+...$$
READ MORE -
Spherical Harmonics Equation
#math #spherical harmonics
$$[\frac{1}{\sin \theta} \frac{\partial}{\partial \theta}(\sin \theta \frac{\partial}{\partial \theta}) + \frac{1}{\sin^{2} \theta} \frac{\partial^{2}}{\partial \phi^{2}}) ] Y^{m}_{l} + l(l+1) Y^{m}_{l}=0 \\ Y^{m}_{l}(\theta,\phi)=\sqrt{\frac{2l+1}{4 \pi} \frac{(l-|m|)!}{(l+|m|)!}}P^{m}_{l}(\cos \theta) e^{im \phi} \times \begin{cases}(-1)^{m} & m\ge 0 \\ 1 & m <0 \end{cases}$$
READ MORE -
gaussian process
#math #gaussian process
$$\log p(y|X) \propto -[y^{T}(K + \sigma^{2}I)^{-1}y+\log|K + \sigma^{2}I|] \\ f(X)=\[f(x_{1}),f(x_{2}),...,f(x_{N}))\]^{T} \sim \mathcal{N}(\mu, K_{X,X}) \\ f_{*}|X_{*},X,y \sim \mathcal{N}(\mathbb{E}(f_{*}),\text{cov}(f_{*})) \\ \text{cov}(f_{*})=K_{X_{*},X_{*}}-K_{X_{*},X}[K_{X,X}+\sigma^{2}I]^{-1}K_{X,X_{*}}$$
READ MORE -
Cartesian to Spherical Coordinates
#Math #Geometry
$$\begin{array}{*{20}c} {x = R\sin \theta \cos \phi } & {R = \sqrt {x^2 + y^2 + z^2 } } & {} \\ {y = R\sin \theta \sin \phi } & {\phi = \tan ^{ - 1} \left( {\frac{y}{x}} \right)} & {} \\ {z = R\cos \theta } & {\theta = \cos ^{ - 1} \left( {\frac{z}{{\sqrt {x^2 + y^2 + z^2 } }}} \right)} & {} \\ \end{array}$$
READ MORE -
Student t-Distribution
#Math #Statistics
$$f(t) = \frac{\Gamma(\frac{v + 1}{2})}{\sqrt{v\pi}\Gamma(v/2)} (1+\frac{t^{2}}{v})^{-(v+1)/2}, \\ F(t) = \frac{1}{2} + x \Gamma(\frac{v+1}{2}) \times \frac{2^{F_{1}}(1/2,\frac{v+1}{2};3/2;-\frac{x^{2}}{v})}{\sqrt{\pi v} \Gamma(\frac{v}{2})}, \\ F(t) = 1 - \frac{1}{2} I_{x(t)} (\frac{v}{2}, \frac{1}{2}), x(t)=\frac{v}{t^{2} + v}$$
READ MORE -
Diffusion Model Forward Process Reparameterization
#machine learning #diffusion
$$x_{t}=\sqrt{\alpha_{t}}x_{t-1}+\sqrt{1-\alpha_{t}} \epsilon_{t-1}\\=\sqrt{\alpha_{t}\alpha_{t-1}}x_{t-2} + \sqrt{1-\alpha_{t}\alpha_{t-1}} \bar{\epsilon}_{t-2}\\=\text{...}\\=\sqrt{\bar{\alpha}_{t}}x_{0}+\sqrt{1-\bar{\alpha}_{t}}\epsilon \\\alpha_{t}=1-\beta_{t}, \bar{\alpha}_{t}=\prod_{t=1}^{T}\alpha_{t}$$
READ MORE -
Diffusion Model Reverse Process
#machine learning #diffusion
$$p_\theta(\mathbf{x}_{0:T}) = p(\mathbf{x}_T) \prod^T_{t=1} p_\theta(\mathbf{x}_{t-1} \vert \mathbf{x}_t) \\ p_\theta(\mathbf{x}_{t-1} \vert \mathbf{x}_t) = \mathcal{N}(\mathbf{x}_{t-1}; \boldsymbol{\mu}_\theta(\mathbf{x}_t, t), \boldsymbol{\Sigma}_\theta(\mathbf{x}_t, t))$$
READ MORE -
Diffusion Model Variational Lower Bound
#machine learning #diffusion
$$\begin{aligned} - \log p_\theta(\mathbf{x}_0) &\leq - \log p_\theta(\mathbf{x}_0) + D_\text{KL}(q(\mathbf{x}_{1:T}\vert\mathbf{x}_0) \| p_\theta(\mathbf{x}_{1:T}\vert\mathbf{x}_0) ) \\ &= -\log p_\theta(\mathbf{x}_0) + \mathbb{E}_{\mathbf{x}_{1:T}\sim q(\mathbf{x}_{1:T} \vert \mathbf{x}_0)} \Big[ \log\frac{q(\mathbf{x}_{1:T}\vert\mathbf{x}_0)}{p_\theta(\mathbf{x}_{0:T}) / p_\theta(\mathbf{x}_0)} \Big] \\ &= -\log p_\theta(\mathbf{x}_0) + \mathbb{E}_q \Big[ \log\frac{q(\mathbf{x}_{1:T}\vert\mathbf{x}_0)}{p_\theta(\mathbf{x}_{0:T})} + \log p_\theta(\mathbf{x}_0) \Big] \\ &= \mathbb{E}_q \Big[ \log \frac{q(\mathbf{x}_{1:T}\vert\mathbf{x}_0)}{p_\theta(\mathbf{x}_{0:T})} \Big] \\ \text{Let }L_\text{VLB} &= \mathbb{E}_{q(\mathbf{x}_{0:T})} \Big[ \log \frac{q(\mathbf{x}_{1:T}\vert\mathbf{x}_0)}{p_\theta(\mathbf{x}_{0:T})} \Big] \geq - \mathbb{E}_{q(\mathbf{x}_0)} \log p_\theta(\mathbf{x}_0) \end{aligned}$$
READ MORE -
Diffusion Model Variational Lower Bound Loss
#machine learning #diffusion
$$\begin{aligned} L_\text{VLB} &= L_T + L_{T-1} + \dots + L_0 \\ \text{where } L_T &= D_\text{KL}(q(\mathbf{x}_T \vert \mathbf{x}_0) \parallel p_\theta(\mathbf{x}_T)) \\ L_t &= D_\text{KL}(q(\mathbf{x}_t \vert \mathbf{x}_{t+1}, \mathbf{x}_0) \parallel p_\theta(\mathbf{x}_t \vert\mathbf{x}_{t+1})) \text{ for }1 \leq t \leq T-1 \\ L_0 &= - \log p_\theta(\mathbf{x}_0 \vert \mathbf{x}_1) \end{aligned}$$
READ MORE -
Variational AutoEncoder VAE
#machine learning #VAE
$$\log p_{\theta}(x)=\mathbb{E}_{q_{\phi}(z|x)}[\log p_{\theta}(x)] \\ =\mathbb{E}_{q_{\phi}(z|x)}[\log \frac{p_{\theta}(x,z)}{p_{\theta}(z|x)}] \\ =\mathbb{E}_{q_{\phi}(z|x)}[\log [\frac{p_{\theta}(x,z)}{q_{\phi}(z|x)} \times \frac{q_{\phi}(z|x)}{p_{\theta}(z|x)}]] \\ =\mathbb{E}_{q_{\phi}(z|x)}[\log [\frac{p_{\theta}(x,z)}{q_{\phi}(z|x)} ]] +D_{KL}(q_{\phi}(z|x) || p_{\theta}(z|x))\\$$
READ MORE -
Bound on Target Domain Error
#machine learning #transfer learning
$$\epsilon_{T}(h) \le \hat{\epsilon}_{S}(h) + \sqrt{\frac{4}{m}(d \log \frac{2em}{d} + \log \frac{4}{\delta })} + d_{\mathcal{H}}(\tilde{\mathcal{D}}_{S}, \tilde{\mathcal{D}}_{T}) + \lambda \\ \lambda = \lambda_{S} + \lambda_{T}$$
READ MORE -
Domain-Adversarial Neural Networks DANN
#machine learning #transfer learning
$$\min [\frac{1}{m}\sum^{m}_{1}\mathcal{L}(f(\textbf{x}^{s}_{i}),y_{i})+\lambda \max(-\frac{1}{m}\sum^{m}_{i=1}\mathcal{L}^{d}(o(\textbf{x}^{s}_{i}),1)-\frac{1}{m^{'}}\sum^{m^{'}}_{i=1}\mathcal{L}^{d}(o(\textbf{x}^{t}_{i}),0))]$$
READ MORE -
Graph Attention Network GAT
#machine learning #graph #GNN
$$h=\{\vec{h_{1}},\vec{h_{2}},...,\vec{h_{N}}\}, \\ \vec{h_{i}} \in \mathbb{R}^{F} \\ W \in \mathbb{R}^{F \times F^{'}} \\ e_{ij}=a(Wh_{i},Wh_{j}) \\ k \in \mathcal{N}_{i},\text{ neighbourhood nodes}\\ a_{ij}=\text{softmax}_{j}(e_{ij})=\frac{\exp(e_{ij})}{\sum_{k \in \mathcal{N}_{i}} \exp(e_{ik})}$$
READ MORE -
GraphSage
#machine learning #graph #GNN
$$h^{0}_{v} \leftarrow x_{v} \\ \textbf{for} k \in \{1,2,...,K\} \text{do}\\ \textbf{for} v \in V \text{do} \\ h^{k}_{N_{v}} \leftarrow \textbf{AGGREGATE}_{k}(h^{k-1}_{u}, u \in N(v)); \\ h^{k}_{v} \leftarrow \sigma (W^{k} \textbf{concat}(h^{k-1}_{v},h^{k}_{N_{v}})) \\ \textbf{end} \\ h^{k}_{v}=h^{k}_{v}/||h^{k}_{v}||_{2},\forall v \in V \\ \textbf{end} \\ z_{v} \leftarrow h^{k}_{v} \\ J_{\textbf{z}_{u}}=-\log (\sigma (\textbf{z}_{u}^{T}\textbf{z}_{v})) - Q \mathbb{E}_{v_{n} \sim p_n(v)} \log(\sigma (-\textbf{z}_{u}^{T}\textbf{z}_{v_{n}}))$$
READ MORE -
Hidden Markov Model
#machine learning #nlp
$$Q=\{q_{1},q_{2},...,q_{N}\}, V=\{v_{1},v_{2},...,v_{M}\} \\ I=\{i_{1},i_{2},...,i_{T}\},O=\{o_{1},o_{2},...,o_{T}\} \\ A=[a_{ij}]_{N \times N}, a_{ij}=P(i_{t+1}=q_{j}|i_{t}=q_{i}) \\ B=[b_{j}(k)]_{N \times M},b_{j}(k)=P(o_{t}=v_{k}|i_{t}=q_{j})$$
READ MORE -
Model-Agnostic Meta-Learning MAML
#machine learning #meta learning
$$\min_{\theta} \sum_{\mathcal{T}_{i} \sim p(\mathcal{T})} \mathcal{L}_{\mathcal{T}_{i}}(f_{\theta^{'}_{i}}) = \sum_{\mathcal{T}_{i} \sim p(\mathcal{T})} \mathcal{L}_{\mathcal{T}_{i}}(f_{\theta_{i} - \alpha \nabla_{\theta} \mathcal{L}_{\mathcal{T}_{i}} (f_{\theta}) })$$
READ MORE -
Progressive Layered Extraction PLE
#machine learning #multi task
$$g^{k}(x)=w^{k}(x)S^{k}(x) \\ w^{k}(x)=\text{softmax}(W^{k}_{g}x) \\ S^{k}(x)=\[E^{T}_{(k,1)},E^{T}_{(k,2)},...,E^{T}_{(k,m_{k})},E^{T}_{(s,1)},E^{T}_{(s,2)},...,E^{T}_{(s,m_{s})}\]^{T} \\ y^{k}(x)=t^{k}(g^{k}(x)) \\ g^{k,j}(x)=w^{k,j}(g^{k,j-1}(x))S^{k,j}(x) $$
READ MORE -
Gamma Distribution
#Math #Statistics
$$\Gamma \left( a \right) = \int\limits_0^\infty {s^{a - 1} } e^{ - s} ds \\ P(x) = \frac{x^{\alpha-1} e^{-frac{x}{\theta}}}{\Gamma(\alpha) \theta^{\alpha}} \\ \mu = \alpha \theta \\ \sigma^{2} = \alpha \theta^{2} \\ \gamma_{1} = \frac{2}{\sqrt{\alpha}} \\ \gamma_{2} = \frac{6}{\alpha}$$
READ MORE -
Student t-Distribution
#Math #Statistics
$$f(t) = \frac{\Gamma(\frac{v + 1}{2})}{\sqrt{v\pi}\Gamma(v/2)} (1+\frac{t^{2}}{v})^{-(v+1)/2}, \\ F(t) = \frac{1}{2} + x \Gamma(\frac{v+1}{2}) \times \frac{2^{F_{1}}(1/2,\frac{v+1}{2};3/2;-\frac{x^{2}}{v})}{\sqrt{\pi v} \Gamma(\frac{v}{2})}, \\ F(t) = 1 - \frac{1}{2} I_{x(t)} (\frac{v}{2}, \frac{1}{2}), x(t)=\frac{v}{t^{2} + v}$$
READ MORE