金融高频数据计量——理论与实证(一)

本系列以 Hautsch, N. (2011). Econometrics of financial high-frequency data. Springer Science & Business Media 为主要参考资料,作为本系列第一篇,主要介绍一下背景和概要。

这一系列同我其他技术文章的初衷一样,也是一是希望加深自己的学习,记录下研究的过程,二是希望对大家的学习有所帮助。形式上以翻译原著为主,但不求逐字逐句,同时会补充一些其他资料,最新的数据和一些我的个人见解。比如实证部分, 我会以中文读者比较关心的中国、香港和美国资本市场为例,并且将用到R的代码开源到 GitHub 上,并在最后打包发布(如果不烂尾的话 : – ))。但限于本人水平,错误难免,文中还可能会时不时的出现英文单词,其本意并非我想掉个洋书袋,而恰恰是我英文水平有限,没办法简洁而准确地翻译出来,我会尽量避免,欢迎大家指正和交流。
是一次非常偶然的机会, 宋斌教授推荐了《Econometrics of Financial High-Frequency Data》这本书给我,她作为中央财经大学投资系系主任,量化投资和高频交易也是她的研究方向之一,我自然是会对这本书特别关照,所以也就有了这个系列的文章,在此也很感谢宋老师的指导!
关于版权问题,我的文章欢迎转载,注明出处即可。但是我并没有版权方的相关授权,而且理论部分的很多篇幅会直接引用或译自书中,我不太清楚是否会造成侵权,如有侵权,请联系我,我会及时删除相关内容,希望大家购买正版书籍
以上算是前言、致谢和Copyleft的声明,下面进入正文。

交易系统的技术不断发展, 高频数据记录不断完善,以及日内交易的流行、订单执行优化等问题催生了高频计量的发展。由于高频交易创造的稳定和丰厚的利润,很多机构都开始使用高频交易,根据 Lati, R. (2009) 的数据,2009年,在美国20,000支基金中只占2%的高频基金贡献了市场73%的交易量!学术界和产业界主要关注的问题之一 就是,高频粒度的市场结构和交易过程一直在不断变化。这是由于电子交易平台的发展使得交易量、交易速度不断提升,投资者采用各种各样的交易策略、订单管理策略,以及各种策略之间的相互竞争作用、不同交易所的规则等等,这些都对高频计量的建模造成了很大的挑战。通过对交易数据和订单数据的建模,我们可以分析交易所规则对交易的影响,对交易量、波动率、订单簿深度等进行预测,寻找最优下单策略、减少市场冲击和交易成本,评估流动性和价格等风险,统计资产和市场的相关性。

区别于一般计量和统计模型的是,高频数据是不规则地分布于时间轴上,在传统计量模型上时序分析的经典理论 Box (2015), 何书元 (2003), Hamilton (1995),都是建立在采样点是均匀分布于时间轴这一假设之上,时间间隔作为trivial变量被忽略了。但实际上,市场事件(订单、交易等等)发生的间隔时间不仅携带信息而且十分重要,它可以作为市场活跃程度的度量并会影响交易价格和交易量。将这一时间特征考虑进去就是点过程Point Process),它不仅刻画了事件在时间轴上随机出现的性质,也包含了事件本身的特征、历史数据等相互之间关系。2003年诺贝尔经济学奖获得者 Robert F. Engle 在1996年首次提出了点过程的在计量模型中的重要性,他的论文 Engle (2000) 也被认为是高频计量快速发展的开端。

除此之外,价格、交易量、买卖价差等很多数据都是离散的,而非连续的。同时,大部分数据都是正值,数据之间常常是持续正相关 (positively autocorrelated, strongly persistent),在同一天表现出不同的周期性。还有就是交易过程、订单过程都是高维和复杂的动态结构。所有这些,都要求我们在传统计量基础上发展新的理论与实证方法。

本书也即本系列的文章的主要目的是对最新和最重要的高频计量方法做一个介绍,包括对市场微观结构的分析,对波动率、流动性等建模及其实现。要对高频数据进行建模,很重要的一点是要准确地刻画数据的动态特征,所以自回归条件均值 (autoregressive conditional mean) 模型会起到很大作用,其背后的思想就是将条件均值作为自回归模型。在此基础上又衍生出了MEMs (multiplicative error models) 一类模型,用于刻画交易间间隔的 ACD (autoregressive conditional duration) 模型,用于刻画计数数据的 ACP (autoregressive conditional poisson) 模型等等。这些模型都可以用于刻画高频数据的非线性动态特征、持久依赖 (long range dependence),也可以扩展到多元模型。高频计量的方法论的核心是(随机)密度函数的动态模型,这也是点过程的核心,其含义是在给定历史数据和观测变量的条件下,事件发生的频率,可以通俗地理解为条件概率。为了对高维的交易和订单的动态过程进行降维,基于因子的建模方式也十分重要。以上这些模型、应用和实证数据都会在接下来一一展开。

祝福我不要鸽!


