⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simu_b_m.asv

📁 用于随机模拟
💻 ASV
字号:
%simulation of brown motion:b(t)
c=1;
N=2^10;
T=1;
b=bm(c,T,N);

% simulation of s(t)
s0=10;
sigma=0.3;
r=0.05;
for i=1:n
    s(i)=s0+r*T+sigma*b(i);
end
figure(2);
plot([s0,s])
grid
xlabel('t');
ylabel('s(t)');
title('s(t)')

%simulation of positive s(t)
sp=zeros(1,n);    %positive of s
for i=1:n
    sp(i)=s0*exp((r-1/2*sigma^2)*t(i)+sigma*b(i));
end
figure(3);
plot([s0,sp])

%simulation of positive s(t) m times
m=10;
spm=zeros(m,n);    %positive of s mant times

for i=1:m
    for j=1:n
        spm(i,j)=s0*exp((r-1/2*sigma^2)*t(j)+sigma*b(j));
    end
end



figure(3);
plot([s0,sp(1,:)])
%plot([s0*ones(m,1),sp]')






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -