Login  Register

Re: G2::FittingParameter

classic Classic list List threaded Threaded
6 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

Lars Schouw
17 posts
Luigi

The function G2::dynamics()  is never called.
I just tryed to setup in the debugger running the BermudanSwaption example.

Or am I overlooking something?

Cheers,
Lars


Lars Schouw <[hidden email]> wrote:
Luigi

Thank your for a fast answer like always.

shortRate belonging to G2::Dynamics is never called.
I guess we can remove this code that is never used?
It also become clear that this is not needed when reading the Brigo Mercurio book chaper 4.2.

Regards
Lars Schouw

On 11/24/2005 05:15:55 AM, Lars Schouw wrote:
> I can't see where the method value() in the class G2::FittingParameter
> is called from. It must be called from somewhere!!
> This is in the header file g2.hpp

It is called inside G2::Dynamics::shortRate. The fitting_ variable is a G2::FittingParameter. When fitting_(t) is called, operator() delegates to value().

Luigi

 

Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

Lars Schouw
17 posts
Is that only when using the tree?

Lars Schouw <[hidden email]> wrote:
Luigi

The function G2::dynamics()  is never called.
I just tryed to setup in the debugger running the BermudanSwaption example.

Or am I overlooking something?

Cheers,
Lars


Lars Schouw <[hidden email]> wrote:
Luigi

Thank your for a fast answer like always.

shortRate belonging to G2::Dynamics is never called.
I guess we can remove this code that is never used?
It also become clear that this is not needed when reading the Brigo Mercurio book chaper 4.2.

Regards
Lars Schouw

On 11/24/2005 05:15:55 AM, Lars Schouw wrote:
> I can't see where the method value() in the class G2::FittingParameter
> is called from. It must be called from somewhere!!
> This is in the header file g2.hpp

It is called inside G2::Dynamics::shortRate. The fitting_ variable is a G2::FittingParameter. When fitting_(t) is called, operator() delegates to value().

Luigi

 

Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

Lars Schouw
17 posts
In reply to this post by Lars Schouw
Is that only when using the tree?

Lars Schouw


Yahoo! Mail
Use Photomail to share photos without annoying attachments.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

Lars Schouw
17 posts
In reply to this post by Lars Schouw
Is that only when using the tree?

Lars Schouw


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

marco.tarenghi@libero.it
18 posts
In reply to this post by Lars Schouw
Lars, the fnction G2::dynamics() is actually used when pricing using trees. It is the reimplementation of the pure virtual function

virtual boost::shared_ptr<ShortRateDynamics> dynamics() const = 0;

defined in the file twofactormodel.hpp.
It is called in the function

boost::shared_ptr<NumericalMethod>
TwoFactorModel::tree(const TimeGrid& grid) const {
    boost::shared_ptr<ShortRateDynamics> dyn = dynamics();
    ...
}

in two factormodel.cpp.

Bye,
marco




---------- Initial Header -----------

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: G2::FittingParameter

quantlib-users-admin
6 posts
In reply to this post by Lars Schouw






> Is that only when using the tree?
>
> Lars Schouw
>
> ---------------------------------
> Relax. Yahoo! Mail virus scanning helps detect nasty viruses!