Reference:
Box, G. E., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: forecasting and control. John Wiley & Sons.
Engle, R. F. (2000). The econometrics of ultra‐high‐frequency data. Econometrica, 68(1), 1-22.
Hamilton, J. D. (1995). Time series analysis. Economic Theory. II, Princeton University Press, USA, 625-630.
Hautsch, N. (2011). Econometrics of financial high-frequency data. Springer Science & Business Media.
Lati, R. (2009). The real story of trading software espionage. Advanced Trading.
何书元. (2003). 应用时间序列分析. 北京大学出版社.

崇祯皇帝的选择

原文作者人民大学教授张鸣,转载出处为张鸣博客(现在好像是打不开了),我第一次知道张鸣是大学时教马克思主义的老师推荐的一本《中国心绞痛》,后来陆续读到了他一些文章。这篇文章本来我是转发在朋友圈里,后来也被关进文字狱了,我觉得写得挺好,转载在这里。
当时有朋友评论这篇文章说,“一个人能力不行,还很努力,那就很可怕了”。这句话很俏皮,我觉得其实他想说的意思应该是一个人不自知能力不行,还硬上是很不可取的。结合时下的政局来看,这篇文章很有意思,可能也正因为如此,才被封了。而单就历史而言,以我的历史观,亡国之君也好,开国英雄也罢,其个人的特质自然是百万中无一,但是终究都是被历史推到前台的人。

亡国之君的下场都不怎么样,但崇祯尤其惨。但是,他的下场,跟他当初的选择,是有密切关系的。他继位之时,明王朝虽说大抵已经被蛀空,只要他选择跟着混,只要不是太过分,混到死,做一个太平皇帝,倒是也有可能的。毕竟,百足之虫死而不僵,关外的满人虽说猖狂,但一时半会儿还没有问鼎中原的意思,而内乱虽多,能成大气候的,还看不出来。但是,崇祯选择了做有为之君,要动大手术,革故鼎新。

但是,他的登基,仅仅是因为他是现任皇帝的弟弟。年仅16岁的他,此前既没有过政治阅历,也没有可能有像以往的东宫太子那样,有自己的班底。做藩王的时候,连自己的性命,都有朝不保夕之感。不是历史选择了一个贤君,而是凑巧,一个资质平平之人做了皇帝。但是,一旦做了皇帝,几个月的功夫就扳倒了权倾朝野的权宦魏忠贤,令他的人望以及个人的自信爆棚。他要动大手术,整治万历以来麻木不仁的官府,天启以来腐败而且毫无操守的官僚阶层,但却只能依靠东厂和锦衣卫这种臭名昭著的特务机构。无形中加倍地让告密的构陷更加的活跃,使得东厂和锦衣卫原本就非常腐败做事不择手段的特务机构,权势熏天。他登基17年,官员入狱者数以百计,受死者数以十计。最高层的阁臣,都有四个被干掉。内阁首辅,像走马灯似的被换。这样的反腐,这样的整治,显然没法让官僚阶层脱胎换骨,只是加剧了作为朝廷支柱的这个阶层的动荡,人心离散。

崇祯跟万历、嘉靖、天启皇帝都不一样,他很勤政,日夜操心国事,事必躬亲,在他的时代,内阁真正变成了秘书班子,朝政由他来亲自打理。但是,他不识人,没有经验,只喜欢听恭维的话,猜忌心又奇重,觉得臣子们都在蒙他,对谁都不放心。结果,干掉了一个魏忠贤,却树立起众多的魏忠贤,他跟明朝的历任皇帝一样,照样信任太监。崇祯一朝,外派的太监监军监政最多,让外面的文武大臣,都在太监的干预下,没法工作。

平心而论,崇祯朝的人才不少,不仅袁崇焕是国之干城,其余如洪承畴、卢象升、杨嗣昌、孙承宗,都是一时之杰。但是,袁崇焕最终因后金的一个拙劣的反间计而被他凌迟处死,其他人,也没有一个有好下场的。国之干城一个个地倒下,最后,李自成兵临城下,他真的成了孤家寡人。只能在一个亲信太监的陪伴下,在凄惨地在煤山吊死。

虽然说,明朝当时内有天灾导致的农民造反的,外有满人后金的崛起,但可战之兵却还是有的。最大的问题,其实是财政困难。这个财政困难,虽然因为天灾频仍而加剧,但骨子里头,还是明朝所谓基本国策导致的。朱元璋定下的规矩,凡是宗室,国家就得养着,而且高规格供养。到了崇祯时代,北方数省,单供养本省的藩王,就入不敷出。同时,为了保卫京师,京营已经膨胀到了70万人,可百无一用,空耗粮饷。只要大刀阔斧,把京营裁撤,让宗室自谋生计(高级别的宗室,都有大量的土地),财政困难自然缓解。

然而,大刀阔斧改革的崇祯,却不敢冲自家人下手,也舍不得裁撤京营,只会逼官僚加税,多摊派,甚至要官员捐款缓解军饷的危机。结果只能让原本就因为天灾而流离失所的农民雪上加霜,被官逼民反者越来越多。

说到底,崇祯只是一个思有所作为的皇帝,却同时是一个不知如何作为的皇帝,性子又刚愎自用,喜欢恭维,听不得别人的意见。屡屡犯错,却都能怪到别人头上,自己一丁点反思都没有。致死,还固执地认为,是群臣误了他。

大厦将倾,有力者想要挽回,不是不可能。但是,恰好挽回者是崇祯皇帝朱由校这样年少轻狂之辈,他所做的,不是挽回,而是加速倾倒。他不作为,明朝还能多活几年,一作为,明朝反而迅速崩塌,诱使后金计划外入关,弹指间,就取而代之。

《随机过程》勘误

随机过程》(英文电子版) 是 Sheldon M. Ross 所著,作为随机过程领域的经典力作,其第二版由龚光鲁老师翻译,翻译质量只能说是差强人意,对于英文水平较差无法参考英文原著的同学不是十分友好。我将学习过程中遇到的一些翻译错误在此一一列出,希望对大家有所帮助,也非常欢迎补充和指正。

p9 例1.3(C): 随机变量至少有一个值与其均值一样大
原文为: at least one of the possible value of a random variable must be at least as large as its mean
应译作:随机变量至少有一个值不小于其均值

p30 题1.17: 在……的第i个最小者中
原文为:among the i smallest of ……
应译作:在……的最小者的i个中

p31 题1.22: \(Var(X) = E[Var(X|Y)] + Var(E[E|Y])\)
原文为:\(Var(X) = E[Var(X|Y)] + Var(E[X|Y])\)

p31 题1.23:以a记质点……
原文为:Let \(\alpha\) denote the particle……
应译作: 以\(\alpha\)记质点……

p33 题1.43:此题应该少了一个条件\(t \geq 0\), 虽然本书和原书都没有这个条件,但当\(t < 0\)时,容易找出一个反例使该不等式不成立

p40 最后一段: ……中第k个最小值
原文为:kth smallest
应译作:……中第k小的值

p80 例3.5(C)第5行:直至投掷中出现两个反面
原文为:util two tails in a row occur
应译作:直至投掷中连续出现两个反面

p82 第4行:其中初始分布式\(Y_D(t)\)的分布
原文为:where the initial distribution is the distribution of \(Y_D(s)\)
应译作:其中初始分布式\(Y_D(s)\)的分布

p109 倒数第4行:令\(n\)趋向于0然后令\(M\)趋向\(\infty\),导致……
原文为:Let \(n\) and then \(M\) approach \(\infty\) yields
应译作:令\(n\)趋向于\(\infty\)然后令\(M\)趋向\(\infty\),导致……

p117 倒数第9行:且N是一个……停时
本书和原文此处都有错误,应该为“且B是一个……停时”

p128 第7行:则对\(j\)求和导致
原文为:then summing over \(i\) yields
应译作:则对\(i\)求和导致

p130 第2行:移动到它的叶子的概率
原文为:the probability that …. moves towards its leaf
应译作:向它的叶子移动的概率

p131 定理4.7.2第2行:此处应删去多余的\(i_1, i_2\)

p146 例5.3(A): 在群体中每个个体假定以指数率\(\lambda\)出生
原文为:each individual in the population is assumed to give birth at an exponential rate \(\lambda\)
应译作:在群体中每个个体假定以指数率\(\lambda\)生育(或生出新个体)

p156 5.5节第4行: 则极限概率为\(P_j = \lim_{i \to \infty}P_{ij}^t\)
原文为:then the limiting probabilities \(P_j = \lim_{t \to \infty}P_{ij}(t)\)
应译作:则极限概率为\(P_j = \lim_{t \to \infty}P_{ij}(t) \)

p185 鞅的更多例子(4): 那么如1.9节所示
本书和原文此处都有错误,关于期望平方误差的最小预测是在1.5节

p192 例6.3(B): 结束其空的状态
原文为: end up empty
应译作:以空的状态结束

p215 第4行: \(P\{\)迟早越过\(A\} \leq e^{-\theta A}\)
此不等式为不等式 (7.3.5),下文有所引用,本书漏标了这个记号

p215 倒数第8行: \(X_{n+1} + \sum_{i=1}^{n-1}(Y_i – X_{i+1})\)
原文为:\(X_{n+1} – \sum_{i=1}^{n-1}(Y_i – X_{i+1})\)

p217 第5行: \(S_n = \sum_{i=1}^{n}(Y_i – cY_i)\)
原文为:\(S_n = \sum_{i=1}^{n}(Y_i – cX_i)\)

p223 第18行: 与过程在时刻\(t\)以前的一切值独立
原文为: is independent of all process values before time \(s\)
应译作:与过程在时刻\(s\)以前的一切值独立

p302 3.17答案第3行: \(g = h + h * F = (h + g*F)*F_2\)
原文为:\(g = h + h * F + (h + g*F)*F_2\)

p305 4.13答案应为3.33题答案

