Serving the Quantitative Finance Community

 
User avatar
Dino
Topic Author
Posts: 0
Joined: March 29th, 2002, 9:22 am

gamma in matlab

March 29th, 2002, 9:41 am

Hi everyone!
Could someone help me to solve a matlab problem?

I have to calculate the sign of gamma parameter of an assigned combined position of call/put options using finite difference method by matlab code, but in a simple case as european call the output show me some negative elements of the vector result.
I think it could depend on the the choice of constant timestep. Any idea? How can i generate a matlab code for an adjusted timestep?
Thank u everyone!
 
User avatar
Athletico
Posts: 14
Joined: January 7th, 2002, 4:17 pm

gamma in matlab

March 29th, 2002, 7:50 pm

Could you post the set of call/put options, plus any other relevant info (eg vol)?
 
User avatar
Dino
Topic Author
Posts: 0
Joined: March 29th, 2002, 9:22 am

gamma in matlab

March 30th, 2002, 7:42 am

To athletico

In my program u can choose how many call/put u want in short or long position, then u write the matrix of prices, where the last column is the payoff and the first and last row the boundary conditions. The volatility is constant and so interest rate and all contracts have the same expiry date.
I solve by an implicit method the linear system in which appear a tridiagonal matrix using LU decomposition or eventually SOR.
Now the first column rappresent the vector of price at time=0. Taking in account just an european call and applying the classical discretization of second derivate i aspect to find nothing but positive elements.
Unluckily an half of my vector has negative elements and it could depends on the -2*A(i,j) term in approximation.
If u want i can send u by email the code.
Thank u.
 
User avatar
Athletico
Posts: 14
Joined: January 7th, 2002, 4:17 pm

gamma in matlab

March 30th, 2002, 3:25 pm

Dino,

Sure I'll take a look at the code. Also pls include at least one numerical example (S_0, K, r, tau, and sigma) where you are calcing bad #'s. If you could say something about the upper & lower boundary conditions you are imposing that'd be good too (for instance I use 2nd deriv of V w.r.t. S -> 0 as S -> inf).