Serving the Quantitative Finance Community

 
User avatar
dxg222
Topic Author
Posts: 0
Joined: February 21st, 2006, 9:18 pm

3 factor PDE

July 10th, 2006, 2:51 pm

Hello everybody,I'm pricing a cross currency swap in the setting of V. Piterbarg's paper "A multi currency model with FX skew". The model has 3 factors (domestic rate r_d, foreign rate r_f and FX) and results in a 3 factors PDE with mix derivatives and time/state dependent coefficients (see p.3 of his paper). For the numerical scheme I followed the ref. given by Piterbarg : "An ADI scheme for parabolic equations with mixed derivatives" by Craig & Sneyd.I find that my numerical implementation gives poor results (I didn't rescale any of the variable r_d, r_f or FX), and I was wondering if somebody tried the same problem before and could give me some tips of the numerical scheme..My problem is that when I play with the space steps (r_d, r_f and FX) I find big differences in the PV and it doesn't seem to converge to a specific value.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 10th, 2006, 6:26 pm

QuoteOriginally posted by: dxg222Hello everybody,I'm pricing a cross currency swap in the setting of V. Piterbarg's paper "A multi currency model with FX skew". The model has 3 factors (domestic rate r_d, foreign rate r_f and FX) and results in a 3 factors PDE with mix derivatives and time/state dependent coefficients (see p.3 of his paper). For the numerical scheme I followed the ref. given by Piterbarg : "An ADI scheme for parabolic equations with mixed derivatives" by Craig & Sneyd.I find that my numerical implementation gives poor results (I didn't rescale any of the variable r_d, r_f or FX), and I was wondering if somebody tried the same problem before and could give me some tips of the numerical scheme..My problem is that when I play with the space steps (r_d, r_f and FX) I find big differences in the PV and it doesn't seem to converge to a specific value.Hi dxg22,Yes this paper is known.There are different approaches for this problem, one of which is CS as you mention. Other techniques are Soviet Splitting and ADE (old method but people are working on it).There are many threads on FDM here, some of which might be useful to you:ADISplitting/ADEOne of the difficulties I have personally is that I would like to see the unambiguous statement of the scheme including all bells and whistles. Would it be possible to write down the scheme in Latex, because then you would get a good response from people on this forum.There's a whole bunch of numerical challenges involved with this problem, some of which are addressed in these 2 other threads.A question whose answer I do not know is: What are the boundary conditions for this problem (dmin, dmax, fmin, fmax, FXmin, FXmax) and at the vertices?thanks
Last edited by Cuchulainn on July 9th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
dxg222
Topic Author
Posts: 0
Joined: February 21st, 2006, 9:18 pm

3 factor PDE

July 11th, 2006, 7:39 pm

I Have a doc where I wrote the details of my ADI scheme, according to Craig & Sneyd 's paper. Is there a way I could attach it here online?D.G.
 
User avatar
dxg222
Topic Author
Posts: 0
Joined: February 21st, 2006, 9:18 pm

3 factor PDE

July 11th, 2006, 7:54 pm

ok, found it. I'm attaching 1. The ADI scheme of Craig & Sneyd.2. My version of the 3F PDE written in a word document. Any comments, shared ideas or criticisms would be very welcome.2. The original paper of V. Piterbarg (A Multi-Currency Model with FX Volatility Skew) available online.Thanks,D.G.
Attachments
PRDC_SkewRisk.zip
(307.7 KiB) Downloaded 80 times
DavidG 3F PDE.zip
(91.72 KiB) Downloaded 91 times
05031315233511112.zip
(532.55 KiB) Downloaded 79 times
Last edited by dxg222 on July 11th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 12th, 2006, 4:56 pm

hi dxg22I am having a look at the Word doc. I have a number of questions but I will start with the first *set* of questions to make sure I understand what is going on:A. The SDE for rd, rfVP has a "-" in the DW part, you have a "+" (+ I think??)B. Th PDEThe coeff of the term dv/drf you a "-" in front of rho(f,S), VP article has "+" You have "+" terms for 2 of the mixed derivatives, VP has "-" (I think the + is right?)These + and - will influence FDM schemes of course. Of course, I may have incorrectly misinterpreted the equations.C. The CS article in general:This is for the PDEdu/dt = Lu where L is an elliptic operator (including mixed derivatives). In section 5.1 they hand-wave to motivate the scheme for L augmented by first-order convection term, i.e.Mu = adu/dx + bdu/dr1 + cdu/dr2(BTW the von Neumann stability analysis in CS paper is OK but not absolute truth).D. The CS scheme (your equations 26-27) is CS "classico" in combination with the convective terms thrown into the first leg. What is the rationale for putting all the convective terms in this leg?Suggestion: put each convective term in the appropriate leg, e.g. in eq. 27 (eq. for f term use the convection term for the du/drf term. This is the way Soviet splitting does it and this works well.E. in the schemes 26-27 I would evaluate the functions like qjj (j = 1,2,3) at the current/appropriiate time levels in each leg. It is more accurate than their evaluation at the 'lowest' level n-1. Every bit helps.F. What are typical values of 1) correlation, 2) vol 3) theta factors. Do yiu have small vol terms and/or laeg negative correlation (-0.9, for example).I have other, less pressing questions but let's clear up these first. I like the way you have documented the PDE and FDM problems. Nice and explicit. If these problems can be resolved the next step should be easier, e.g. an improved splitting method.hope this helpsDD
Last edited by Cuchulainn on July 11th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
dxg222
Topic Author
Posts: 0
Joined: February 21st, 2006, 9:18 pm

3 factor PDE

July 12th, 2006, 7:04 pm

Hi Cuchulainn,Thanks for your comments, please find bellow some answers to your questions; I hope it helps. Let me know if it’s clear enough and what you think.A. The SDE for rd, rfVP has a "-" in the DW part, you have a "+" (+ I think??)Answer A:You're right, but in VP's paper things are initially expressed in terms Bonds diffusions (his Eq. 2.2).Whatever he's expressing in terms of Bond I express in terms of short rate; when you switch from Bond to short rate, the vol becomes -vol. In my setting I start directly by specifying the HW process for the short rate with “+” in front of the vol (the way I'm used to) and I flip the signs in front of the vol_d and vol_f in the PDE. ***************************************************************B. Th PDEThe coeff of the term dv/drf you a "-" in front of rho(f,S), VP article has "+" You have "+" terms for 2 of the mixed derivatives, VP has "-" (I think the + is right?)These + and - will influence FDM schemes of course. Of course, I may have incorrectly misinterpreted the equations.Answer B:For the same reason as in Question A***************************************************************C. The CS article in general:This is for the PDEdu/dt = Lu where L is an elliptic operator (including mixed derivatives). In section 5.1 they hand-wave to motivate the scheme for L augmented by first-order convection term, i.e.Mu = adu/dx + bdu/dr1 + cdu/dr2(BTW the von Neumann stability analysis in CS paper is OK but not absolute truth).Answer C:Yes that's right. I just assumed (without checking) that the scheme would still with work augmented by first-order convection term***************************************************************D. The CS scheme (your equations 26-27) is CS "classico" in combination with the convective terms thrown into the first leg. What is the rationale for putting all the convective terms in this leg?Suggestion: put each convective term in the appropriate leg, e.g. in eq. 27 (eq. for f term use the convection term for the du/drf term. This is the way Soviet splitting does it and this works well.Answer D:I just followed what the paper said in section 5.1: "...is easily accommodated in the general scheme by modifying the operator B in the scheme (7a,b)....."the operator B is defined in Eq.5 of CS paper; so I just added the first-order convection terms to it.***************************************************************E. in the schemes 26-27 I would evaluate the functions like qjj (j = 1,2,3) at the current/appropriiate time levels in each leg. It is more accurate than their evaluation at the 'lowest' level n-1. Every bit helps.Answer E:Ok, we’ll do.. I was not sure about that one.***************************************************************F. What are typical values of 1) correlation, 2) vol 3) theta factors. Do yiu have small vol terms and/or laeg negative correlation (-0.9, for example).Answer F:Correlations: 6% - 20%HW Vols: 0.8% -- 1.2%Thetas (say for USD yield curve): -3% -- 5%
Last edited by dxg222 on July 11th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 13th, 2006, 5:47 pm

Hi dx,It's clear now, thanks.Here are some new comments and suggestions.QuoteC. The CS article in general:This is for the PDEdu/dt = Lu where L is an elliptic operator (including mixed derivatives). In section 5.1 they hand-wave to motivate the scheme for L augmented by first-order convection term, i.e.Mu = adu/dx + bdu/dr1 + cdu/dr2(BTW the von Neumann stability analysis in CS paper is OK but not absolute truth).Answer C:Yes that's right. I just assumed (without checking) that the scheme would still with work augmented by first-order convection term Section 5.1 of the CS article is pure waffle IMO so take it with a spoonful of salt. Convection-diffusion is hard.The PRDC is a convection-diffusion and most methods split into a series of 1-d CD equations of the formdu/dt = Lu + L1u (in x, rd and rf, each)Then you can apply centred difference in the space and centred difference in time (the latter is called Crank Nicolson). This approach works well but be careful of:1. Mixed derivatives (I would like not to talk about this for the moment)2. PDE with small vol. and/or large convection terms (convection-dominance). This can lead to oscillatory solutions and in you cas the parameters seem to fit the bill3. Calculation of Greeks at discontinuous points in State space (and time)QuoteCorrelations: 6% - 20%HW Vols: 0.8% -- 1.2%Thetas (say for USD yield curve): -3% -- 5%So, vol has values around 0.01? That's quite small and might give boundary layers. So putting all the convection terms in the first leg will I guess lead to bad solutions. Other splittings put 1 convection term in each leg.
Attachments
NYUEdited.ZIP
(947.11 KiB) Downloaded 87 times
Last edited by Cuchulainn on July 12th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 13th, 2006, 5:59 pm