p305 4.13答案第5行:$$\lim_{k \to \infty}\frac{\text{直至}N_k+m\text{访问}j\text{的次数}}{n}\frac{n}{N_k + m}$$
原文为:
$$\lim_{n \to \infty}\frac{\text{number of visits to } j\text{ by time }N_n + m}{n}\frac{n}{N_n + m}$$

p308 5.3答案:$$P\{N(t) \geq n\} \leq \sum_{j=n}^{\infty}e^{-Mt}\frac{M(t)^j}{j!}$$
原文为:$$P\{N(t) \geq n\} \leq \sum_{j=n}^{\infty}e^{-Mt}\frac{(Mt)^j}{j!}$$

p309 5.4答案最后1行:$$P_{ij}(t) = v_iP_{ij}t + o(t)$$
原文为:$$P_{ij}(t) = v_iP_{ij}(t) + o(t)$$

Solutions to Stochastic Processes Ch.8

随机过程-第二版》(英文电子版Sheldon M. Ross 答案整理,此书作为随机过程经典教材没有习题讲解,所以将自己的学习过程记录下来,部分习题解答参考了网络,由于来源很多,出处很多也不明确,无法一一注明,在此一并表示感谢!希望对大家有帮助,水平有限,不保证正确率,欢迎批评指正,转载请注明出处。
Solutions to Stochastic Processes Sheldon M. Ross Second Edition(pdf)
Since there is no official solution manual for this book, I
handcrafted the solutions by myself. Some solutions were referred from web, most copyright of which are implicit, can’t be listed clearly. Many thanks to those authors! Hope these solutions be helpful, but No Correctness or Accuracy Guaranteed. Comments are welcomed. Excerpts and links may be used, provided that full and clear credit is given.

In Problem 8.1, 8.2 and 8.3, let \(\{X(t), t \geq 0\}\) denote a Brownian motion process.

8.1 Let \(Y(t) = tX(1/t)\).
(a) What is distribution of \(Y(t)\)?
(b) Compute \(Cov(Y(s), Y(t)\)
(c) Argue that \(\{Y(t), t \geq 0\}\) is also Brownian motion
(d) Let \(T = inf\{t>0: X(t)=0\}\). Using (c) present an argument that \(P\{T = 0\} = 1\).


(a) \(X(1/t) \sim N(0, 1/t)\) then \(Y(t) = tX(1/t) \sim N(0, t)\)
(b) $$\begin{align}
Cov(Y(s), Y(t)) &= Cov(sX(1/s), tX(1/t)) \\
&= st\cdot Cov(X(1/s), X(1/t)) \\
&= st\cdot min(1/s, 1/t) = min(s, t) \end{align}$$
(c) Since \(\{X(t)\}\) is a Gaussian process so is \(\{Y(t)\}\). Further from parts (a) and (b) above \(\{Y(t)\}\) is a Brownian motion.
(d) Since \(Y(t)\) is Brownian motion then \(T_1 \equiv sup\{t: Y(t) = 0\} = \infty\) with probability 1. Note \(\{T = 0\} = \{T_1 = \infty\}\). Thus, \(P\{T = 0\} = 1\)


8.2 Let \(W(t) = X(a^2t)/a\) for \(a > 0\). Verify that \(W(t)\) is also Brownian motion.


\(W(0) = X(0)/a = 0\). Non-overlapping increments of \(W(t)\) map to non-overlapping increments of \(X(t)\). Thus increments of \(W(t)\) are independent. Further, for \(s < t\),
$$W(t) – W(s) = \frac{X(a^2t) – X(a^2s)}{a} \sim N(0, t-s)$$
Thus \(W(t)\) has stationary increments with required distribution. Therefore, \(W(t)\) is a Brownian motion.


8.5 A stochastic process \(\{X(t), t \geq 0\}\) is said to be stationary if \(X(t_1), \dots, X(t_n)\) has the same joint distribution as \(X(t_1+a), \dots, X(t_n +a)\) for all \(n, a, t_1, \dots, t_n\).
(a) Prove that a necessary and sufficient condition for a Gaussian process to be stationary is that \(Cov(X(s), X(t))\) depends only on \(t-s, s \leq t\), and \(E[X(t)] = c\).
(b) Let \(\{X(t), t \geq 0\}\) be Brownian motion and define
$$V(t) = e^{-\alpha t/2}X(\alpha e^{\alpha t})$$
Show that \(\{V(t), t \geq 0\}\) is a stationary Gaussian process. It is called Ornstein-Uhlenbeck process.


(a) If the Gaussian process is stationary then for \(t > s, (X(t), X(s))\) and \((X(t-s), X(0))\) have same distribution. Thus, \(E[X(s)] = E[X(0)]\) for all \(s\) and \(Cov(X(t), X(s)) = Cov(X(t-s), X(0))\), for all \(t < s\). Now, assume \(E[X(t)] = c\) and \(Cov(X(t), X(s)) = h(t-s)\). For any \(T = (t_1, \dots, t_k)\) define vector \(X_T \equiv (X(t_1), \dots, X(t_k))\). Let \(\tilde{T} = (t_1-a, \dots, t_k -a)\). If \(\{X(t)\}\) is a Gaussian process then both \(X_T\) and \(X_{\tilde{T}}\) are multivariate normal and it suffices to show that they have the same mean and covariance. This follows directly from the fact that they have the same element-wise mean \(c\) and the equal pair-wise covariances, \(Cov(X(t_i-a), X(t_j -a)) = h(t_i-t_j) = Cov(X(t_i), X(t_j))\)
(b) Since all finite dimensional distributions of \(\{V(t)\}\) are normal, it is a Gaussian process. Thus from part (a) is suffices to show the following:
(i) \(E[V(t)] = e^{-at/2}E[X(\alpha e^{\alpha t})] = 0\). Thus \(E[V(t)]\) is constant.
(ii) For \(s \leq t\), $$\begin{align}
Cov(V(s), V(t)) &= e^{-\alpha(t+s)/2}Cov(X(\alpha e^{\alpha s}), X(\alpha e^{\alpha t}))\\
&= e^{-\alpha(t+s)/2}\alpha e^{\alpha s} = \alpha e^{-\alpha(t-s)/2} \end{align}$$
which depends only on \(t-s\).


8.8 Suppose \(X(1) = B\). Characterize, in the manner of Proposition 8.1.1, \(\{X(t), 0 \leq t \leq 1\}\) given that \(X(1) = B\).


Condition on \(X(1) = B, X(t) \sim N(Bt, t(1-t))\), then \(Z(t) \sim N(0, t(1-t))\) which is a Brownian motion.


8.9 Let \(M(t) = max_{0 \leq s \leq t} X(s)\) and show that
$$P\{M(t) > a| M(t) = X(t)\} = e^{-a^2/2t}, \quad a > 0$$


From Section 8.3.1, we get
$$P\{M(t) > y, X(t) < x\} = \int_{2y-x}^{\infty}\frac{1}{\sqrt{2\pi t}}e^{-u^2/2t}du $$
By using Jacobian formula, we can derive the density function of \(M(t)\) and \(W(t) = M(t) – X(t)\), which we denote by \(f_{MW}\). Thus
$$f_W(w) = 2\int_0^{\infty}f_{MW}(m, w)dm \\
P\{M(t) > a | W(t) = 0\} = 1 – \int_0^a \frac{f_{MW}(m, 0)}{f_W(0)}dm$$
The last equation can be computed, which equal \(e^{-a^2/2t}\)


8.10 Compute the density function of \(T_x\), the time until Brownian motion hits \(x\).


$$\begin{align}
f_{T_x}(t) &= F_{T_x}^{\prime}(t) = (\frac{2}{\sqrt{2\pi}}\int_{|x|/\sqrt{t}}^{\infty}e^{-y^2/2}dy)^{\prime} \\
&= -\frac{2}{\sqrt{2\pi}} \cdot e^{-x^2/2t} \cdot \frac{x}{2}t^{-3/2}\\
&= -\frac{x}{\sqrt{2\pi}}e^{-x^2/2t}t^{-3/2}
\end{align}$$


8.11 Let \(T_1\) denote the largest zero of \(X(t)\) that is less than \(t\) and let \(T_2\) be the smallest zero greater than \(t\). Show that
(a) \(P\{T_2 < s\} = (2/\pi)\arccos\sqrt{t/s}, s> t\).
(b) \(P\{T_1 < s, T_2 > y\} = (2/\pi)\arcsin\sqrt{s/y}, s < t< y\).


(a) $$\begin{align}
P\{T_2 < s\} &= 1 – P\{\text{no zeros in } (t, s)\} \\
&= 1 – \frac{2}{\pi}\arcsin\sqrt{t/s} \\
&= (2/\pi)\arccos\sqrt{t/s} \end{align}$$
(b) \(P\{T_1 < s, T_2 > y\} = P\{\text{no zeros in } (s, y)\} = \frac{2}{\pi}\arcsin\sqrt{s/y}\)


8.12 Verify the formulas given in (8.3.4) for the mean and variance of \(|X(t)|\).


$$f_Z(y) = (\frac{2}{\sqrt{2\pi t}}\int_{-\infty}^y e^{-x^2/2t}dx – 1)^{\prime} = \frac{2}{\sqrt{2\pi t}}e^{-y^2/2t}\\
E[Z(t)] = \int_{0}^{\infty}yf_Z(y)dy = -\frac{2t}{\sqrt{2\pi t}}e^{-y^2/2t}|_0^{\infty} = \sqrt{2t/\pi} \\
Var(Z(t)) = E[Z^2(t)] – E^2[Z(t)] = E[X^2(t)] – E^2[Z(t)] = (1 – \frac{2}{\pi})t$$


8.13 For Brownian motion with drift coefficient \(\mu\), show that for \(x>0\)
$$P\{max_{0 \leq s \leq h} |X(s)| > x\} = o(h).$$



8.18 Let \(\{X(t), t \geq 0\}\) be a Brownian motion with drift coefficient \(\mu, \mu < 0\), which is not allowed to become negative. Find the limiting distribution of \(X(t)\).



8.19 Consider Brownian motion with reflecting barriers of \(-B\) and \(A, A >0, B > 0\). Let \(p_t(x)\) denote the density function of \(X_t\).
(a) Compute a differential equation satisfied by \(p_t(x)\).
(b) Obtain \(p(x) = \lim_{t \to \infty} p_t(x)\).



8.20 Prove that, with probability 1, for Brownian motion with drift \(\mu\).
$$\frac{X(t)}{t} \to \mu, \quad \text{ as } t \to \infty$$



8.21 Verify that if \(\{B(t), t \geq 0\}\) is standard Brownian motion then \(\{Y(t), t \geq 0\}\) is a martingale with mean 1, when \(Y(t) = exp\{cB(t) – c^2t/2\}\)


$$\begin{align}
E[Y(t)] &= \int_{-\infty}^{\infty} exp\{cx – c^2t/2\}\frac{1}{\sqrt{2\pi t}}exp\{-x^2/2t\}dx\\
&= \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi t}}exp\{-(x-ct)^2/2t\}dx = 1 \end{align}$$ $$\begin{align}
E[Y(t)|Y(u), 0 \leq u \leq s] &= Y(s) + E[Y(t) – Y(s)|Y(u), 0 \leq u \leq s ]\\
&= Y(s) \cdot E[exp\{c(B(t) – B(s)) – c^2(t-s)/2\}] \\
&= Y(s) \cdot E[Y(t-s)] = Y(s)
\end{align}$$


