Login  Register

Re: GJR-GARCH option pricing engine

Posted by Yee Man Chan on Mar 28, 2008; 1:12am
URL: http://quantlib.414.s1.nabble.com/GJR-GARCH-option-pricing-engine-tp11799p11817.html

Hi Luigi

   I am done coding now. The files are attached in
this email and the next.
   I am sure the analytic pricing engine I implemented
is correct. But the algorithm is O(n^3) where n is the
number of days till expiry, so it is very slow when
number of days is large. It took me 20min to run the
36 test cases in Duan et al's paper.

    I can speed it up quite a bit if I can re-use some
intermediate results when some parameters are the
same. But this requires me to introduce some data
members to AnalyticGJRGARCHengine and assign values to
them during calculate(). But calculate() is a const
function, so I can't really do that. What do you think
I should do?

   I find that my MC results are a bit lower than my
analytic approximation. I think it is due to the fact
that I am using the following code to set maturity

    Date exDate = today + 10; // 10 days maturity
    boost::shared_ptr<Exercise> exercise(new
EuropeanExercise(exDate));

   I find that the time is a bit less than 10 days
when I call
process->time(arguments_.exercise->lastDate()) and
multiply it by 365.0. Do you know how I can get almost
10 days here? Thanks

Attached files are:
test-suite/gjrgarchmodel.hpp
test-suite/gjrgarchmodel.cpp
ql/processes/gjrgarchprocess.hpp
ql/processes/gjrgarhprocess.cpp

    Let me know if there are any questions and
comments

Yee Man

PS More files in another email

> > BOOST_MESSAGE calls I made. Where can I see the
> print
> > outs such that I can debug my code?
>
> You should set the environment variable
>
> BOOST_TEST_LOG_LEVEL=message
>
> If you run the tests with 'make check', it is done
> for you.
>
> Luigi
 

>
> --
>
> Hofstadter's Law:
> It always takes longer than you expect, even when
> you take
> Hofstadter's Law into account.
>
>
>

      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs
-------------------------------------------------------------------------
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-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

gjrgarchmodel.cpp (6K) Download Attachment
gjrgarchmodel.hpp (1K) Download Attachment
gjrgarchprocess.hpp (5K) Download Attachment
gjrgarchprocess.cpp (11K) Download Attachment