<?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/%E6%95%B0%E5%AD%A6%E5%B7%A5%E5%85%B7/</link><description>Recent content in 数学工具 on 斐康明</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 16 Sep 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://young-mann.site/topics/%E6%95%B0%E5%AD%A6%E5%B7%A5%E5%85%B7/index.xml" rel="self" type="application/rss+xml"/><item><title>Mathematical Foundations for Finance: Handbook</title><link>https://young-mann.site/posts/mathematical-foundations-for-finance/</link><pubDate>Mon, 16 Sep 2024 00:00:00 +0000</pubDate><guid>https://young-mann.site/posts/mathematical-foundations-for-finance/</guid><description>&lt;p>This reference guide follows one continuous line of reasoning:&lt;/p>
$$\text{information} \longrightarrow \text{trading} \longrightarrow \text{no arbitrage} \longrightarrow \text{martingale measures} \longrightarrow \text{replication}$$$$\text{replication} \longrightarrow \text{stochastic calculus} \longrightarrow \text{Black-Scholes}.$$&lt;p>The primary source is M. Schweizer and E. W. Farkas, &lt;em>Lecture Notes: Mathematical Foundations for Finance&lt;/em>, version December 22, 2022, abbreviated below as &lt;strong>LN&lt;/strong>. The weekly exercises, solutions, and exam simulation are from ETH Zürich, Fall 2023, abbreviated as &lt;strong>ES 1-11&lt;/strong> and &lt;strong>SE&lt;/strong>. Definitions, theorem statements, and proof structures attributed to these sources are paraphrased. Paragraphs labelled &lt;strong>Interpretation&lt;/strong>, &lt;strong>Study note&lt;/strong>, &lt;strong>Worked example&lt;/strong>, or &lt;strong>Pitfall&lt;/strong> are supplementary explanations added for this guide.&lt;/p></description></item><item><title>随机模拟与 SDE 数值解</title><link>https://young-mann.site/posts/stochastic-simulation-and-sde-numerical-methods/</link><pubDate>Wed, 15 May 2024 12:00:00 +0200</pubDate><guid>https://young-mann.site/posts/stochastic-simulation-and-sde-numerical-methods/</guid><description>&lt;p>随机模拟从均匀随机数出发，经分布变换得到目标样本，再用样本计算期望或驱动随机过程：&lt;/p>
$$
\text{均匀随机数}
\longrightarrow
\text{目标分布}
\longrightarrow
\text{期望与误差}
\longrightarrow
\text{随机过程}
\longrightarrow
\text{SDE 的数值解}.
$$&lt;p>前半段讨论样本的生成与估计精度，后半段讨论连续时间模型的离散计算。判断算法时，需要同时看分布是否正确、误差能否量化，以及计算成本。&lt;/p>
&lt;p>本文将 Stochastic Simulation 与 NASODE 的材料重新组织为三个部分：随机数与误差控制、不同抽样方法，以及 SDE 的数值计算。&lt;/p>
&lt;p>后文会区分抽样误差、时间离散误差、截断误差与 Markov 链未收敛造成的误差。每个小节附有一个浏览器端数值实验，可直接修改参数。&lt;/p>
&lt;h2 id="1-随机模拟随机数估计与误差控制">1. 随机模拟：随机数、估计与误差控制&lt;/h2>
&lt;h3 id="11-伪随机数是怎样生成的">1.1 伪随机数是怎样生成的&lt;/h3>
&lt;p>计算机首先产生的通常不是任意分布，而是一串看起来像独立均匀变量的伪随机数&lt;/p>
$$
U_1,U_2,\ldots\sim U(0,1).
$$&lt;p>伪随机数生成器是确定性状态机：&lt;/p>
$$
s_{n+1}=T(s_n),\qquad U_n=G(s_n).
$$&lt;p>固定随机种子（seed）可以复现实验。长周期只能避免序列过早重复，不能排除相邻输出中的结构。线性同余生成器&lt;/p>
$$
x_{n+1}=(ax_n+c)\bmod M,\qquad u_n=x_n/M
$$&lt;p>即使参数使周期达到 $M$，连续点对 $(u_n,u_{n+1})$ 仍可能落在少数平行直线上。一维 Kolmogorov–Smirnov 检验也看不到这种序列相关性。实际计算宜使用成熟数值库的生成器，并保存随机种子、算法和库版本。&lt;/p>
&lt;p>对混合型线性同余生成器，Hull–Dobell 条件给出了完整周期的充要条件：&lt;/p>
&lt;ol>
&lt;li>$\gcd(c,M)=1$；&lt;/li>
&lt;li>$M$ 的每个素因子都整除 $a-1$；&lt;/li>
&lt;li>若 $4\mid M$，则 $4\mid(a-1)$。&lt;/li>
&lt;/ol>
&lt;p>这些条件只回答“什么时候回到初始状态”。它们不回答点集在二维或更高维空间是否均匀。对生成器做检查时，应区分三层：一维边际是否均匀、滞后相关是否接近零、高维连续元组是否出现格结构。某个检验没有拒绝均匀性，只表示当前样本没有提供足够反证，并不等于“生成器已被证明随机”。&lt;/p>
&lt;div class="stochsim-lab" id="stochsim-lab-0" data-stochsim-lab="rng">
 
 &lt;div class="stochsim-lab__title">交互实验：观察伪随机点的结构&lt;/div>
 &lt;p>修改线性同余生成器的参数，观察相邻点 $(u_n,u_{n+1})$ 是否形成格线。&lt;/p>
 &lt;div class="stochsim-lab__controls">
 &lt;label>Seed&lt;input data-field="seed" type="number" value="7" step="1">&lt;/label>
 &lt;label>乘数 $a$&lt;input data-field="a" type="number" value="17" step="1">&lt;/label>
 &lt;label>增量 $c$&lt;input data-field="c" type="number" value="43" step="1">&lt;/label>
 &lt;label>模数 $M$&lt;input data-field="modulus" type="number" value="256" min="8" max="65536" step="1">&lt;/label>
 &lt;label>点数&lt;input data-field="count" type="number" value="180" min="16" max="2000" step="1">&lt;/label>
 &lt;button type="button" data-run>重新生成&lt;/button>
 &lt;/div>
 &lt;div class="stochsim-lab__metrics" data-output aria-live="polite">&lt;/div>
 &lt;canvas data-plot data-height="320" aria-label="线性同余生成器相邻点散点图">&lt;/canvas>
 &lt;p class="stochsim-lab__caption">周期长不等于高维点集均匀；尝试把模数改小，格结构会更明显。&lt;/p></description></item><item><title>从掷硬币理解概率空间、σ-代数与域流</title><link>https://young-mann.site/posts/note--probability-theory/</link><pubDate>Thu, 14 Jul 2022 17:45:55 +0800</pubDate><guid>https://young-mann.site/posts/note--probability-theory/</guid><description>&lt;blockquote>
&lt;p>用两次掷硬币和一棵简化股价树，直观解释样本空间、事件、σ-代数、概率测度、随机变量与域流如何刻画可能结果和随时间累积的信息；本文可作为 &lt;em>&lt;a href="https://young-mann.site/posts/mathematical-foundations-for-finance/#1-probability-information-and-conditional-expectation">Mathematical Foundations for Finance: Handbook&lt;/a>&lt;/em> 第 1 章的通俗版解释。&lt;/p>&lt;/blockquote>
&lt;p>概率论的形式化语言常显得抽象，因为它同时回答三个不同的问题：哪些结果可能发生，哪些关于结果的问题允许被讨论，以及怎样给这些事件赋予概率。样本空间、σ-代数和概率测度分别承担这三项工作。&lt;/p>
&lt;h2 id="1-从样本空间到事件">1. 从样本空间到事件&lt;/h2>
&lt;p>考虑连续投掷两次硬币。用 $\mathrm H$ 表示正面，用 $\mathrm T$ 表示反面。一次完整试验的所有可能结果组成样本空间&lt;/p>
$$
\Omega =
\{\mathrm{HH},\mathrm{HT},\mathrm{TH},\mathrm{TT}\}.
$$&lt;p>样本空间中的一个点 $\omega$ 是一条完整路径。例如，$\omega=\mathrm{HT}$ 表示第一次为正面、第二次为反面。&lt;/p>
&lt;p>事件是 $\Omega$ 的一个子集，也可以理解成一个答案为“是”或“否”的问题。例如，&lt;/p>
$$
A =
\{\mathrm{HH},\mathrm{HT}\}
$$&lt;p>表示“第一次投掷得到正面”。试验结果为 $\omega$ 时，这个事件发生当且仅当 $\omega\in A$。&lt;/p>
&lt;p>集合族&lt;/p>
$$
C_1=\{\mathrm{HH},\mathrm{HT}\},
\qquad
C_2=\{\mathrm{TH},\mathrm{TT}\}
$$&lt;p>构成 $\Omega$ 的一个划分，因为 $C_1\cap C_2=\varnothing$ 且 $C_1\cup C_2=\Omega$。划分中的每一块代表观察者目前无法进一步区分的一组路径；由这些块及其并集得到的事件，代表观察者能够回答的问题。&lt;/p>
&lt;p>更一般地，一族非空集合 $(C_i)_{i\in I}$ 若满足&lt;/p>
$$
C_i\cap C_j=\varnothing
\quad (i\ne j),
\qquad
\bigcup_{i\in I}C_i=\Omega,
$$&lt;p>就称为 $\Omega$ 的一个划分。划分越细，观察者能区分的路径越多。&lt;/p>
&lt;h2 id="2-为什么需要-σ-代数">2. 为什么需要 σ-代数&lt;/h2>
&lt;p>并非任意挑选的一组事件都适合进行概率运算。如果能够讨论事件 $A$，就也应当能够讨论“$A$ 不发生”；如果能够讨论一列事件，也应当能够讨论“其中至少一个发生”。σ-代数把这些封闭性要求写成精确的集合条件。&lt;/p></description></item></channel></rss>