8.22 In Problem 8.16, find \(Var(T_a)\) by using a martingale argument.



8.23 Show that
$$p(x,t;y) \equiv \frac{1}{\sqrt{2\pi t}}e^{-(x – y – \mu t)^2/2t}$$
satisfies the backward and forward diffusion. Equations (8.5.1) and (8.5.2)


Just do it : )


8.24 Verify Equation (8.7.2)


Let \(f(s, y) = [\phi(se^{-\alpha y}) – 1]dy\), then
$$\begin{align}
E[X(t)] &=\frac{d}{ds}E[exp\{sX(t)\}]|_{s=0} \\
&= exp\{\lambda\int_0^t f(0, y)dy\} \lambda \int_0^t \frac{d}{ds}f(s, y)|_{s=0} dy \\
&= \lambda E[X](1 – e^{-\alpha t})/\alpha\\
Var(X(t)) &= E[X^2(t)] – E^2[X(t)] \\
&= \frac{d^2}{ds^2}E[exp\{sX(t)\}]|_{s=0} – E^2[X(t)] \\
&= \lambda E[X^2](1 – e^{-2\alpha t})/2\alpha
\end{align}$$


8.25 Verify that \(\{X(t) = N(t + L) – N(t), t \geq 0\}\) is stationary when \(\{N(t)\}\) is a Poisson process.


For any \(t, X(t) = N(t + L) – N(t) = N(L)\), thus
$$E[X(t)] = E[N(L)] = \lambda L\\
Cov(X(t), X(t+s)) = Var(N(L)) = \lambda L$$


8.26 Let \(U\) be uniformly distributed over \((-\pi, \pi)\), and let \(X_n = cos(nU)\). By using trigonometric identity
$$\cos x \cos y = \frac{1}{2} [\cos(x+y) + \cos(x-y)]$$
verify that \(\{X_n, n \geq 1\}\) is a second-order stationary process.


$$\begin{align}
E[X_n] &= \frac{1}{n\pi}\int_{-n\pi}^{n\pi} \cos xdx = 0\\
Cov(X_{n+L}, X_n) &= E[X_{n+L}X_n] – E[X_{n+L}]E[X_n] \\
&= \frac{1}{2}E[X_{2n+L} + X_L] = 0
\end{align}$$


8.27 Show that
$$\sum_{i=1}^n \frac{R(i)}{n} \to 0 \quad \text{implies} \quad {\sum\sum}_{i < j < n}\frac{R(j-i)}{n^2} \to 0$$
thus completing the proof of Proposition 8.8.1



8.28 Prove the Cauchy-Schwarz inequality:
$$(E[XY])^2 \leq E[X^2]E[Y^2]$$
(Hint: Start with the inequality \(2|xy| \leq x^2 + y^2\) and then substitute \(X/\sqrt{E[X^2]}\) for \(x\) and \(Y/\sqrt{E[Y^2]}\) for \(y\))


Since \(2xy \leq x^2 + y^2\), then
$$\begin{align}
2\frac{X}{\sqrt{E[X^2]}}\frac{Y}{\sqrt{E[Y^2]}} &\leq \frac{X^2}{E[X^2]} + \frac{Y^2}{E[Y^2]} \\
E[2\frac{X}{\sqrt{E[X^2]}}\frac{Y}{\sqrt{E[Y^2]}}] &\leq E[\frac{X^2}{E[X^2]} + \frac{Y^2}{E[Y^2]}]\\
2\frac{E[XY]}{\sqrt{E[X^2]E[Y^2]}} &\leq 2\\
(E[XY])^2 &\leq E[X^2]E[Y^2] \end{align}$$


