Quiz:
(1). Brownian motions: Simulate graphs of one dimensional Brownian motions, and trajectories/paths of two or three dimensional ones.
(2). Itô processes or solutions of stochastic differential equations: Simulate geometric Brownian motions, Vasicek models, and Cox-Ingersoll-Ross models.
(3). Black-Scholes-Merton model: Compute the exact value of option given by the BlackScholes-Merton formula. Perform simulations for the stock price equation under the risk-neutral probability measure. Then compute the corresponding expectation/mean/average of the discounted option payoff at the expiration time to obtain numerical solutions, i.e., approximate values of option. As the number of simulations increase, demonstrate the convergence of the numerical solutions to the exact value.
知识1process🐕
Q1代码实现
% Brownian motion in MATLAB
T=1
N=100
t=T/N
Z0=0
Z=zeros(1,N)
Z(1)=randn*sqrt(t)
for j=2:N
Z(j)=Z(j-1)+randn*sqrt(t)
end
plot((0:t:T),[Z0,Z])
ylabel('w(t)')
xlabel('t')
完整代码(MATLAB)需要分开运行,便于展示放在一个f 文件。
t0=1
tf=11
dt=0.1
[t,w]= BM1(t0,tf,dt)
plot(t,w);
xlabel('t');ylabel('w')
title('1-dimensional B-M')
x0=0;xf=10;dt=0.1;
y0=0;yf=10
z0=0;zf=10

该博客主要介绍了如何使用MATLAB进行金融量化分析,包括模拟一维和多维布朗运动、伊藤过程(如几何布朗运动、Vasicek模型、Cox-Ingersoll-Ross模型)以及应用Black-Scholes-Merton模型计算期权价值。通过代码实现展示了数值解的收敛性,随着模拟次数增加,数值解逐渐接近精确值。




被折叠的 条评论
为什么被折叠?



