MTH 500 Midterm: MATLAB Problem Solution Stochastic Processes

300 views3 pages

Document Summary

% intial s0 initial stock price : guess. N = 0; n1=0; n2=0; n3=0; n4=0; n5=0; for n = 1 : 5. S = [100]; %st array currents = 1; %keeps track of all the s"s. = [0]; % bt array currentb = 1; % keeps track of all the b"s deltab = 0; %intialization for i = 1 : t gen = -1; %generates b values between 0 and 1 while ( gen < 0 || gen > 1) % generates numbers until meets criteria gen = normrnd(mu,sigma); %returns rand val end. = [b,gen]; % array of bs currentb = currentb+1;% keeps track of current b deltab = b(currentb) - b(currentb-1); %deltab = T = 1; %end time equals 1 n = 10; %number of steps dt = t/n; %step size. B=[0]; z = 0; %initial z value currentz = 1; for k = 0:0. 1:1 z=[z,normrnd(0,dt)]; %generate random number based on normal distribution currentz = currentz+1;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers