SERVING THE QUANTITATIVE FINANCE COMMUNITY

• 1
• 2

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Hi, I am trying to redo this Project for the XEO option. I have run into some difficulties trying to understand the boundary conditions. I took eq(12) as the initial condition for U.I implemented the boundary conditions for the principal axis at x_1=0 and x_1=2x_0 by modifying the equation (20) as P=A+F where A(bc,: )=0 and F(bc)=bv i.e. A is zero for the row where I have the boundary condition and the bv= boundary value(which is the derivative of eq. 23). Now, I don't quite understand how to implement the eq. 21 as now U=Nd*Np vector and the way I have defined A= Nd*Np,Nd*Np matrix and hence I am unsure of the initial conditions and how to implement the linear discretized boundary conditions (eqs 24 &25) in the same fashion.Sorry if I am asking stupid questions. I am a complete newbie. Please help me out!Thanks

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Seems you are trying to run before you can walk in this (PDE, FDM) case.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

This is my first attempt in using numerical methods in Finance, hence I am sorry to appear extremely shaky here. I have to do this for a course in Numerical methods, and would appreciate any help you can give me.

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

QuoteOriginally posted by: radhikanangiaThis is my first attempt in using numerical methods in Finance, hence I am sorry to appear extremely shaky here. I have to do this for a course in Numerical methods, and would appreciate any help you can give me.If you are learning Numerical Analysis, jumping into PDEs from scratch is very very wrong.There are major gaps to be filled in.Compare to judo: you are white belt embarking on > blue belt exams. It's a show stopper IMO.I assume you are a student so at first glance I would revert to supervisor for more focused guidance. Here is stuff before FDMhttp://www.datasimfinancial.com/course_detail.php?courseId=47
Last edited by Cuchulainn on December 5th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

With PDE/FDM1. Describe PDE + all auxiliary info2. Discretise PDE etc.3. Assemble discrete system of equations4. Solve matrix system Plan B: reduce the scope and take a simpler problem to get you to orange belt.
Last edited by Cuchulainn on December 5th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Well, I did not attach that part of my code, but I have already done those things. The code attached is the bdf2 solver for the eq. 20 of the paper. But now when I discretized the secondary domain and run nearly the same code again, I don't understand how I should go about dealing with the boundary conditions eq.(24). The last time I did not mess up my U vector and instead played around setting P=A+F and would like to do the same this time around as well.

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

QuoteOriginally posted by: radhikanangiaWell, I did not attach that part of my code, but I have already done those things. The code attached is the bdf2 solver for the eq. 20 of the paper. But now when I discretized the secondary domain and run nearly the same code again, I don't understand how I should go about dealing with the boundary conditions eq.(24). The last time I did not mess up my U vector and instead played around setting P=A+F and would like to do the same this time around as well.By 'mess up' you mean that discretisation of (24) destroys the structure of the matrix in some way? BTW (24) is well-known. Here for Heston+BDF2 from @aitkin. hth
Last edited by Cuchulainn on December 6th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Thank you for the link .. I don't understand 1 thing. What is in the vector U? According to me the dimension of U should be no_of_underlying_assets, but then I don't understand how spatial discretization plays a role here. I understand that the initial condition of U is the contract function(eq. 12) but then, it appears as a 1 x 1 scalar to me. Quite confused here. Please help me out! .. I am attaching my code here. If you could have a look, it would be awesome..My solution is behaving like crazy. The 1D equation attains its final value in an instant.. it is supposed to diffuse, and the 2D equation is ........ worse...
Attachments
Project 2.zip

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Posting code only is not helpful (I am busy enough with my own bugs and have no time to debug the code, beside the FDM could be wrong as well, a double whammy)What is helpful to unambiguously write up the PDE and FDM equations in TEX (I reckon it's about 10 lines).You can use my approach as template format. See e.g. "Robust..."// I am a Matlab ignoramus
Last edited by Cuchulainn on December 10th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

I have written down all the equations in latex. Thank you once again
Attachments
question3.zip

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

QuoteOriginally posted by: radhikanangiaI have written down all the equations in latex. Thank you once again Have you tried explicit Euler (with small dt) just to see if it works at all?A question on your paper: if you handed it to a developer could she implement the scheme just by looking at the equations? What do I miss1. Describe PDE + all auxiliary info2. Discretise PDE etc.3. Assemble discrete system of equations4. Solve matrix system
Last edited by Cuchulainn on December 10th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

No, it can't be given to a developer. Firstly, there is no relation given between the no of points the principal axis must be divided into, which i strongly suspect is linked to the no of assets underlying. As I am confused... I'm sure the developer would be too.. I haven't solved it for Explicit Euler.. as it is the boundary conditions and initial conditions I am stuck with.. not the scheme itself.. If you could understand the structure of U (as in is there any relation between no of assets and Np ? ), and kindly tell me, things would become a whole lot easier for me.. Sorry for bothering you soo much, I have a deadline
Last edited by radhikanangia on December 10th, 2013, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Sorry, time in short supply.Is too late to give feedback?
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Topic Author
Posts: 9
Joined: March 9th, 2013, 6:57 pm

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

Well the project was due long back but as I don't think I understood it properly and I would still appreciate your feedback.

Cuchulainn
Posts: 62887
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Pricing Basket Options using Black-Scholes by BDF2 after using PCA for dimension reduction

QuoteOriginally posted by: radhikanangiaWell the project was due long back but as I don't think I understood it properly and I would still appreciate your feedback.Has the thesis been presented to the committee?
Last edited by Cuchulainn on December 17th, 2013, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...

 JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...

GZIP: On