<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>金融工程 on 斐康明</title><link>https://young-mann.site/topics/%E9%87%91%E8%9E%8D%E5%B7%A5%E7%A8%8B/</link><description>Recent content in 金融工程 on 斐康明</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sat, 03 May 2025 18:54:27 +0200</lastBuildDate><atom:link href="https://young-mann.site/topics/%E9%87%91%E8%9E%8D%E5%B7%A5%E7%A8%8B/index.xml" rel="self" type="application/rss+xml"/><item><title>00 期权定价模型有什么用？——BS 公式背后的研究框架</title><link>https://young-mann.site/posts/00-options-pricing-framework/</link><pubDate>Sat, 03 May 2025 18:54:27 +0200</pubDate><guid>https://young-mann.site/posts/00-options-pricing-framework/</guid><description>&lt;blockquote>
&lt;p>本文是「期权定价」系列的序言。读完之后，你会知道：期权定价模型的作用是什么；以及 Black–Scholes–Merton 模型如何把期权问题组织成一套系统的研究框架。&lt;/p>&lt;/blockquote>
&lt;h2 id="符号约定">符号约定&lt;/h2>
&lt;p>本系列文章统一使用以下核心符号。模型专属参数在首次出现时另行定义；首次出现时写出完整 arguments，上下文固定后才省略。&lt;/p>

&lt;details>
 &lt;summary>Details&lt;/summary>
 &lt;p>&lt;strong>时间、合约与状态&lt;/strong>&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>符号&lt;/th>
 &lt;th>含义&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>$t$&lt;/td>
 &lt;td>observation / valuation time&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$T$&lt;/td>
 &lt;td>expiry time；对单张合约固定，对 volatility surface 可变&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$\tau:=T-t$&lt;/td>
 &lt;td>time to maturity&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$K$&lt;/td>
 &lt;td>strike；对单张合约固定，对 volatility surface 可变&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$S=(S_u)_{u\ge0}$&lt;/td>
 &lt;td>标的资产价格过程&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$S_t$&lt;/td>
 &lt;td>标的资产在时刻 $t$ 的价格&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$s$&lt;/td>
 &lt;td>pricing function 中的 spot state argument&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$\Phi$&lt;/td>
 &lt;td>payoff function&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$H:=\Phi(S_T;K)$&lt;/td>
 &lt;td>到期于 $T$ 的 terminal claim&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>利率、远期与波动率&lt;/strong>&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>符号&lt;/th>
 &lt;th>含义&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>$r,q$&lt;/td>
 &lt;td>BS 特例中的常数无风险利率与连续股息收益率&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$r(u),q(u)$&lt;/td>
 &lt;td>确定性利率与连续股息收益率曲线&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$D(t,T)$&lt;/td>
 &lt;td>discount factor，$D(t,T)=\exp(-\int_t^T r(u)\,du)$&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$F_t(T)$&lt;/td>
 &lt;td>时刻 $t$、到期于 $T$ 的 forward price&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$k_t(K,T)$&lt;/td>
 &lt;td>forward log-moneyness，$k_t(K,T)=\log(K/F_t(T))$&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$\sigma$&lt;/td>
 &lt;td>BS 中的常数 volatility input&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$\sigma_{\mathrm{loc}}(t,s)$&lt;/td>
 &lt;td>local volatility function&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$v_t$&lt;/td>
 &lt;td>instantaneous variance；instantaneous volatility 为 $\sqrt{v_t}$&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>$\sigma_{\mathrm{imp}}(t;K,T)$&lt;/td>
 &lt;td>时刻 $t$、合约 $(K,T)$ 的 BS implied volatility&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>定价、测度与风险&lt;/strong>&lt;/p></description></item><item><title>01 衍生品价格从何而来？——复制、无套利与定价测度</title><link>https://young-mann.site/posts/01-mathematical-foundations-final/</link><pubDate>Sat, 03 May 2025 18:54:27 +0200</pubDate><guid>https://young-mann.site/posts/01-mathematical-foundations-final/</guid><description>&lt;p>&lt;a href="https://young-mann.site/posts/00-options-pricing-framework/">序言&lt;/a>把期权定价拆成了一条完整的研究链：先规定市场如何变化，再讨论能否复制 payoff，随后才有价格机制、校准与风险分解。本文只处理这条链的第一段：&lt;/p>
