public YoYInflationTermStructureHandle(YoYInflationTermStructure arg0) : this(NQuantLibcPINVOKE.new_YoYInflationTermStructureHandle__SWIG_0(YoYInflationTermStructure.getCPtr(arg0)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #2
0
 public void linkTo(YoYInflationTermStructure arg0)
 {
     NQuantLibcPINVOKE.RelinkableYoYInflationTermStructureHandle_linkTo(swigCPtr, YoYInflationTermStructure.getCPtr(arg0));
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public YoYInflationTermStructure __deref__()
        {
            YoYInflationTermStructure ret = new YoYInflationTermStructure(NQuantLibcPINVOKE.YoYInflationTermStructureHandle___deref__(swigCPtr), true);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public YoYInflationTermStructure __deref__()
        {
            global::System.IntPtr     cPtr = NQuantLibcPINVOKE.YoYInflationTermStructureHandle___deref__(swigCPtr);
            YoYInflationTermStructure ret  = (cPtr == global::System.IntPtr.Zero) ? null : new YoYInflationTermStructure(cPtr, true);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #5
0
            // setup
            public CommonVars()
            {
                // option variables
                nominals = new List <double>()
                {
                    1000000
                };
                frequency = Frequency.Annual;
                // usual setup
                volatility = 0.01;
                length     = 7;
                calendar   = new UnitedKingdom();
                convention = BusinessDayConvention.ModifiedFollowing;
                Date today = new Date(13, Month.August, 2007);

                evaluationDate = calendar.adjust(today);
                Settings.setEvaluationDate(evaluationDate);
                settlementDays = 0;
                fixingDays     = 0;
                settlement     = calendar.advance(today, settlementDays, TimeUnit.Days);
                startDate      = settlement;
                dc             = new Thirty360();

                // yoy index
                //      fixing data
                Date     from        = new Date(1, Month.January, 2005);
                Date     to          = new Date(13, Month.August, 2007);
                Schedule rpiSchedule = new MakeSchedule().from(from).to(to)
                                       .withTenor(new Period(1, TimeUnit.Months))
                                       .withCalendar(new UnitedKingdom())
                                       .withConvention(BusinessDayConvention.ModifiedFollowing).value();

                double[] fixData = { 189.9,  189.9, 189.6, 190.5, 191.6, 192.0,
                                     192.2,  192.2, 192.6, 193.1, 193.3, 193.6,
                                     194.1,  193.4, 194.2, 195.0, 196.5, 197.7,
                                     198.5,  198.5, 199.2, 200.1, 200.4, 201.1,
                                     202.7,  201.6, 203.1, 204.4, 205.4, 206.2,
                                     207.3, -999.0, -999 };
                // link from yoy index to yoy TS
                bool interp = false;

                iir = new YYUKRPIr(interp, hy);
                for (int i = 0; i < rpiSchedule.Count; i++)
                {
                    iir.addFixing(rpiSchedule[i], fixData[i]);
                }

                YieldTermStructure nominalFF = new FlatForward(evaluationDate, 0.05, new ActualActual());

                nominalTS.linkTo(nominalFF);

                // now build the YoY inflation curve
                Period observationLag = new Period(2, TimeUnit.Months);

                Datum[] yyData =
                {
                    new Datum(new Date(13, Month.August, 2008),  2.95),
                    new Datum(new Date(13, Month.August, 2009),  2.95),
                    new Datum(new Date(13, Month.August, 2010),  2.93),
                    new Datum(new Date(15, Month.August, 2011), 2.955),
                    new Datum(new Date(13, Month.August, 2012), 2.945),
                    new Datum(new Date(13, Month.August, 2013), 2.985),
                    new Datum(new Date(13, Month.August, 2014),  3.01),
                    new Datum(new Date(13, Month.August, 2015), 3.035),
                    new Datum(new Date(13, Month.August, 2016), 3.055),                                // note that
                    new Datum(new Date(13, Month.August, 2017), 3.075),                                // some dates will be on
                    new Datum(new Date(13, Month.August, 2019), 3.105),                                // holidays but the payment
                    new Datum(new Date(15, Month.August, 2022), 3.135),                                // calendar will roll them
                    new Datum(new Date(13, Month.August, 2027), 3.155),
                    new Datum(new Date(13, Month.August, 2032), 3.145),
                    new Datum(new Date(13, Month.August, 2037), 3.145)
                };

                // now build the helpers ...
                List <BootstrapHelper <YoYInflationTermStructure> > helpers =
                    makeHelpers(yyData, yyData.Length, iir,
                                observationLag,
                                calendar, convention, dc);

                double baseYYRate = yyData[0].rate / 100.0;
                PiecewiseYoYInflationCurve <Linear> pYYTS = new PiecewiseYoYInflationCurve <Linear>(
                    evaluationDate, calendar, dc, observationLag,
                    iir.frequency(), iir.interpolated(), baseYYRate,
                    new Handle <YieldTermStructure>(nominalTS), helpers);

                pYYTS.recalculate();
                yoyTS = pYYTS as YoYInflationTermStructure;


                // make sure that the index has the latest yoy term structure
                hy.linkTo(pYYTS);
            }
Пример #6
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(YoYInflationTermStructure obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
 public YoYInflationTermStructure __deref__() {
   YoYInflationTermStructure ret = new YoYInflationTermStructure(NQuantLibcPINVOKE.YoYInflationTermStructureHandle___deref__(swigCPtr), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
 public YoYInflationTermStructureHandle(YoYInflationTermStructure arg0) : this(NQuantLibcPINVOKE.new_YoYInflationTermStructureHandle__SWIG_0(YoYInflationTermStructure.getCPtr(arg0)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public void linkTo(YoYInflationTermStructure arg0) {
   NQuantLibcPINVOKE.RelinkableYoYInflationTermStructureHandle_linkTo(swigCPtr, YoYInflationTermStructure.getCPtr(arg0));
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Пример #10
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(YoYInflationTermStructure obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }