Monte Carlo grid and time consumption

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Monte Carlo grid and time consumption

Lapin
Hi,

I have added a monte carlo engine to price a kind of autocall note.
Roughly it has some call dates (bermudans) at which you redeem the note if the spot is above the strike.

I have a trouble with both the grid generation and the computing time.
Let's imagine I have a 1 year note, which may redeem at 3M, 6M, 9M and 1Y.
I have 4 dates, so I put 4 time step in my MC engine.
Most of the time, I will get an exception saying the grid is inadequate since my node do not fall on a call date. The only way to solve it is to increase the number of time steps, but generally it does not work unless I put 365 steps (1Y).

How to solve the issue?

the second question is linked to the first one.
If I put 365 time steps, the computing is really really long (more than 20 minutes).
How could I speed it up? Is there any trick or things to avoid?

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Monte Carlo grid and time consumption

Luigi Ballabio
On Tue, 2007-11-06 at 00:38 -0800, Yomi wrote:
> I have added a monte carlo engine to price a kind of autocall note.
> Roughly it has some call dates (bermudans) at which you redeem the note if
> the spot is above the strike.
>
> I have a trouble with both the grid generation and the computing time.
> Let's imagine I have a 1 year note, which may redeem at 3M, 6M, 9M and 1Y.
> I have 4 dates, so I put 4 time step in my MC engine.
> Most of the time, I will get an exception saying the grid is inadequate
> since my node do not fall on a call date.

You're probably generating the time grid with four equally-spaced steps.
Instead, you need to calculate a vector of node times beforehand and
pass it to the TimeGrid constructor.

Luigi


--

Dealing with failure is easy: work hard to improve. Success is also
easy to handle: you've solved the wrong problem. Work hard to improve.
-- Alan Perlis



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Monte Carlo grid and time consumption

Lapin
Luigi,

I have given a quick look at the doc.
It does not seem to be a constructor taking a std::vector<Time>, does it?
Perhaps my version is outdated, I am using 0.8.1.

If needed I will write it and try to send the code to you for integration.

Regards

Luigi Ballabio wrote
On Tue, 2007-11-06 at 00:38 -0800, Yomi wrote:
> I have added a monte carlo engine to price a kind of autocall note.
> Roughly it has some call dates (bermudans) at which you redeem the note if
> the spot is above the strike.
>
> I have a trouble with both the grid generation and the computing time.
> Let's imagine I have a 1 year note, which may redeem at 3M, 6M, 9M and 1Y.
> I have 4 dates, so I put 4 time step in my MC engine.
> Most of the time, I will get an exception saying the grid is inadequate
> since my node do not fall on a call date.

You're probably generating the time grid with four equally-spaced steps.
Instead, you need to calculate a vector of node times beforehand and
pass it to the TimeGrid constructor.

Luigi


--

Dealing with failure is easy: work hard to improve. Success is also
easy to handle: you've solved the wrong problem. Work hard to improve.
-- Alan Perlis



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Monte Carlo grid and time consumption

Luigi Ballabio
On Thu, 2008-01-03 at 00:22 -0800, Yomi wrote:
> I have given a quick look at the doc.
> It does not seem to be a constructor taking a std::vector<Time>, does it?
> Perhaps my version is outdated, I am using 0.8.1.

Oh, right. TimeGrid has a constructor taking two iterators, so if you
have a vector v, you can build the grid as

TimeGrid grid(v.begin(),v.end());

Luigi


--

Everything can be filed under "miscellaneous".
-- unknown



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users