$$
\boxed{
\text{market model}
\longrightarrow
\text{admissible self-financing strategy}
\longrightarrow
\text{replication}
\longrightarrow
\text{no-arbitrage}
\longrightarrow
\text{martingale measure}
\longrightarrow
\text{pricing operator}.
}
$$&lt;p>这条顺序不能压缩成“在 risk-neutral measure 下取期望”。一个 terminal payoff 首先只是未来现金流；只有相对于某个市场、某组可交易资产和某类合法策略，它才可能获得 replication cost。只有再加入 no-arbitrage，replication cost 才成为唯一的无套利价格。Martingale measure 则把这套经济论证改写成条件期望，最终在额外的 Markov 与 regularity 条件下变成 PDE 或其他可求解的 forward problem。&lt;/p>
&lt;p>本文沿用本系列的统一符号：&lt;/p>
$$
H:=\Phi(S_T;K),
\qquad
V_t:=V(t,S_t;K,T;\boldsymbol\vartheta),
$$&lt;p>其中 $H$ 是到期于 $T$ 的 claim，$V_t$ 是该 claim 在时刻 $t$ 的 model value。$\Pi_t$ 始终表示交易组合的总价值；无套利价格集合记为 $\mathcal P^{NA}(H)$，不使用 $\Pi$ 表示价格集合。&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>来源边界&lt;/strong>：本文为了与后续 stochastic models 和 pricing PDE 衔接，主要使用连续时间记号。但当前项目中关于 FTAP、attainability 与 completeness 的完整正式来源主要是 Schweizer–Farkas 的有限离散时间版本。涉及 continuous-time NFLVR、一般 semimartingale admissibility、formal Feynman–Kac theorem 与 general change of numeraire 的地方，会明确标记为来源缺口，而不会把有限离散时间定理无条件外推。&lt;/p></description></item><item><title>02 市场报价如何变成模型标价？——波动率曲面、正向定价与反向校准</title><link>https://young-mann.site/posts/02-pricing-calibration-final/</link><pubDate>Sat, 03 May 2025 18:54:27 +0200</pubDate><guid>https://young-mann.site/posts/02-pricing-calibration-final/</guid><description>&lt;p>&lt;a href="https://young-mann.site/posts/01-mathematical-foundations-final/">《01 衍生品价格从何而来？》&lt;/a>第 6 节最终交付的是一个逐合约的 risk-neutral pricing operator：&lt;/p>
$$
V_t^i
\mathrel{=}
\mathcal M^{\mathbb Q}
(\mathbf x_{t,i};\boldsymbol\vartheta^{\mathbb Q})
\in\mathbb R,
$$&lt;p>也就是说，只要给定模型、参数、第 $i$ 个合约的当前状态与合约条件，我们原则上已经知道怎样得到一个标量期权价格。后文为校准而把多个合约输出堆叠成向量时，那只是这张逐合约 map 的局部向量化。&lt;/p>
&lt;p>但市场并不会直接告诉我们&lt;/p>
$$
\boldsymbol\vartheta^{\mathbb Q}
$$&lt;p>是多少。真实市场提供的是不同 strike、不同 maturity 上的一组 bid、ask 与成交价格。于是，一个数学上已经定义好的 pricing model 要真正进入交易，还必须补上另一张 map：&lt;/p>
$$
\text{market quotes}
\longrightarrow
\widehat{\boldsymbol\vartheta}^{\mathbb Q}.
$$&lt;p>这就是 calibration。&lt;/p>
&lt;p>因此，本篇不再回答“期权为什么能够被定价”，而只处理上一篇留下的接口问题：&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>一个已经数学定义好的定价模型，如何与真实市场上的期权价格连接起来？&lt;/strong>&lt;/p>&lt;/blockquote>
&lt;p>这条链会依次经过 market target、forward solver、inverse problem、identifiability，最后把一个可重复的 calibration map 交给下一篇的 risk / PnL 分解。&lt;/p>
&lt;hr>
&lt;h2 id="1-需要连接的模型对象与市场对象分别是什么">1. 需要连接的模型对象与市场对象分别是什么？&lt;/h2>
&lt;p>Calibration 之前首先要区分两个经常使用相同参数名、却回答完全不同问题的对象。&lt;/p>
&lt;p>假设历史数据记为&lt;/p>
$$
\mathcal D_t.
$$&lt;p>一个 physical-measure estimator 可以形式化写成&lt;/p></description></item><item><title>03 期权组合的 PnL 如何分解？——Greeks、对冲与残差</title><link>https://young-mann.site/posts/03-risk-decomposition/</link><pubDate>Sat, 03 May 2025 18:54:27 +0200</pubDate><guid>https://young-mann.site/posts/03-risk-decomposition/</guid><description>&lt;p>&lt;a href="https://young-mann.site/posts/01-mathematical-foundations-final/">《01 衍生品价格从何而来？》&lt;/a>从 market dynamics、replication 与 no-arbitrage 出发，得到给定模型和参数后的 pricing operator；&lt;a href="https://young-mann.site/posts/02-pricing-calibration-final/">《02 市场报价如何变成模型标价？》&lt;/a>把真实市场上的 option quotes 输入这个 operator，通过 calibration 得到当前的 risk-neutral parameters 与 model mark。&lt;/p>
&lt;p>因此，到这一篇开始时，我们已经有&lt;/p>
$$
\widehat{\boldsymbol\vartheta}^{\mathbb Q}_t
\mathrel{=}
\mathcal C(\boldsymbol\eta_t),
\qquad
V_t^i
\mathrel{=}
\mathcal M^{\mathbb Q}
\!\left(
\mathbf z_{t,i};
\widehat{\boldsymbol\vartheta}^{\mathbb Q}_t
\right).
$$&lt;p>这里 $\boldsymbol\eta_t=(\mathbf y_t,\mathbf a_t)$ 是第二篇第 6 节定义的完整 calibration input，$\mathbf z_{t,i}$ 是第 $i$ 个合约直接使用的 market-state vector，而 $V_t^i\in\mathbb R$ 是该合约的标量 mark。第二篇结束于“当前这些衍生品如何被模型标价”；这一篇的问题则是：&lt;/p>
&lt;blockquote>
&lt;p>当市场从 $t$ 走到 $t+\varepsilon$ 后，这些价格为什么变化？哪些变化可以被 hedge？最终没有解释掉的 PnL 又意味着什么？&lt;/p>&lt;/blockquote>
&lt;p>这一步是 theory → calibration → risk / hedging 的最后一个接口，也是 Greeks 真正获得交易含义的地方。&lt;/p></description></item><item><title>尝试部分复现 Carr and Wu (2016)</title><link>https://young-mann.site/posts/note--extract-vol-surface-with-ukf/</link><pubDate>Mon, 30 Dec 2024 16:11:15 +0100</pubDate><guid>https://young-mann.site/posts/note--extract-vol-surface-with-ukf/</guid><description>&lt;blockquote>
&lt;p>【2025/7/16 更新】写邮件问了作者以后，发现我此前估计 OEV 的方式是错误的。&lt;/p>
&lt;p>我直接估计了 ORV ，而原文作者并没有估计 ORV ，而是直接估计了 OEV。&lt;/p>
&lt;p>我的错误流程是：对每个（tau, k）对应的价格路径，求解使得 delta-hedged 的 P&amp;amp;L 为 0 的 ORV ====&amp;gt; 基于求解所得的 ORVs 计算期权价格，并对其指数加权平均 ====&amp;gt; 基于上一步的指数加权平均值计算 OEV 。&lt;/p>
&lt;p>原文作者的流程是：对每个（tau, k）对应的价格路径，求解使得 delta-hedged 的 P&amp;amp;Ls 的指数加权平均为 0 的 Volatility, which 是 OEV。&lt;/p>&lt;/blockquote>
&lt;/p>
---
&lt;blockquote>
&lt;p>这学期的某门 Seminar 要求复现给定范围内的一篇论文。我尝试复现了 Carr and Wu (2016) &lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>的部分结果。&lt;/p>
&lt;p>Carr and Wu (2016) 提出了一个被称作 VGVV model &lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup> 的期权定价模型：&lt;/p>
&lt;ol>
&lt;li>他们假设了风险中性测度下的 underlying price, implied volatility 以及两者 correlation 的 dynamics，并为 implied volatility 指定了更具体的形式。在这 3 个 dynamics 中， &lt;strong>$(m_t, w_t, \eta_t,v_t, \rho_t)$ 这 5 个参数是未知的。&lt;/strong>&lt;/li>
&lt;li>为了分析 Volatility Risk Premium，他们定义了 option realized volatility 和 option expected volatility，并假设了真实世界测度下的 underlying price, implied volatility 以及两者 correlation 的 dynamics。在这 3 个 dynamic 中， &lt;strong>$(m_t^{\mathbb{P}}, w_t, \eta_t,v_t^{\mathbb{P}},\rho_t^{\mathbb{P}})$ 这 5 个参数是未知的。&lt;/strong>&lt;/li>
&lt;li>从市场内不存在 dynamic arbitrage 的要求出发，可推得 put option BSM price 与其 Vega, Gamma, Vanna, Volga之间必须满足的PDE。这个作为约束条件的 PDE 可被化简为关于 implied variance&lt;sup id="fnref:3">&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref">3&lt;/a>&lt;/sup> (以及 option expected variance) 的二次方程，其中包含 $(m_t,m_t^{\mathbb{P}}, w_t, \eta_t,v_t,v_t^{\mathbb{P}}, \rho_t,\rho_t^{\mathbb{P}})$ 。&lt;strong>如果已知 $(m_t,m_t^{\mathbb{P}}, w_t, \eta_t,v_t,v_t^{\mathbb{P}}, \rho_t,\rho_t^{\mathbb{P}})$ 的值，就能计算同一时间点的 implied variance (以及 option expected variance) ，以及对应的期权价格。&lt;/strong>&lt;/li>
&lt;li>那么，如何估计 $(m_t,m_t^{\mathbb{P}}, w_t, \eta_t,v_t,v_t^{\mathbb{P}}, \rho_t,\rho_t^{\mathbb{P}})$ 的值？为此，他们使用了 Unscented Kalman Filter（简称 UKF）&lt;sup id="fnref:4">&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref">4&lt;/a>&lt;/sup>提取每个时间点的 $(m_t,m_t^{\mathbb{P}}, w_t, \eta_t,v_t,v_t^{\mathbb{P}}, \rho_t,\rho_t^{\mathbb{P}})$ 。需要注意，在使用UKF前，需要估计其 process noise 和 measurement noise 的协方差矩阵。&lt;/li>
&lt;/ol>
&lt;p>下文简单记录了 Carr and Wu (2016) 的思路，以及我的复现结果&lt;/p></description></item><item><title>Option Pricing: Finite Element Method</title><link>https://young-mann.site/posts/note--fem-for-option-pricing/</link><pubDate>Sun, 19 May 2024 18:36:39 +0200</pubDate><guid>https://young-mann.site/posts/note--fem-for-option-pricing/</guid><description>&lt;h2 id="the-original-pricing-equation">The original pricing equation&lt;/h2>
$$
\left\\{\begin{align*}
\partial_t u+\mathcal{A} u &amp;=f \quad &amp;\text{in} \quad &amp;J \times G
\\\
u(0, x) &amp;= u_0(x) \quad &amp;\text{in} \quad &amp;G 
\end{align*}\right.,
$$&lt;p>where&lt;/p>
&lt;ul>
&lt;li>$\mathcal{A}$ is a linear second-order partial differential operator (w.r.t. $x$ )&lt;/li>
&lt;li>$u_0$ is the initial condition (the payoff)&lt;/li>
&lt;li>$f$ is the forcing term&lt;/li>
&lt;li>$G \subseteq \mathbb{R}^d$ (state space of admissible stock prices)&lt;/li>
&lt;li>$J=(0, T)$ ( $T>0$ the maturity)&lt;/li>
&lt;/ul>
&lt;h2 id="the-weak-formulation">The weak formulation&lt;/h2>
&lt;p>The equation above can be put into variational form. Given the Hilbert spaces $V$ and $H$ such that $V \hookrightarrow H \cong H^* \hookrightarrow V^\*$, and assume that $u_0 \in H, \quad f \in L^2\left(J ; V^*\right)$, the abstract weak formulation of the equation above reads:&lt;/p></description></item><item><title>一些函数空间的相关概念</title><link>https://young-mann.site/posts/functional-analysis-concepts-for-fem/</link><pubDate>Wed, 10 Apr 2024 16:11:55 +0200</pubDate><guid>https://young-mann.site/posts/functional-analysis-concepts-for-fem/</guid><description>&lt;p>This is a brief introduction to the concepts in functional analysis, which are used in the variational formulation in finite element methods to solve the PDE. The content below is from the page 11-12 and page 27-31 in the book &lt;em>Computational Methods for Quantitative Finance: Finite Element Methods for Derivative Pricing&lt;/em>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>.&lt;/p>
&lt;h2 id="function-spaces">Function Spaces&lt;/h2>
&lt;h3 id="definition-of-partial-derivatives">Definition of partial derivatives&lt;/h3>
$$
D^{\mathbf{n}} u(x):=\frac{\partial^{|\mathbf{n}|} u(x)}{\partial x _1^{n _1} \cdots \partial x _d^{n _d}}=\partial _{x _1}^{n _1} \cdots \partial _{x _d}^{n _d} u(x), \quad x=\left(x _1, \ldots, x _d\right) \in G,
$$&lt;p>
where $\mathbf{n}=\left(n _1, \ldots, n _d\right) \in \mathbb{N} _0^d$ is a multi-index. The order of the partial derivative is given by $|\mathbf{n}|=\sum _{i=1}^d n _i$.&lt;/p></description></item><item><title>The Volatility Surface</title><link>https://young-mann.site/posts/note--the-volatility-surface-gatheral/</link><pubDate>Thu, 07 Dec 2023 22:14:50 +0100</pubDate><guid>https://young-mann.site/posts/note--the-volatility-surface-gatheral/</guid><description>&lt;blockquote>
&lt;p>简单记录第一次看 &lt;em>The Volatility Surface&lt;/em> 时推导有问题的部分。&lt;/p>&lt;/blockquote>
&lt;p>(P16) 给定下列等式：&lt;/p>
$$
\begin{gathered}
\frac{\partial V}{\partial t}+\frac{1}{2} v S^2 \frac{\partial^2 V}{\partial S^2}+ 
\rho \eta v S \frac{\partial^2 V}{\partial S \partial v}+\frac{1}{2} \eta^2 v \frac{\partial^2 V}{\partial v^2}+r S \frac{\partial V}{\partial S}-r V 
-\lambda(v-\bar{v}) \frac{\partial V}{\partial v}=0
\end{gathered}
$$$$
x=\ln \left(F_{t, T} / K\right)=\ln \left(S e^{r \tau} / K\right) ,
$$$$
\begin{gathered}
-\frac{\partial C}{\partial \tau}+\frac{1}{2} v \frac{\partial^2 C}{\partial x^2}-\frac{1}{2} v \frac{\partial C}{\partial x}+\frac{1}{2} \eta^2 v \frac{\partial^2 C}{\partial v^2}+\rho \eta v \frac{\partial^2 C}{\partial x \partial v}-\lambda(v-\bar{v}) \frac{\partial V}{\partial v}=0
\end{gathered}
$$&lt;p>
一开始看书时没明白 $r S \frac{\partial V}{\partial S}-r V $ 这项是怎么被消去的。看了&lt;a href="https://quant.stackexchange.com/questions/34742/gatherals-change-of-variables-for-stochastic-volatility-pde">这个回答&lt;/a>之后才发现我没把当期价格$V$表示成终期价格$C$：$e^{-r \tau} C(x, \nu, \tau)=V(S, \nu, t)$，所以一开始推不出书上的式子。&lt;/p></description></item><item><title>对无套利定价的一点理解</title><link>https://young-mann.site/posts/note--no-arbitrage/</link><pubDate>Tue, 16 May 2023 20:25:00 +0800</pubDate><guid>https://young-mann.site/posts/note--no-arbitrage/</guid><description>&lt;p>no arbitrage 是卖方设计金融产品时需要满足的要求。简而言之，如果卖方的报价不满足无套利原则&lt;/p>
&lt;p>在课本上看到套利定价模型和衍生品定价的时候，总会看到无套利定价的思路。尽管其思想很容易理解，但还是很好奇为什么特意要强调这种定价方法呢？另外，这种定价方法和以前提出的定价方法比，又有什么好处呢？对于定价理论的发展史稍作了解后，我目前的结论是，无套利定价理论更加实用，因为它所需要的前提假设更宽松，不需要假设决策者的效用函数，which 过于理想化、缺乏统一的设定标准、但在均衡定价方法中又是必须的。&lt;/p>
&lt;p>无套利定价理论的出现，得从金融产品的定价开始说起。&lt;/p>
&lt;p>早期做金融产品定价的多是经济学出身的学者。而在经济学里，主流的定价方法是均衡定价，即认为，市场出清时的均衡价格，也就是需求和供给达到均衡时的价格就是该产品应有的价格。而需求和供给又可以从消费者理论与生产者理论分别推出：在给定消费者偏好与预算约束的情况下， 消费者的效用最大化决定了需求曲线；同理，生产者的利润最大化决定了需求曲线。把两条曲线放在一起，它们的交点就是均衡点，此状态下的价格便是均衡价格。&lt;/p>
&lt;p>在面对金融产品定价这个问题的时候，这些学者也曾试着用上述的传统手段进行定价，但是很快就遇上了麻烦：金融产品和此前研究的产品不太一样。此前研究的产品，比如说冰淇淋，它的供给方与需求方是两拨人，但金融市场上，买卖产品的却是同一拨人，供给方和需求方是一体的。这样下来，原本消费者理论的效用最大化、生产者理论的利润最大化便很难在此得到推广，供给需求曲线也画不出来了，更别提能不能得到均衡价格了。&lt;/p>
&lt;p>对于金融产品，既然搞不出传统供给需求的均衡，也就是局部均衡了，那还能咋整呢？Arrow 和 Debreu 俩老哥就想出了新路子，给市场里的每个人加上了当期和未来的消费的效用函数，再对效用函数做最优化，以此得到需求量。这条思路被称为一般均衡定价。&lt;/p>
&lt;p>新的均衡理论有是有了，但问题是它不实用啊，没法用在实际的金融产品交易中。这是因为，一般均衡理论很大程度上依赖于每个人的「效用函数」的假设——经济学家对「效用函数」做了一系列的假设，比如单调性、凸性、连续性，但具体怎么设定效用函数，却没个统一的标准。&lt;/p>
&lt;p>这可咋整？效用函数在理论推导上是挺有用，但我用不上啊——我总不能在每次下单前都显式地写出自己的效用函数吧？那么，能不能绕开效用函数，对金融产品进行定价呢？这就得提到另一套定价理论，几乎不依赖对效用函数的假设。这个定价理论叫&lt;strong>无套利定价&lt;/strong>。它的思路很简单，把金融产品还原成不同比例的基础资产，把这些基础资产的价格加总起来，就是金融产品的价格了。比如说，如果我想要对一个双层吉士汉堡进行定价，那我只要把双吉里面包、牛肉饼、知识、番茄酱、酸黄瓜、洋葱碎的占比和它们的价格记下来，根据不同成分的占比加权求和，再加点服务费，就能知道双吉的价格了&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>。&lt;/p>
&lt;p>用数学语言来讲，无套利方法其实就是把衍生品投影到商品空间的一组基上，用投影的系数和这些基的价格做个加权和。换个角度来看，无套利定价也可以被认为是商品空间里的泰勒展开。只要能够找到基础资产，就能对衍生品进行定价。而在金融市场中，最常见的基础资产有股票和现金&lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>。因此，后来的学者就想方设法把衍生品拆成股票和现金的组合。其中，Merton 就将欧式看涨期权拆成了 $\Delta$ 份股票和 $-\Pi$ 份现金的组合，即：$call=\Delta \times S-\Pi$，并利用现金可以生息的特性，从 $d\Pi = r\Pi dt$ 这个微分方程出发，利用伊藤引理推导出了期权价格满足的微分方程，后人称 B-S 方程。&lt;/p>
&lt;p>再之后，各式各样的微分方程出现在了衍生品的研究和实务领域，但是解这些微分方程也是挺折磨人的事情。于是，后来人在完全市场的假设下搞了等价鞅测度，将相对价格表示为了一个期望值，并进一步化简，将其表示为了风险中性概率下 payoff 的折现值，即：$f=\mathbb E^Q[e^{-\int rdt}f_T]$，大大简化了衍生品定价的计算。&lt;/p>
&lt;hr>
&lt;p>(2023/11/01 更新：下文用到的符号均取自 Mathematical Foundations for Finance)&lt;/p>
&lt;p>现在回头来看，之前的最后一段存在问题：等价鞅测度不是在&lt;strong>先&lt;/strong>有完备市场的假设下被搞出来的。实际上，我们是先检查市场 $\left(\Omega, \mathcal{F}, \mathbb{F}, P, S^0 \equiv 1, S\right)$的等价鞅测度，&lt;strong>来判断这个市场是否满足无套利，并且（进一步而言）是完备的？&lt;/strong> 等价鞅测度、无套利、完备三者的关系大概可被表述为：如果市场$S$有至少一个等价鞅测度，那么该市场满足无套利；在此基础上，如果市场$S$有且仅有一个等价鞅测度，那么该市场是完备的。下图是讲义中的相关定理，其中$S^0$是作为 numéraire 的资产的价格，$\mathbb{P}_e$表示 $S$ 的所有等价鞅测度所组成的集合。&lt;/p>
&lt;figure class="smaller">&lt;img src="https://young-mann.site/media/E9um1kyP7V8lDSx.png"
 alt="无套利和等价鞅测度的关系">&lt;figcaption>
 &lt;p>无套利和等价鞅测度的关系&lt;/p>
 &lt;/figcaption>
&lt;/figure>

&lt;figure class="smaller">&lt;img src="https://young-mann.site/media/CQk3npA2fsxcerz.png"
 alt="无套利、完备和等价鞅测度的关系">&lt;figcaption>
 &lt;p>无套利、完备和等价鞅测度的关系&lt;/p>
 &lt;/figcaption>
&lt;/figure>

&lt;p>根据定义，如果一个市场满足无套利却不是完备的，那么，市场里必定存在一些无法复制的 payoff。这意味着，我们无法对部分资产定出&lt;strong>唯一&lt;/strong>的价格。不同的等价鞅测度，会导致资产被定出不同价格。反之，如果市场是完备的，那么我们就能确保市场里每个资产都能被给定唯一的价格，无论我们采用哪一个等价鞅测度。此时，以下的风险中性定价公式就能成立，大大简化了对于期权的定价：&lt;/p>
&lt;figure class="smaller">&lt;img src="https://young-mann.site/media/72gircJYyAXLoM8.png"
 alt="风险中性定价公式">&lt;figcaption>
 &lt;p>风险中性定价公式&lt;/p>
 &lt;/figcaption>
&lt;/figure>

&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>欸，那么面包、牛肉饼、知识、番茄酱、酸黄瓜、洋葱碎的价格是多少？这个我不知道，因为它们都是基础资产，而无套利方法只能对由这些基础资产衍生而来的衍生资产做定价。换而言之，无套利定价是一种相对定价方法。与之相对的概念是绝对定价方法，简单来说，是指将某资产的未来现金流折现加总值认为是该资产的价格。&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;li id="fn:2">
&lt;p>债券不是基础资产——它可以被认为是利率的衍生品，而且是最简洁的衍生品。&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>C++ design patterns and derivatives pricing</title><link>https://young-mann.site/posts/note--design-patterns-and-derivatives-pricing/</link><pubDate>Tue, 09 Aug 2022 00:42:05 +0800</pubDate><guid>https://young-mann.site/posts/note--design-patterns-and-derivatives-pricing/</guid><description>&lt;p>&lt;strong>Book Link:&lt;/strong> &lt;a href="https://neodb.social/books/493600/">C++ Design Patterns and Derivatives Pricing&lt;/a>&lt;/p>
&lt;p>本文用于记录读完 &lt;a href="https://neodb.social/books/493600/">C++ design patterns and derivatives pricing&lt;/a> 后的代码实践。&lt;/p>
&lt;h1 id="ch1-vanillacalloption">ch1-VanillaCallOption&lt;/h1>
&lt;p>在第 1 章的文件夹里，主要实现了 1 个简单的看涨期权（call option）的定价模型，由 3 部分组成。主程序是 &lt;code>SimpleMCMain1.cpp&lt;/code> ，其中需要用到生成随机数的功能，所以引入了 1 个头文件（只有函数声明）的 &lt;code>Random1.h&lt;/code> ，以及具体实现该功能的头文件 &lt;code>Random1_Implementation.h&lt;/code> &lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>。&lt;/p>
&lt;figure class="smaller">&lt;img src="https://young-mann.site/media/CIUwl3ykpuzsQ8e.jpg"
 alt="SimpleMC 第一章文件结构截图">
&lt;/figure>

&lt;h1 id="ch2-encapsulation">ch2-Encapsulation&lt;/h1>
&lt;p>在第 2 章，对于常用的功能进行了封装。这章用到的文件具体如下（表格内省略了用于实现接口的文件，例如 “Random1_Implementation.h”，后文的表格皆是如此）：&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th style="text-align: left">文件名称&lt;/th>
 &lt;th style="text-align: left">用途&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td style="text-align: left">Random1.h&lt;/td>
 &lt;td style="text-align: left">生成随机数的函数&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">PayOff1.h&lt;/td>
 &lt;td style="text-align: left">以 Strike 与 TheOptionsType 为私有变量的 PayOff 类，主要特点由：1. 以 &lt;code>enum OptionType {call, put}&lt;/code> 区分不同类型期权的定价方式（这里是 2 种：看涨期权、看跌期权）；2. 通过&lt;code>double operator() (double Spot) const&lt;/code> 重载运算符 &lt;code>()&lt;/code> ，以计算给定期权的 PayOff&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">SimpleMC.h&lt;/td>
 &lt;td style="text-align: left">用于最终定价的 Monte-Carlo 函数&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">SimpleMCMain2.cpp&lt;/td>
 &lt;td style="text-align: left">主程序&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;figure class="smaller">&lt;img src="https://young-mann.site/media/TCehDSMZ6tal3zj.jpg"
 alt="SimpleMC 第二章文件结构截图">
&lt;/figure>

&lt;h1 id="ch3-inheritanceandvirtualfunction">ch3-InheritanceAndVirtualFunction&lt;/h1>
&lt;p>第 2 章的程序在扩展性上有待优化，考虑以下 2 个问题：&lt;/p></description></item></channel></rss>