For those who love a challenge.

조회 수: 2 (최근 30일)
Charlene
Charlene 2013년 5월 8일
Let St be the price of one share of a particular company at time t. If the price St+1 at time t+1 can either take the value of uSt with probability p1 (where u>1), remain the same with probability p2 or go down to dSt with probability 1-p1-p2 (where 0<d<1), create a Matlab function called ... that simulates {St} from t=0 to t=20 for given u,d,p1 and p2 and plots St against t. Hence, by counting the number of paths; calculate the probability that S6=S0(u^2)(d^3)
using the command RAND
  댓글 수: 2
Image Analyst
Image Analyst 2013년 5월 8일
Do you have a question? I have one: is this your homework assignment? Either way, you need to ask a specific and direct question. Don't leave it up to us to assume/guess what you want.
Randy Souza
Randy Souza 2013년 5월 24일
I have restored the original text of this question.
@Charlene: this question an accepted answer, so it may be valuable to someone else in the future. If you have a good reason why it should be removed from MATLAB Answers, please flag the question, explain why it should be deleted, and an administrator or high-reputation contributor will consider deleting the question. Please do not simply edit your question away.

댓글을 달려면 로그인하십시오.

채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 5월 8일
hi Charlene , here is an initiation :
u=1.33;
d=0.75;
p1=0.44;
p2=0.25;
p3=1-p1-p2;
t=0:1:20;
St=zeros(size(t));
St(1)=400; % S(t=0)=S0
for n=1:length(t)-1
r=rand(1); % ~(Uniform)
if r>p3 && r<p2
St(n+1)=d*St(n);
elseif r>p2 && r<p1
St(n+1)=St(n);
elseif r>p1
St(n+1)=u*St(n);
end
end
figure, plot(t,St), xlabel('time (DISCRET)'), ylabel(' PRICE in $');
  댓글 수: 1
José-Luis
José-Luis 2013년 5월 24일
Please do not post complete answers to homework questions.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by