Ejemplo n.º 1
0
        ///<summary>
        /// Gets the interpolated value from the curve.
        ///</summary>
        ///<param name="baseDate">The based date.</param>
        ///<param name="targetDate">The target date.</param>
        /// <param name="interpolationType">The interpolation.</param>
        /// <param name="extrapolation">if set to <c>true</c> [extrapolation].</param>
        /// <param name="times">A vetical array of times.</param>
        /// <param name="values">A vertical array of values.</param>
        /// <returns>The value at that point.</returns>
        public Double GetDateValue(DateTime baseDate, DateTime targetDate, string interpolationType, bool extrapolation, Excel.Range times, Excel.Range values)
        {
            List <double> unqtimes  = DataRangeHelper.StripDoubleRange(times);
            List <double> unqvalues = DataRangeHelper.StripDoubleRange(values);
            IPoint        point     = new DateTimePoint1D(baseDate, targetDate);

            return(CurveAnalytics.GetDateValue(point, interpolationType, extrapolation, unqtimes.ToArray(), unqvalues.ToArray()));
        }
Ejemplo n.º 2
0
        public void TestGetValue2()
        {
            var baseDate = new DateTime(2008, 3, 3);

            for (var i = 1; i < 10; i++)
            {
                var    targetDate = baseDate.AddMonths(3 * i);
                IPoint point      = new DateTimePoint1D(baseDate, targetDate);
                var    result     = CurveAnalytics.GetDateValue(point, interp, true, times, rates);
                Debug.WriteLine(String.Format("rate : {0} Date: {1}", targetDate, result));
            }
        }
Ejemplo n.º 3
0
        public void TestGetValue2()
        {
            var baseDate = new DateTime(2008, 3, 3);

            for (var i = 1; i < 10; i++)
            {
                var    targetDate = baseDate.AddMonths(3 * i);
                IPoint point      = new DateTimePoint1D(baseDate, targetDate);
                var    result     = CurveAnalytics.GetDateValue(point, Interp, true, Times, Rates);
                Debug.WriteLine($"rate : {targetDate} Date: {result}");
            }
        }