joint calendar

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

joint calendar

Chak Jack Wong
Hi,
Something very simple, how can I specify
NewYork and London as calendar?
Jack

--
This is not an offer (or solicitation of an offer) to buy/sell the
securities/instruments mentioned or an official confirmation.  Morgan
Stanley may deal as principal in or own or act as market maker for
securities/instruments mentioned or may advise the issuers.  This may
refer to a research analyst/research report. Unless indicated, these
views are the author's and may differ from those of Morgan Stanley
research or others in the Firm. We do not represent this is accurate or
complete and we may not update this.  Past performance is not indicative
of future returns. For additional information, research reports and
important disclosures, contact me or see https://secure.ms.com.  You
should not use email to request, authorize or effect the purchase or
sale of any security or instrument, to send transfer instructions, or to
effect any other transactions.  We cannot guarantee that any such
requests received via email will be processed in a timely manner.  This
communication is solely for the addressee(s) and may contain
confidential information.  We do not waive confidentiality by
mistransmission.  Contact me if you do not wish to receive these
communications.  In the UK, this communication is directed in the UK to
those persons who are market counterparties or intermediate customers
(as defined in the UK Financial Services Authority's rules).




Reply | Threaded
Open this post in threaded view
|

Re: joint calendar

Luigi Ballabio-2
At 1:56 PM +0000 1/24/03, Chak Jack Wong wrote:
>Something very simple, how can I specify NewYork and London as calendar?

Jack,
        it's not entirely clear to me whether you want a calendar
whose set of business days is the union or the intersection of the
set of business days of New York and London. However, the principle
is the same: you use the Composite pattern. You should derive a new
calendar and a corresponding calendar implementation. The constructor
of the new Calendar class takes two Calendars c1 and c2 and just
passes them to its implementation, which stores them. The
implementation defines its isBusinessDay(date) method either as:

    return c1.isBusinessDay(date) || c2.isBusinessDay(date);

or:

    return c1.isBusinessDay(date) && c2.isBusinessDay(date);

depending on the desired behavior. You'll also have to implement its
name() method by composing c1.name() and c2.name() somehow.

You're welcome to come back with some tentative code if you get into
any problem---I'll try and give you a hand.

Later,
        Luigi


Reply | Threaded
Open this post in threaded view
|

Re: joint calendar

Jens Thiel
In reply to this post by Chak Jack Wong
Jack,

you mean a calendar with all London and NewYork holidays in one? This
hasn't been done yet, but you can probably add a CombinedCalendar class to
the CVS:
 - inherit from Calendar
 - provide a constructor taking two Calendars to combine
 - write and initialize a CombinedCalendarImpl with the two Calendars
 - let CombinedCalendarImpl.name return the combined name
   (eg. cal1.name+"+"+cal2.name)
 - let CombinedCalendarImpl.isBusinessDay return
   (cal1.isBusinessDay AND cal2.isBusinessDay)

Regards,

Jens.

> Hi,
> Something very simple, how can I specify
> NewYork and London as calendar?
> Jack
>
> --
> This is not an offer (or solicitation of an offer) to buy/sell the
> securities/instruments mentioned or an official confirmation.  Morgan
> Stanley may deal as principal in or own or act as market maker for
> securities/instruments mentioned or may advise the issuers.  This may
> refer to a research analyst/research report. Unless indicated, these
> views are the author's and may differ from those of Morgan Stanley
> research or others in the Firm. We do not represent this is accurate or
> complete and we may not update this.  Past performance is not
> indicative of future returns. For additional information, research
> reports and important disclosures, contact me or see
> https://secure.ms.com.  You should not use email to request, authorize
> or effect the purchase or sale of any security or instrument, to send
> transfer instructions, or to effect any other transactions.  We cannot
> guarantee that any such
> requests received via email will be processed in a timely manner.  This
> communication is solely for the addressee(s) and may contain
> confidential information.  We do not waive confidentiality by
> mistransmission.  Contact me if you do not wish to receive these
> communications.  In the UK, this communication is directed in the UK to
> those persons who are market counterparties or intermediate customers
> (as defined in the UK Financial Services Authority's rules).
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users





Reply | Threaded
Open this post in threaded view
|

Re: joint calendar

Chak Jack Wong
In reply to this post by Luigi Ballabio-2
Hi, Luigi and Jens,
The behavior in Jens' e-mail is exactly what we need.  This is mainly used
for cross-ccy swap.  for USD and Yen swap on Libor , the holiday is typically
NewYork, London and Tokyo (i.e. union of holiday.), and for quite a lot of
swiss product, we use Zurich/London.   This is rather important (yet pretty
simple)

Is it possible to add this simple class to the 0.3.1 release?

Best regards,
Jack


Luigi Ballabio wrote:

> At 1:56 PM +0000 1/24/03, Chak Jack Wong wrote:
> >Something very simple, how can I specify NewYork and London as calendar?
>
> Jack,
>         it's not entirely clear to me whether you want a calendar
> whose set of business days is the union or the intersection of the
> set of business days of New York and London. However, the principle
> is the same: you use the Composite pattern. You should derive a new
> calendar and a corresponding calendar implementation. The constructor
> of the new Calendar class takes two Calendars c1 and c2 and just
> passes them to its implementation, which stores them. The
> implementation defines its isBusinessDay(date) method either as:
>
>     return c1.isBusinessDay(date) || c2.isBusinessDay(date);
>
> or:
>
>     return c1.isBusinessDay(date) && c2.isBusinessDay(date);
>
> depending on the desired behavior. You'll also have to implement its
> name() method by composing c1.name() and c2.name() somehow.
>
> You're welcome to come back with some tentative code if you get into
> any problem---I'll try and give you a hand.
>
> Later,
>         Luigi
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

--
This is not an offer (or solicitation of an offer) to buy/sell the
securities/instruments mentioned or an official confirmation.  Morgan Stanley
may deal as principal in or own or act as market maker for
securities/instruments mentioned or may advise the issuers.  This may refer
to a research analyst/research report. Unless indicated, these views are the
author's and may differ from those of Morgan Stanley research or others in
the Firm. We do not represent this is accurate or complete and we may not
update this.  Past performance is not indicative of future returns. For
additional information, research reports and important disclosures, contact
me or see https://secure.ms.com.  You should not use email to request,
authorize or effect the purchase or sale of any security or instrument, to
send transfer instructions, or to effect any other transactions.  We cannot
guarantee that any such requests received via email will be processed in a
timely manner.  This communication is solely for the addressee(s) and may
contain confidential information.  We do not waive confidentiality by
mistransmission.  Contact me if you do not wish to receive these
communications.  In the UK, this communication is directed in the UK to those
persons who are market counterparties or intermediate customers (as defined
in the UK Financial Services Authority's rules).




Reply | Threaded
Open this post in threaded view
|

Re: joint calendar

Luigi Ballabio-2
At 08:35 AM 1/27/03 +0000, Chak Jack Wong wrote:
>The behavior in Jens' e-mail is exactly what we need.  This is mainly used
>for cross-ccy swap.  for USD and Yen swap on Libor , the holiday is typically
>NewYork, London and Tokyo (i.e. union of holiday.), and for quite a lot of
>swiss product, we use Zurich/London.   This is rather important (yet pretty
>simple)

Ok, so the relation is:

joint.isBusinessDay(d) <= c1.isBusinessDay(d) && c2.isBusinessDay(d)

Does anybody think we might need the same thing but with || instead of && ?

Also, I see that one might need more than two calendars. Is three the
maximum anybody saw, or did anybody used more complex stuff?


>Is it possible to add this simple class to the 0.3.1 release?

Not to 0.3.1, sorry---it is already frozen. I can send you the files (once
I have them, of course) if you have problems accessing the CVS version.

Later,
         Luigi



Reply | Threaded
Open this post in threaded view
|

AW: joint calendar

Jens Thiel
Luigi, Jack,

I just implemented it in C#, see below. I introduced

a) the concept of a main calendar, which is also used for globalization/i18n
stuff
b) a Combine enumeration ("||/&& flag")

Default combination is resulting in combined holidays (that is common
business days). More than three calendars can be combined using
CombinedCalendar like standard boolean algebra. Not tested yet...


Jens.




/// <summary>
/// Calendar combining holidays or business days from two other calendars.
/// </summary>
[ RcsId("$Id: $") ]
[ ComVisible(false) ]
public sealed class CombinedCalendar : CalendarBase
{
        /// <summary>
        /// Holidays / business days combination.
        /// </summary>
        /// <remarks>
        /// Use to combine calendars on common business days or holidays:
        /// <list type="table">
        /// <listheader>
        /// <term>Combination mode</term>
        /// <description>Description</description>
        /// </listheader>
        /// <item>
        /// <term><c>Holidays</c></term>
        /// <description>
        /// The resulting calendar has holidays from both calendars.
        /// That is, in other words, only common business days.
        /// </description>
        /// </item>
        /// <item>
        /// <term><c>BusinessDays</c></term>
        /// <description>
        /// The resulting calendar has business days from both calendars.
        /// That is, in other words, only common holidays.
        /// </description>
        /// </item>
        /// </list>
        /// </remarks>
        public enum Combine
        {
                /// <summary>Combine holidays of the other calendar.</summary>
                Holidays,
                /// <summary>Combine business days of the other calendar.</summary>
                BusinessDays
        };

        #region Constructors

        /// <summary>
        /// Combine a main calendar with holidays from another calendar.
        /// </summary>
        /// <param name="mainCalendar">
        /// The main calendar (also used for globalization settings).</param>
        /// <param name="otherCalendar">
        /// The calendar which adds holidays to the main calendar.
        /// </param>
        /// <remarks>
        /// The combined calendars use the <c>Holidays</c> enumeration from <see
cref="Combine"/>.
        /// The resulting name can be localized in the resource file.
        /// </remarks>
        public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
otherCalendar)
                : this(mainCalendar, otherCalendar,
                Strings.Format(null, "CalCombHol", mainCalendar, Combine.Holidays,
otherCalendar),
                Combine.Holidays)
        {}

        /// <summary>
        /// Combine a main calendar with holidays from another calendar.
        /// </summary>
        /// <param name="mainCalendar">
        /// The main calendar (also used for globalization settings).</param>
        /// <param name="otherCalendar">
        /// The calendar which adds holidays to the main calendar.
        /// </param>
        /// <param name="name">
        /// Name of the combined calendar.
        /// </param>
        /// <remarks>
        /// The combined calendars use the <c>Holidays</c> enumeration from <see
cref="Combine"/>.
        /// </remarks>
        public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
otherCalendar,
                string name)
                : this(mainCalendar, otherCalendar, name, Combine.Holidays)
        {}

        /// <summary>
        /// Combine a main calendar with another calendar.
        /// </summary>
        /// <param name="mainCalendar">
        /// The main calendar (also used for globalization settings).</param>
        /// <param name="otherCalendar">
        /// The calendar which adds holidays to the main calendar.
        /// </param>
        /// <param name="name">
        /// Name of the combined calendar.
        /// </param>
        /// <param name="mode">
        /// The combination mode of the two calendars.
        /// </param>
        /// <remarks>
        /// The <see cref="Combine">combination mode</see> can be used to combine
        /// calendars on common business days or holidays:
        /// <list type="table">
        /// <listheader>
        /// <term><see cref="Combine"/> enumeration</term>
        /// <description>Description</description>
        /// </listheader>
        /// <item>
        /// <term><c>Holidays</c></term>
        /// <description>
        /// The resulting calendar has holidays from both calendars.
        /// That is, in other words, only common business days.
        /// </description>
        /// </item>
        /// <item>
        /// <term><c>BusinessDays</c></term>
        /// <description>
        /// The resulting calendar has business days from both calendars.
        /// That is, in other words, only common holidays.
        /// </description>
        /// </item>
        /// </list>
        /// </remarks>
        public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
otherCalendar,
                string name, Combine mode)
                : base(name, mainCalendar.Culture, mainCalendar.Calendar)
        {
                if( /* mainCalendar == null || */ otherCalendar == null)
                        throw new NullReferenceException(
                                Strings.Get(GetType(), "CalNullRef") );
                this.mainCalendar = mainCalendar;
                this.otherCalendar = otherCalendar;
                this.combineBusinessDays = (mode == Combine.BusinessDays);
        }

        #endregion

        private IBusinessCalendar mainCalendar;
        private IBusinessCalendar otherCalendar;
        private bool combineBusinessDays;

        /// <summary>
        /// Returns <c>true</c> iff the date is a business day for the given
market.
        /// </summary>
        /// <param name="date">The <see cref="DateTime"/> to check.</param>
        /// <returns><c>true</c> iff the date is a business day for the given
market.</returns>
        override public bool IsBusinessDay(DateTime date)
        {
                bool m = mainCalendar.IsBusinessDay(date);
                bool o = otherCalendar.IsBusinessDay(date);
                // at least two of three conditions must be true
                return (m&&o) || (m&&combineBusinessDays) || (o&&combineBusinessDays);
        }
}





> -----Ursprungliche Nachricht-----
> Von: [hidden email]
> [mailto:[hidden email]]Im Auftrag von Luigi
> Ballabio
> Gesendet: Montag, 27. Januar 2003 11:39
> An: [hidden email]
> Cc: [hidden email]
> Betreff: Re: [Quantlib-users] joint calendar
>
>
> At 08:35 AM 1/27/03 +0000, Chak Jack Wong wrote:
> >The behavior in Jens' e-mail is exactly what we need.  This is
> mainly used
> >for cross-ccy swap.  for USD and Yen swap on Libor , the holiday
> is typically
> >NewYork, London and Tokyo (i.e. union of holiday.), and for
> quite a lot of
> >swiss product, we use Zurich/London.   This is rather important
> (yet pretty
> >simple)
>
> Ok, so the relation is:
>
> joint.isBusinessDay(d) <= c1.isBusinessDay(d) && c2.isBusinessDay(d)
>
> Does anybody think we might need the same thing but with ||
> instead of && ?
>
> Also, I see that one might need more than two calendars. Is three the
> maximum anybody saw, or did anybody used more complex stuff?
>
>
> >Is it possible to add this simple class to the 0.3.1 release?
>
> Not to 0.3.1, sorry---it is already frozen. I can send you the
> files (once
> I have them, of course) if you have problems accessing the CVS version.
>
> Later,
>          Luigi
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>



