【问题标题】:Option pricing using Monte Carlo Simulation + Brownian Bridge使用蒙特卡洛模拟 + 布朗桥的期权定价
【发布时间】:2020-01-12 20:15:42
【问题描述】:

我试图在 Matlab 中估算欧式看涨期权的价格。使用Black-Scholes 计算的确切值将是 6.89。我正在使用带有布朗桥的蒙特卡罗模拟来加快收敛速度​​。不幸的是,与我的代码近似的价格太高了(它总是在 120 左右),我看不出我的代码有问题。请在下面找到代码。如果有人可以帮助我解决我的问题,我将非常感激!

最佳雅尼斯

P.S.:输入参数“Pfade”是指模拟的布朗桥路径的数量。如果您需要更多信息,请告诉我,我是 MC-Simulation 和 Matlab 的新手!

function P=eurocallprice_QMC_BBD(S0,K,r,T,sigma,n,Pfade)
dt=T/n;
timestep=[0:dt:T]';
Wt=zeros(n+1,Pfade);
%Simulate the Brownian motion at T:
eY = randn(1,Pfade);
Wt(n+1,:)= sqrt(T).*eY;
%Simulate the Brownian motion W(t):
for j=2:n
  deltat1=(n+1-j)/(n+1-j+1);
  eYt = randn(1,Pfade);
  Wt(j,:)=deltat1*Wt(j-1,:)+(1-deltat1)*Wt(n+1,:)+sqrt(deltat1*dt)*eYt;
end
BB=Wt;
plot(BB)
SPaths = zeros(n+1, Pfade);
SPaths(1, :) = S0;
for i = 1:n+1
  SPaths(i + 1, :) = SPaths(i,:) .* (1 + r * dt + sigma * BB(i,:));
end
Payoff = zeros(Pfade,1);
Payoff = max(0, SPaths(n+1,:) - K);
P = exp(-r*T) * mean(Payoff);
end

【问题讨论】:

  • 如果您能提供一个示例,说明您对eurocallprice_QMC_BBD 的输入是什么以及您认为它们代表什么,那将会很有帮助。 stackoverflow.com/help/minimal-reproducible-example
  • 您好,感谢您的回复。 S0(t = 0 时的股票价格)= 100。K(执行价格)= 100。r(无风险利率)= 0.05。 T(成熟度)= 1。 sigma(波动率)= 0.2。 Pfade(布朗桥路径数)= 9000。
  • n 用的是什么?您能否提供一个指向您正在使用的 Black-Scholes 公式的指针(我在您的帖子中添加了 Wikipedia 链接,但即使这样也有一些变体)?
  • 我使用的是 n = 32。
  • 我使用这个网站上的计算器来计算布莱克-斯科尔斯值:mystockoptions.com/…

标签: matlab options montecarlo


【解决方案1】:

确切的解决方案:

使用链接的维基百科页面上的公式:

% Dummy parameter
S0    = 100  % Stock  price 
K     = 100  % Strike price
sigma = 0.2  % Volatility
T     = 0.5  % Maturity
r     = 0.05 % risk free rate

% Application of the formula
N  = @(x) 0.5*(erf(x/sqrt(2))+1)                        %The normal cumulative distribution (with a mean = 0)
d1 = (1/(sigma*T^0.5))*(log(S0/K)+(r+(sigma^2/2))*T)   
d2 = d1-sigma*T^0.5
PV = K*exp(-r*T)
C  = N(d1)*S0 - N(d2)*PV                                %Call price
P  = PV*(1-N(d2))-S0*(1-N(d1))                          %Put  price

我们得到了

C = 6.89

您的布朗路径可以替换为正态累积分布(当布朗路径的数量趋于无限时,应该给出相同的结果)

顺便说一句,我现在有点害怕我们使用布朗路径来了解股票的运作方式。

蒙特卡罗模拟:

我不明白您尝试做什么,因为您的代码中几乎没有 cmets。但是如果只需要上面代码的模拟版本,你可以使用:

% Dummy parameter
S0    = 100  % Stock  price 
K     = 100  % Strike price
sigma = 0.2  % Volatility
T     = 0.5  % Maturity
r     = 0.05 % risk free rate
n     = 100000 % simulation length

rsim    = normrnd(0,1,1,n); %random normal number (mu = 1, sigma = 0).
var     = S0*exp(T*(r-0.5*sigma^2)+sigma*T^0.5*rsim)-K; % variation to price reference (as far as I understand the wikipedia article)
average = sum(max(var,0))/n; %average including the brownian bridge stuff where var<0 = 0
P       = exp(-r*T)*average %Put price
C       = %I let you find how to get the call price ;)

【讨论】:

  • 谢谢,但我不需要代码来计算选项的确切值。我想通过使用布朗桥模拟股票价格路径的蒙特卡罗模拟来近似精确值。理想情况下,我的函数的输出应该是非常接近精确值的值。现在不是这种情况,这就是我在这里寻求帮助的原因。编辑:我理解您对正态累积分布的建议,但我的教授希望我使用布朗桥模拟。
  • 检查我的编辑,您不需要计算中间值(随机游走),这是浪费计算时间和内存。我们可以直接计算时间T的随机值。
猜你喜欢
  • 2013-02-06
  • 2013-01-27
  • 1970-01-01
  • 2021-01-06
  • 1970-01-01
  • 2020-08-25
  • 2013-03-10
  • 2018-09-24
  • 2018-04-03
相关资源
最近更新 更多