ciaran1996doyle

5 Reputation

One Badge

6 years, 167 days

MaplePrimes Activity


These are replies submitted by ciaran1996doyle

@tomleslie 

Hi Tom 

Thanks for your reply

I have altered the code but I am still getting a messy output. What do you think?

implicit(12).mw

@Carl Love 

Thank you Carl.

I am now trying to adapt my code for the implicit finite difference method but I am running an error. I think the problem is at "for i from N-1 to 0 by -1 do for j from 1 to M-1 do f[i+1,j]:= a[j]*f[i,j-1] + b[j]*f[i,j] + c[j]*f[i,j+1]" . Can you spot where I am going wrong? I am using equation (20.27) in the book on page 458.

implicit(11).mw

explicit(11)maple.mw

I am trying to price a call option.The code attached gives me the Expected payoffs i.e. max[j*deltaX-K,0] and the value for a,b and c.

But the code is not valuing the option with the formula f[i, j] := a[j]*f[i+1, j-1]+b[j]*f[i+1, j]+c[j]*f[i+1, j+1]

See page 459 in the link below

https://shamit8.files.wordpress.com/2014/11/options-futures-and-other-derivatives-8th-john.pdf 

Page 1 of 1