Reply | Threaded
Open this post in threaded view
|

Re: AW: joint calendar

Chak Jack Wong
Hi, Jens, Luigi,
This is great.  If you can tell me the CVS file I need to update when that is in, that
will be fabulous.

There are products that need 4 calendars (EUR, Yen, GBP, $ ).  More than that, I have
never seen.
I have come across a product that is an OR rather than AND.

Jack

Jens Thiel wrote:

> Luigi, Jack,
>
> I just implemented it in C#, see below. I introduced
>
> a) the concept of a main calendar, which is also used for globalization/i18n
> stuff
> b) a Combine enumeration ("||/&& flag")
>
> Default combination is resulting in combined holidays (that is common
> business days). More than three calendars can be combined using
> CombinedCalendar like standard boolean algebra. Not tested yet...
>
> Jens.
>
> /// <summary>
> /// Calendar combining holidays or business days from two other calendars.
> /// </summary>
> [ RcsId("$Id: $") ]
> [ ComVisible(false) ]
> public sealed class CombinedCalendar : CalendarBase
> {
>         /// <summary>
>         /// Holidays / business days combination.
>         /// </summary>
>         /// <remarks>
>         /// Use to combine calendars on common business days or holidays:
>         /// <list type="table">
>         /// <listheader>
>         /// <term>Combination mode</term>
>         /// <description>Description</description>
>         /// </listheader>
>         /// <item>
>         /// <term><c>Holidays</c></term>
>         /// <description>
>         /// The resulting calendar has holidays from both calendars.
>         /// That is, in other words, only common business days.
>         /// </description>
>         /// </item>
>         /// <item>
>         /// <term><c>BusinessDays</c></term>
>         /// <description>
>         /// The resulting calendar has business days from both calendars.
>         /// That is, in other words, only common holidays.
>         /// </description>
>         /// </item>
>         /// </list>
>         /// </remarks>
>         public enum Combine
>         {
>                 /// <summary>Combine holidays of the other calendar.</summary>
>                 Holidays,
>                 /// <summary>Combine business days of the other calendar.</summary>
>                 BusinessDays
>         };
>
>         #region Constructors
>
>         /// <summary>
>         /// Combine a main calendar with holidays from another calendar.
>         /// </summary>
>         /// <param name="mainCalendar">
>         /// The main calendar (also used for globalization settings).</param>
>         /// <param name="otherCalendar">
>         /// The calendar which adds holidays to the main calendar.
>         /// </param>
>         /// <remarks>
>         /// The combined calendars use the <c>Holidays</c> enumeration from <see
> cref="Combine"/>.
>         /// The resulting name can be localized in the resource file.
>         /// </remarks>
>         public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
> otherCalendar)
>                 : this(mainCalendar, otherCalendar,
>                 Strings.Format(null, "CalCombHol", mainCalendar, Combine.Holidays,
> otherCalendar),
>                 Combine.Holidays)
>         {}
>
>         /// <summary>
>         /// Combine a main calendar with holidays from another calendar.
>         /// </summary>
>         /// <param name="mainCalendar">
>         /// The main calendar (also used for globalization settings).</param>
>         /// <param name="otherCalendar">
>         /// The calendar which adds holidays to the main calendar.
>         /// </param>
>         /// <param name="name">
>         /// Name of the combined calendar.
>         /// </param>
>         /// <remarks>
>         /// The combined calendars use the <c>Holidays</c> enumeration from <see
> cref="Combine"/>.
>         /// </remarks>
>         public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
> otherCalendar,
>                 string name)
>                 : this(mainCalendar, otherCalendar, name, Combine.Holidays)
>         {}
>
>         /// <summary>
>         /// Combine a main calendar with another calendar.
>         /// </summary>
>         /// <param name="mainCalendar">
>         /// The main calendar (also used for globalization settings).</param>
>         /// <param name="otherCalendar">
>         /// The calendar which adds holidays to the main calendar.
>         /// </param>
>         /// <param name="name">
>         /// Name of the combined calendar.
>         /// </param>
>         /// <param name="mode">
>         /// The combination mode of the two calendars.
>         /// </param>
>         /// <remarks>
>         /// The <see cref="Combine">combination mode</see> can be used to combine
>         /// calendars on common business days or holidays:
>         /// <list type="table">
>         /// <listheader>
>         /// <term><see cref="Combine"/> enumeration</term>
>         /// <description>Description</description>
>         /// </listheader>
>         /// <item>
>         /// <term><c>Holidays</c></term>
>         /// <description>
>         /// The resulting calendar has holidays from both calendars.
>         /// That is, in other words, only common business days.
>         /// </description>
>         /// </item>
>         /// <item>
>         /// <term><c>BusinessDays</c></term>
>         /// <description>
>         /// The resulting calendar has business days from both calendars.
>         /// That is, in other words, only common holidays.
>         /// </description>
>         /// </item>
>         /// </list>
>         /// </remarks>
>         public CombinedCalendar(IBusinessCalendar mainCalendar, IBusinessCalendar
> otherCalendar,
>                 string name, Combine mode)
>                 : base(name, mainCalendar.Culture, mainCalendar.Calendar)
>         {
>                 if( /* mainCalendar == null || */ otherCalendar == null)
>                         throw new NullReferenceException(
>                                 Strings.Get(GetType(), "CalNullRef") );
>                 this.mainCalendar = mainCalendar;
>                 this.otherCalendar = otherCalendar;
>                 this.combineBusinessDays = (mode == Combine.BusinessDays);
>         }
>
>         #endregion
>
>         private IBusinessCalendar mainCalendar;
>         private IBusinessCalendar otherCalendar;
>         private bool combineBusinessDays;
>
>         /// <summary>
>         /// Returns <c>true</c> iff the date is a business day for the given
> market.
>         /// </summary>
>         /// <param name="date">The <see cref="DateTime"/> to check.</param>
>         /// <returns><c>true</c> iff the date is a business day for the given
> market.</returns>
>         override public bool IsBusinessDay(DateTime date)
>         {
>                 bool m = mainCalendar.IsBusinessDay(date);
>                 bool o = otherCalendar.IsBusinessDay(date);
>                 // at least two of three conditions must be true
>                 return (m&&o) || (m&&combineBusinessDays) || (o&&combineBusinessDays);
>         }
> }
>
> > -----Ursprungliche Nachricht-----
> > Von: [hidden email]
> > [mailto:[hidden email]]Im Auftrag von Luigi
> > Ballabio
> > Gesendet: Montag, 27. Januar 2003 11:39
> > An: [hidden email]
> > Cc: [hidden email]
> > Betreff: Re: [Quantlib-users] joint calendar
> >
> >
> > At 08:35 AM 1/27/03 +0000, Chak Jack Wong wrote:
> > >The behavior in Jens' e-mail is exactly what we need.  This is
> > mainly used
> > >for cross-ccy swap.  for USD and Yen swap on Libor , the holiday
> > is typically
> > >NewYork, London and Tokyo (i.e. union of holiday.), and for
> > quite a lot of
> > >swiss product, we use Zurich/London.   This is rather important
> > (yet pretty
> > >simple)
> >
> > Ok, so the relation is:
> >
> > joint.isBusinessDay(d) <= c1.isBusinessDay(d) && c2.isBusinessDay(d)
> >
> > Does anybody think we might need the same thing but with ||
> > instead of && ?
> >
> > Also, I see that one might need more than two calendars. Is three the
> > maximum anybody saw, or did anybody used more complex stuff?
> >
> >
> > >Is it possible to add this simple class to the 0.3.1 release?
> >
> > Not to 0.3.1, sorry---it is already frozen. I can send you the
> > files (once
> > I have them, of course) if you have problems accessing the CVS version.
> >
> > Later,
> >          Luigi
> >
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > Quantlib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> >