Boundary conditions and far-field conditiions you mentioned as well. The much-maligned explicit FDM could be a good FDM for PRDC because you can let the PC churn away at the results in the background (it's slow but accurate) just to test your hypotheses. And it's very easy to program.What about this? It has some ideas on far-fields.CrossCurrencySwaps
Last edited by Cuchulainn on July 12th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
sheppardr
Posts: 2
Joined: March 22nd, 2005, 7:02 am

3 factor PDE

July 14th, 2006, 5:10 am

I am 90% sure that the issue is with your convective part. You use central differences for them and keep them explicit (if I understand your notation). If you do this for the simple BS (type) pde`s you get only conditional stability, I think. Making the convective terms implicit gives you some new problems of course, need to use some tricks to keep the matrices that you have to solve M-matrices.In a Nut Shell: buy Duffy's new book and see what he has to say about fitting methods, and the Yanenko scheme. (It’s my new Bible at the moment.)
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 14th, 2006, 6:37 am

Hi R,QuoteI am 90% sure that the issue is with your convective part. The features for the convective component are:a) centred differencing in space (may lead to boundary layer oscillations if vol is small), can be solved by my fitting methodb) explicit in time, which BTW leads to the modern IMEX schemes but deltaT must be of the order of delta(rd, rf). Mild contraint but it must be satisfiedc) all the convective terms are in the first ADI leg. I do not know if this is bad, I have not done this, but it is counter-intuitiveQuoteYou use central differences for them and keep them explicit (if I understand your notation). If you do this for the simple BS (type) pde`s you get only conditional stability, I think.Implicit in diffusion and explicit in convection is IMEX indeed.QuoteMaking the convective terms implicit gives you some new problems of course, need to use some tricks to keep the matrices that you have to solve M-matrices.Using M-matrices is the modern way (from the 70's) to prove stability these days. It is mathemtically hard and intuitive at the same time. I use it for the 1-factor BS in the link below. It can also be generalised to nonlinear PDE as shown by Crandall, Ishi and Lions in their seminal viscosity paper. Von Neumann breaks down as soon as a linear PDE has non-constant coefficients.QuoteIn a Nut Shell: buy Duffy's new book and see what he has to say about fitting methods, and the Yanenko scheme. (It’s my new Bible at the moment.)An interesting follow-on Q is how to treat the mixed derivatives. CS put them all in one basket as it were while I have two other possibilities where there are 'equidistributed' on different legs. But, this is not the major challenge at the moment I think. FiittingAndMMatrices This might be of interest: it's a state of art IMEX discussion by Roberto Natalini and colleagues. It is related to the current discussionIMEX mvgDD
Last edited by Cuchulainn on July 13th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 14th, 2006, 1:49 pm

Here's a counter-example just to show how bad-tempered connvection-diffusion is...The BVPaUxx + 2Ux = 0 on (0,1)U(0) = 1, U(1) = 0(Exact solution known, what is it?)Approximate by the popular/standard difference schemea(V(j+1) - 2V(j) + V(j-1))/h^2 + 2(V(j+1) - V(j-1)/(2h) = 0, 1 <= j <= J-1V(0) = 1, V(J) = 0(Has an exact solution)When a -> 0 we get V(j) = 0.5 * ( (-1)^j + 1)So it oscillates boundedly when a * J < 1 (BAH!)Even worse, for N even the solution oscillates unboundedly as the coeff. a decreases.Something is not right, but what? How can I fix it? (hint: it's got to do with M-matrices)
Last edited by Cuchulainn on July 13th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
N
Posts: 0
Joined: May 9th, 2003, 8:26 pm

3 factor PDE

July 14th, 2006, 2:48 pm

QuoteOriginally posted by: CuchulainnHere's a counter-example just to show how bad-tempered connvection-diffusion is...The BVPaUxx + 2Ux = 0 on (0,1)U(0) = 1, U(1) = 0(Exact solution known, what is it?)Approximate by the popular/standard difference schemea(V(j+1) - 2V(j) + V(j-1))/h^2 + 2(V(j+1) - V(j-1)/(2h) = 0, 1 <= j <= J-1V(0) = 1, V(J) = 0(Has an exact solution)When a -> 0 we get V(j) = 0.5 * ( (-1)^j + 1)So it oscillates boundedly when a * J < 1 (BAH!)Even worse, for N even the solution oscillates unboundedly as the coeff. a decreases.Something is not right, but what? How can I fix it? (hint: it's got to do with M-matrices)Cuch,So what do you know about the decompostion of M-matrices? In operator form, you can get a pair that's analogous to Baker-Campbell-Hausdorff!N
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 14th, 2006, 3:57 pm

ed.
Last edited by Cuchulainn on July 17th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

3 factor PDE

July 16th, 2006, 12:31 pm

An historical footnote on this topic, in particular mixed derivatives...For all intents and purposes the Craig-Sneyd scheme was discovered in 1963, 25 years before it was 'rediscovered' in 1988. The articleis:I.D. Sofronov "A continuation to the difference solution of the heat conduction equation in curvilinear coordinates" USSR Comp Math 3, No. 4, 1069-1072 1963 Amazing
Last edited by Cuchulainn on July 16th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
Stochastic44
Posts: 0
Joined: November 23rd, 2005, 4:18 pm

3 factor PDE

July 21st, 2006, 11:28 am

really amazing