---
# System prepended metadata

title: Financial Engineering 笔记

---

## 需要知道的技巧:

1. 边写边简化. 比如把一长串东西 = 常数 c, 碰到GBM的时候简化到$\mu, \sigma$便于用GST.
2. GBM的"自守性"，源于exponential形式:
 $K, e^{-rt}, e^{\int r_sds}, e^{-rt}S, S e^{r(T-t)}, \frac{1}{S}, S^{2024}, \frac{X}{Y^2}, \sqrt{XY}...$
3. 快速转换, 包括Jump. dS/S, dlogS..
4. $d(e^{kt}Z) = e^{kt} (kZdt + dZ)$ 


## 需要知道的知识:

四个MGF:
$mgf_X(u)$ of $N(\mu, \sigma)$: $e^{u\mu + \frac{1}{2}u^2\sigma^2}$
$mgf_X(u)$ of poisson($\lambda t$): $e^{\lambda t(e^u - 1)}$.
$mgf_X(u)$ of Compound Poisson: $E(e^{u\sum Y}) = e^{\lambda t (f(u)-1)}$, f 是 mgf of Y.
$mgf_X(u)$ of Expon($\lambda$): $\frac{\lambda}{\lambda - u}$, $\lambda>u$.

stochastic exponential: $Z = e^{X_t-X_0-1/2[X]}, dZ=ZdX$

M loc-mat, $M^2 - [M]$ loc-mat.
[M] 可通过 quadratic variation的定义式得到, $\Delta [M] = (\Delta M)^2$.

Isometry: $E [(H·M)^2] = E[H^2·[M]]$, M is square-integrable martingale.

$H·M$, M local martingale, H predictable and locally bounded, 至少 $H·M$ 是个local martingale.

GST(Gaussian Shift theorem)
$Z \sim N(0,1)$. 
one-dim: $E(e^{cZ}f(Z)) = e^{\frac{1}{2}c^2}E(f(Z+C))$
multi-dims: $E(e^{c'Z}f(Z)) = e^{\frac{1}{2}c'Rc}E(f(Z+Rc))$, R is correlation matrix.
别忘了Z+.

FeKa: $V(t, X_t) = E_t[e^{-\int r_s ds} \psi(T,X_T)]$ 满足 $V_t + \mathcal A V - rV = 0$, 注意写出边界条件. generator A 是 dt 前系数, 对有jump的情况, 记得$E(H-H_- dN)$.

QV鞅:
$W_t^2 - t$, $N'_t = N_t - \lambda t$, $(N'_t)^2 - [N'_t]$.
指数鞅(得益于平稳独立分布):
$e^{cW_t - \frac{1}{2}c^2t}$,$e^{uN_t - \lambda t(e^u - 1)}$

带Jump的Ito-Doeblin: $f(X) = f(X_0) + \int f_x(X^-) dX^c +\int f_t(X^-) dt + 1/2 \int f_{xx}(X^-) d[X^c] + \sum Jump$


问要满足什么PDE的时候，找到一个martingale, 用Ito取 $E_t(dM)$=0. 

Levy Process: filtered probability space, cadlag, adapted, real-value, $L_0=0$, indep incre, sta. incre, stoch. cont. 特征1: 允许jump, short-term IV. affine CF. 特征-1: 没有stochastic vola，imcomplete.

log合约 - volatility, by Ito. 
VIX的构造:
从dlogS (或者dlogF)的dynamic中发现有$\int \sigma^2$, 于是用求期望 $E^Q(logF)$ 划去dW, 最后用 $e^{-r\tau}E^Q$, 也就是现实的价格，static hedge出 $E^Q$.

Greeks:
*delta*: Call price $C(S,K)$ degree one homogeneity. Euler's theorem: $C = S\frac{\partial C}{\partial S} + K\frac{\partial C}{\partial K}$.
Put -1~0, call 0~1. N(d1)快到期时取决于S?K
*Gamma*:
非负(by convexity of call price)
在快到期时, 只有 at-the-money, gamma超大，难hedge.
*vega*: 
*theta*: almost negative.
*rho*: $C\approx \Delta_c S + ? B$. Call option的复制策略是卖Bond, Put的是买Bond, r越大, Bond越便宜, put越不值钱.

NA:
$C, C_{k}, C_{kk}, C_T$的范围



IV for 股票指数:
越快到期越高！ 
moneyless $K/S$ 一般decreasing. 左侧 OTM put很有市场, indicate heavy-tail和skew.

SV model:
$\rho$ control skew, $\eta$ control curvature.
CIR process: feller condition: $2k\theta > \eta^2$, 控制stochastic项不要太大.


## 提醒易错的地方:
写jump SDE的时候，注意把 $\sum$ 拆成 d.
尤其注意带括号的！符号别弄错！
在exotic 重新定义 $r, \sigma$的时候, 注意想清楚式子，加减号容易弄错。
FTAP说$e^{-rt}S$是个martingale。$E_t[S_T]$也是, 但要是它乘个怪东西就不是了 $E_t[e^{-r(T-t)}S_T]$, 需要再补上 $e^{-rt}$ -- discounted price.

带Dividend的情况, discounted Gain process is a martingale. $e^{(-r+q)t}S_t$, 在 Q meas下, dS/S = (r-q)dt + .. ?
带dividend的BS-PDE: $V_t + V_s(r-q)S + 1/2V_{ss}\sigma^2 = rV$
带dividend的PCP: $C_t - P_t = S_te^{-q\tau} - Ke^{-r\tau}$, 为什么这里是-q呢？因为在T时刻 C-P=S-K. ex-dividend的S满足. 或者同时取discounted price.
带dividend的BS公式: $e^{-r\tau}E^Q[(S-K)1_{S>K}]$, 用GST的时候自动也把S的Q-dynamic变一变 $S_T = S_te^{(r-q-...}$. 在计算Greek时，所有S也要带上"帽子" $e^{-q\tau}$, (但d1里面的那个S不带噢！)
带dividend的forward: $F = e^{(r-q)\tau}S_t$, 想Long Forward合约, Short了股票S, 存银行, 建仓成本为0. 到期的时候有 S+r-q-F也应该为0.
当我们指 $e^{-rt}H(S_t, t)$是一个martingale, H是价格!!! 不是payoff. FTAP说 discounted "price" process is a martingale.





# FE的结构
Binomial, Brownian Motion, Stochastic Integral, Black-Scholes

Exotic option, Barrier Option

deviation from BS, empirical(BL formula), volatility model(Stochastic Volatility, Jump)