--
This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments
mentioned or an official confirmation.  Morgan Stanley may deal as principal in or own or
act as market maker for securities/instruments mentioned or may advise the issuers.  This
may refer to a research analyst/research report. Unless indicated, these views are the
author's and may differ from those of Morgan Stanley research or others in the Firm. We do
not represent this is accurate or complete and we may not update this.  Past performance
is not indicative of future returns. For additional information, research reports and
important disclosures, contact me or see https://secure.ms.com.  You should not use email
to request, authorize or effect the purchase or sale of any security or instrument, to
send transfer instructions, or to effect any other transactions.  We cannot guarantee that
any such requests received via email will be processed in a timely manner.  This
communication is solely for the addressee(s) and may contain confidential information.  We
do not waive confidentiality by mistransmission.  Contact me if you do not wish to receive
these communications.  In the UK, this communication is directed in the UK to those
persons who are market counterparties or intermediate customers (as defined in the UK
Financial Services Authority's rules).




Reply | Threaded
Open this post in threaded view
|

Re: AW: joint calendar

Luigi Ballabio-2
At 12:42 PM 1/27/03 +0000, Chak Jack Wong wrote:
>This is great.  If you can tell me the CVS file I need to update when that
>is in, that will be fabulous.

Jack,
         I'm attaching a C++ translation of Jens' code. You'll have to
replace calendar.hpp, add jointcalendar.[hc]pp to the ql/Calendars folder,
and add the latter files to the VC++ project or ql/Calendars/Makefile.am
depending on which platform you're compiling on.

Bye,
         Luigi


calendar.hpp (6K) Download Attachment
jointcalendar.cpp (4K) Download Attachment
jointcalendar.hpp (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Piecewise constant vol and mean reversion of Hull white

Chak Jack Wong
Hi,
I am wondering if anyone is working on the generalized hull-white model?  (i.e.
with piecewise constant vol and piecewise constant mean reversion?)
This allows exact calibration of the diagonal of swaptions and possibly a cap.
This is very useful for bermudan pricing.

Jack



Reply | Threaded
Open this post in threaded view
|

Time varying vol black scholes

Chak Jack Wong
In reply to this post by Luigi Ballabio-2
Hi,
Is there such a model?  I can't quite find it.
Jack



Reply | Threaded
Open this post in threaded view
|

Re: Piecewise constant vol and mean reversion of Hull white

Ferdinando M. Ametrano-2
In reply to this post by Chak Jack Wong
At 11:54 AM 2/13/2003 +0000, you wrote:
>I am wondering if anyone is working on the generalized hull-white
>model?  (i.e.
>with piecewise constant vol and piecewise constant mean reversion?)
No-one I know of

>This allows exact calibration of the diagonal of swaptions and possibly a cap.
You're right, but while piecewise constant vol/reversion allows for a good
fit it is considered to be a questionable over-parametrization that will
produce unreliable implied curve dynamic.
See Rebonato for more details.

I've used the generalized hull-white model in the past, with only 2 levels
of mean reversion: one for the "short" horizon (< 3/5 years), the other for
the long term rate.
I don't think it would make sense to have more knots for mean reversion

This said I would appreciate to have a generalized hull-white model
contributed to QuantLib, at least to study the implied dynamic, even if I
would be using it with constant parameters


------------
ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

Re: Time varying vol black scholes

Ferdinando M. Ametrano-2
In reply to this post by Chak Jack Wong
Chak wrote:
>[Time varying vol black scholes] Is there such a model?
>I can't quite find it.
There are classes to model Black vol surfaces and local volatilities in 0.3.1
If you have CVS access I would urge you to see/use the current CVS
versions, since they are "under construction"

I will be working on using time-varying vol (and skewed vol, local vol,
etc) as soon as I've finished with the new pricing engine framework. No
plan to extend to time dependant parameters the old framework that will be
deprecated with 0.3.2


------------
ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

Re: Piecewise constant vol and mean reversionof Hull white

Chak Jack Wong
In reply to this post by Ferdinando M. Ametrano-2

Ferdinando Ametrano wrote:

> At 11:54 AM 2/13/2003 +0000, you wrote:
> >I am wondering if anyone is working on the generalized hull-white
> >model?  (i.e.
> >with piecewise constant vol and piecewise constant mean reversion?)
> No-one I know of
>
> >This allows exact calibration of the diagonal of swaptions and possibly a cap.
> You're right, but while piecewise constant vol/reversion allows for a good
> fit it is considered to be a questionable over-parametrization that will
> produce unreliable implied curve dynamic.
> See Rebonato for more details.
>

Depending on how and why you want to use the normal model, what Rebonato says may
or may not apply.
I used to be in exotic interest products, and under that case, we were really
interested in the residual risk of
the product (the exotic risk) we have to carry, the implied curve dynamic doesn't
really matter.  (Of course, for
the exotic pricing, libor market model would be more useful, but one factor
Hull-White is far quicker. )
I think the ability to calibrate at least to the diagonal ( or the diagonal of
swaptions at the strike of the bermudan product )
is essential for exotic pricing.




>
> I've used the generalized hull-white model in the past, with only 2 levels
> of mean reversion: one for the "short" horizon (< 3/5 years), the other for
> the long term rate.
> I don't think it would make sense to have more knots for mean reversion
>

It will be useful to have the mean reversion to have different knots points if you
want to calibrate the individual caplet vols in addition to the diagonal of
swaptions for bermudan type products.  The implied curve dynamic is probably not
important in this case, as we are interested in pricing of the residual exotic
risk. (Again LMM would be better in this sense.  But a very carefully calibrated
Hull-White can do the trick.  e.g. calibrate the skew to the exercise boundary,
etc.)


>
> This said I would appreciate to have a generalized hull-white model
> contributed to QuantLib, at least to study the implied dynamic, even if I
> would be using it with constant parameters
>
> ------------
> ciao -- Nando

--
This is not an offer (or solicitation of an offer) to buy/sell the
securities/instruments mentioned or an official confirmation.  Morgan Stanley may
deal as principal in or own or act as market maker for securities/instruments
mentioned or may advise the issuers.  This may refer to a research analyst/research
report. Unless indicated, these views are the author's and may differ from those of
Morgan Stanley research or others in the Firm. We do not represent this is accurate
or complete and we may not update this.  Past performance is not indicative of
future returns. For additional information, research reports and important
disclosures, contact me or see https://secure.ms.com.  You should not use email to
request, authorize or effect the purchase or sale of any security or instrument, to
send transfer instructions, or to effect any other transactions.  We cannot
guarantee that any such requests received via email will be processed in a timely
manner.  This communication is solely for the addressee(s) and may contain
confidential information.  We do not waive confidentiality by mistransmission.
Contact me if you do not wish to receive these communications.  In the UK, this
communication is directed in the UK to those persons who are market counterparties
or intermediate customers (as defined in the UK Financial Services Authority's
rules).




Reply | Threaded
Open this post in threaded view
|

Re: Piecewise constant vol and mean reversionof Hull white

Ferdinando M. Ametrano-2
Chak wrote:
>we are interested in pricing of the residual exotic
>risk [...] calibrate the skew to the exercise boundary,
got your point. Another reason to have it in QuantLib


------------
ciao -- Nando