8.29 For a second-order stationary process with mean \(\mu\) for which \(\sum_{i=0}^{n-1}R(i)/n \to 0\), show that for any \(\varepsilon > 0\)
$$\sum_{i=0}^{n-1}P\{|\bar{X_n} – \mu| > \varepsilon \} \to 0 \quad \text{as } n \to \infty$$




Solutions to Stochastic Processes Ch.7

随机过程-第二版》(英文电子版Sheldon M. Ross 答案整理,此书作为随机过程经典教材没有习题讲解,所以将自己的学习过程记录下来,部分习题解答参考了网络,由于来源很多,出处很多也不明确,无法一一注明,在此一并表示感谢!希望对大家有帮助,水平有限,不保证正确率,欢迎批评指正,转载请注明出处。
Solutions to Stochastic Processes Sheldon M. Ross Second Edition(pdf)
Since there is no official solution manual for this book, I
handcrafted the solutions by myself. Some solutions were referred from web, most copyright of which are implicit, can’t be listed clearly. Many thanks to those authors! Hope these solutions be helpful, but No Correctness or Accuracy Guaranteed. Comments are welcomed. Excerpts and links may be used, provided that full and clear credit is given.

7.1 Consider the following model for the flow of water in and out of a dam. Suppose that, during day \(n, Y_n\) units of water flow into the dam from outside sources such as rainfall and river flow. At the end of each day, water is released from the dam according to the following rule: If the water content of the dam is greater than \(a\), then the amount of \(a\) is released. If it is less than or equal to \(a\), then the total contents of the dam are released. The capacity of the dam is \(C\), and once at capacity any additional water that attempts to enter the dam is assumed lost. Thus, for instance, if the water level at the beginning of day \(n\) is \(x\), then the level at the end of the day (before any water is released) is \(min(x + Y_n, C)\). Let \(S_n\) denote the amount of water in the dam immediately after the water been released at the end of day \(n\). Assuming that the \(Y_n, n \geq 1\), are independent and identically distributed, show that \(\{S_n, n \geq 1\}\) is a random walk with reflecting barriers at 0 and \(C-a\).



7.2 Let \(X_1, \dots, X_n\) be equally likely to be any of the \(n!\) permutations of \((1,2,\dots, n)\). Argue that,
$$P\{\sum_{j=1}^njX_j \leq a\} = P\{\sum_{j=1}^njX_j\geq n(n+1)^2/2 -a\}$$


$$\begin{align}
P\{\sum_{j=1}^njX_j \leq a \} &= P\{nS_n – \sum_{i=1}^{n-1}S_i \leq a\} \\
&= P\{\sum_{i=1}^nS_i \geq (n+1)S_n – a\} \\
&= P\{\sum_{j=1}^njX_j\geq n(n+1)^2/2 -a\} \end{align}$$


7.3 For the simple random walk compute the expected number of visits to state \(k\).


Suppose \(p \geq 1/2\), and starting at state \(i\). When \(i \leq k\),
$$p_{ik} = 1 \\
f_{kk} = 2 -2p\\
E = 1 + \frac{1}{2p – 1}$$
When \(i > k\)
$$p_{ik} = (\frac{1-p}{p})^{i – k}\\
f_{kk} = 2 – 2p\\
E = p_{ik}(1 + \frac{1}{2p-1})$$


7.4 Let \(X_1, X_2, \dots, X_n\) be exchangeable. Compute \(E[X_1|X_{(1)}, X_{(2)}, \dots, X_{(n)}]\), where \(X_{(1)} \leq X_{(2)} \leq \dots \leq X_{(n)}\) are the \(X_i\) in ordered arrangement.


Since \(X_i\) is exchangeable, \(X_1\) can be any of \(X_{(i)}\) with equal probability. Thus,
$$E[X_1|X_{(1)}, X_{(2)}, \dots, X_{(n)}] = \frac{1}{n}\sum_{i=1}^nX_{(i)}$$


7.6 An ordinary deck of cards is randomly shuffled and then the cards are exposed one at a time. At some time before all the cards have been exposed you must say “next”, and if the next card exposed is a spade then you win and if not then you lose. For any strategy, show that at the moment you call “next” the conditional probability that you win is equal to the conditional probability that the last card is spade. Conclude from this that the probability of winning is 1/4 for all strategies.


Let \(X_n\) indicate if the nth card is a spade and \(Z_n\) be the proportion of spades in the remaining cards after the \(n\) card. Thus \(E|Z_n| < \infty\) and
$$E[Z_{n+1}|Z_1, \dots , Z_n] = \frac{(52 -n)Z_n – 1}{52 -n-1}Z_n + \frac{(52-n)Z_n}{52-n-1}(1 – Z_n) = Z_n$$
Hence \(Z_n\) is a martingale.
Note that \(X_52 = Z_51\). Thus
$$\begin{align}
E[X_{n+1}|X_1, \dots, X_n]&= E[X_{n+1}|Z_1, \dots, Z_n] = Z_n\\
&= E[Z_51|Z_1, \dots, Z_n] = E[X_52|X_1, \dots, X_n]
\end{align}$$
Finally, let \(N\) be the stopping time corresponding to saying “next” for a given strategy.
$$\begin{align}
P\{\text{Win}\} &= E[X_{N+1}] = E[E[X_{N+1}|N]] \\
&= E[Z_N] = E[Z_1] = 1/4
\end{align}$$


7.7 Argue that the random walk for which \(X_i\) only assumes the values \(0, \pm 1, \dots, \pm M\) and \(E[X_i] = 0\) is null recurrent.



7.8 Let \(S_n, n \geq 0\) denote a random walk for which
$$\mu = E[S_{n+1} – S_n] \neq 0$$
Let, for \(A >0, B > 0\),
$$N = min\{n: S_n \geq A \text{ or } S_n \leq -B\}$$
Show that \(E[N] < \infty\). (Hint: Argue that there exists a value \(k\) such that \(P\{S_k > A +B\} > 0\). Then show that \(E[N] \leq kE[G]\), where \(G\) is an appropriately defined geometric random variable.)


Suppose \(\mu > 0\), and let \(k > (A+B)/\mu\), then
$$\begin{align}
k\mu – A -B &= E[S_k – A – B] \\
&= E[S_k – A – B|S_k > A + B]P\{S_k > A+B\} \\&+ E[S_k – A – B|S_k \leq A + B]P\{S_k \leq A+B\}\\
&\leq E[S_k – A – B|S_k > A + B]P\{S_k > A+B\}
\end{align}$$ Thus, there exists \(k > (A+B)/\mu, p = P\{S_k > A +B\} > 0\). Let \(Y_i = \sum_{j = ik+1}^{(i+1)k} X_j\), then \(P\{Y_i > A + B\} = p\). And it’s obviously that if any of \(Y_i\) exceeds \(A+B\), \(S_N\) occurs. Hence, \(E[N] \leq k/p\)


7.10 In the insurance ruin problem of Section 7.4 explain why the company will eventually be ruined with probability 1 if \(E[Y] \geq cE[X]\).



7.11 In the ruin problem of Section 7.4 let \(F\) denote the interarrival distribution of claims and let \(G\) be the distribution of the size of a claim. Show that \(p(A)\), the probability that a company starting with \(A\) units of assets is ever ruined, satifies
$$p(A) = \int_0^{\infty}\int_0^{A + ct}p(A + ct -x)dG(x)dF(t) + \int_0^{\infty}\bar{G}(A+ct)dF(t)$$


Condition on the first claim, then
$$\begin{align}
p(A) &= P\{\text{ruined at first claim}\} + P\{\text{ruined after first claim}\} \\
&= \int_0^{\infty}\bar{G}(A+ct)dF(t) + \int_0^{\infty}\int_0^{A + ct}p(A + ct -x)dG(x)dF(t)
\end{align}$$


7.12 For a random walk with \(\mu = E[X] > 0\) argue that, with probability 1,
$$\frac{u(t)}{t} \to \frac{1}{\mu} \quad \text{as } t \to \infty$$
where \(u(t)\) equals the number of \(n\) for which \(0 \leq S_n \leq t\).



7.13 Let \(S_n = \sum_{i=1}^n X_i\) be a random walk and let \(\lambda_i, i > 0\), denote the probability that a ladder height equals \(i\) — that is, \(\lambda_i = P\){first positive value of \(S_n\) equals \(i\)}.
(a) Show that if
$$P\{X_i = j\} = \left\{\begin{array}{ll}
q \quad j = -1 \\
\alpha_j \quad j \geq 1 \\ \end{array}\right. \\
q + \sum_{j=1}^{\infty} \alpha_j = 1$$
then \(\lambda_i\) satisfies
$$\lambda_i = \alpha_i + q(\lambda_{i+1} + \lambda_1\lambda_i) \quad i > 0$$
(b) If \(P\{X_i = j\} = 1/5, j = -2,-1,0,1,2\), show that
$$\lambda_1 = \frac{1+\sqrt{5}}{3+\sqrt{5}} \quad \lambda_2 = \frac{2}{3+\sqrt{5}} $$



7.14 Let \(S_n, n\geq 0\), denote a random walk in which \(X_i\) has distribution \(F\). Let \(G(t,s)\) denote the probability that the first value of \(S_n\) that exceeds \(t\) is less than or equal to \(t+s\). That is,
$$G(t,s) = P\{\text{first sum exceeding } t \text{ is } \leq t+s\}$$
Show that
$$G(t, s) = F(t + s) – F(t) + \int_{-\infty}^t G(t-y, s)dF(y)$$


\(S_n|X_1\) is distributed as \(X_1 + S_{n-1}\). Thus if \(A\)={first sum exceeding \(t\) is \(\leq t + s\)},
$$\begin{align}
G(t,s) &\equiv P\{A\} = E[P\{A|X_1\}] \\
&= F(t+s) – F(t) + \int_{-\infty}^t G(t-y, s)dF(y)
\end{align}$$