Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Financial Mathematics I : Q2) Write a program to implement explicit and implicit

ID: 3803654 • Letter: F

Question

Financial Mathematics I:

Q2) Write a program to implement explicit and implicit finite difference methods.

Financial Mathematics I: options, futures and other derivatives (9th edition) Chapter 17: Options on stock indices and currencies, Chapter 18: Futures options ,Chapter 21: Basic numerical procedures ,Chapter 27: More on models and numerical procedures

Use Quesrion 1 to solve The question above

q1)Design and implement a computer program to value options using a binomial/trinomial tree. You can use a programming language of your choice. Do not use Excel/VBA for this exercise. Implement appropriate switches so that the program can value European or American options, options on stocks (dividend or non-dividend paying), stock indices, currencies, and futures. Calculate the Greeks in your program. Test your program using many of the examples in the book and the assignments. Please make sure to include complete instructions for me to install the software and test your program. If I am not able to test your program I cannot grade it and give you marks.

Explanation / Answer

the transformed Black-Scholes PDE is approximated by replacing.the space derivatives with central differences at time step i rather than at i+1.
-Ci+1,j+1-Ci,j/t=1/2*²*Ci,j+1-2Ci,j+Ci,j-1/x²+Ci,j+1-Ci,j+1-Ci,j-1/2x-rCi,j..(1)
and this can be re-written as
PuCi,j+1+ PmCi,j+PdCi,j-1=Ci+1,j…….(2)
Pu=-1/2*t(²/x²+/x)
Pm=1+t*²/x²+rt
Pd=-1/2t(²/x²-/x)
Each equation (2) for j=-Nj+1,…,Nj-1 cannot be solved individually for the option values
at time step ‘i’ as they could for the explicit finite difference method. Instead, they are
considered together with the boundary conditions,
Ci,Nj –Ci,Nj-1 =u…(3)
Ci,-Nj+1 –Ci,-Nj =L …(4)
to be a system of 2Nj+1 linear equations which implicitly determine the 2Nj+1 option
values at time step i. The boundary condition parameters u and L are determined by
the type of option being valued, for example for a call we have u=Si,Nj –Si,Nj-1 …(5)
L=0…(6)
This set of equations has a special structure which is called tri-diagonal. The matrix is
zero everywhere except on the main diagonal, and lower and upper diagonals. Each
equation has two variables in common with the equation above and below.
This tri-diagonal matrix equation can be solved very efficiently. The diagonals are placed
in three separate vectors and the process will be displayed in the code that will be
attached.
But for now,beginning with the boundary condition equation j=-Nj, this equation is
rearranged to Ci,-Nj =Ci,-Nj+1 – L. …(7)
This is then substituted into the equation above (j=-Nj+1) to obtain
PuCi,-Nj+2 +PmCi,-Nj+1 +Pd(Ci,-Nj+1 – L)=Ci+1,-Nj+1…(8)
Which can be re-written as PuCi,-Nj+2 +P’mCi,-Nj+1 =p’ ….(9)
Where
P’m=Pm+ Pd …(15a)and P’=Ci+1,-Nj+1 +Pd L.
Ci,-Nj+1 =P’-PuCi,-Nj+2/P’m….(10)
Which can be substituted into the equation for j=-Nj+2 to PuCi,-Nj+3 +P’mCi,-Nj+2 =P’…(11)
Where P’m =Pm-(Pu/P’m,-Nj+1)Pd, …(12)
P’=Ci+1,-Nj+2 –(P’-Nj+1 /P’m,-Nj+1)Pd…(13)
and subscripts have been added to the p’s to indicate that they apply to the equation for
j=-Nj+1. This process of substitution can be repeated all the way up to j=Nj-1 where the
following equation is PuCi,Nj+P’mCi,Nj-1=p’ …(14)
Now using equation(10) and the boundary condition equation for j=Nj
Ci,Nj-Ci,Nj-1=u

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote