Пример #1
0
 ///<summary>
 ///</summary>
 ///<param name="cfDays"></param>
 ///<param name="cf"></param>
 ///<param name="curve"></param>
 ///<param name="instrumentNumber"></param>
 ///<param name="interpSpace"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="method"></param>
 ///<returns></returns>
 public double PVFromCurve(Excel.Range cfDays, Excel.Range cf, Excel.Range curve, int instrumentNumber, string interpSpace, double zeroCompFreq, string method)
 {
     object[,] cfds   = cfDays.Value[System.Reflection.Missing.Value] as object[, ];
     object[,] cfs    = cf.Value[System.Reflection.Missing.Value] as object[, ];
     object[,] values = curve.Value[System.Reflection.Missing.Value] as object[, ];
     return(InterpolationFunctions.PVFromCurve(ArrayHelper.RangeToMatrix(cfds), ArrayHelper.RangeToMatrix(cfs), ArrayHelper.RangeToMatrix(values)
                                               , instrumentNumber, interpSpace, zeroCompFreq, method));
 }
Пример #2
0
 ///<summary>
 ///</summary>
 ///<param name="xyData"></param>
 ///<param name="interpX"></param>
 ///<param name="interpSpace"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="method"></param>
 ///<returns></returns>
 public double GeneralZeroInterp(Excel.Range xyData, double interpX, string interpSpace, double zeroCompFreq, string method)
 {
     object[,] values = xyData.Value[System.Reflection.Missing.Value] as object[, ];
     interpSpace      = interpSpace.ToUpper();
     interpSpace      = interpSpace.Trim();
     method           = method.ToUpper();
     method           = method.Trim();
     return(InterpolationFunctions.GeneralZeroInterp(ArrayHelper.RangeToMatrix(values), interpX, interpSpace, zeroCompFreq, method));
 }
Пример #3
0
 ///<summary>
 ///</summary>
 ///<param name="cf"></param>
 ///<param name="cfDays"></param>
 ///<param name="interpSpace"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="method"></param>
 ///<param name="seedRates"></param>
 ///<returns></returns>
 public object[,] ZeroCalc(Excel.Range cf, Excel.Range cfDays, string interpSpace, double zeroCompFreq, string method, Excel.Range seedRates)
 {
     object[,] cfs    = cf.Value[System.Reflection.Missing.Value] as object[, ];
     object[,] cfDay  = cfDays.Value[System.Reflection.Missing.Value] as object[, ];
     object[,] values = seedRates.Value[System.Reflection.Missing.Value] as object[, ];
     interpSpace      = interpSpace.ToUpper();
     interpSpace      = interpSpace.Trim();
     method           = method.ToUpper();
     method           = method.Trim();
     return(InterpolationFunctions.ZeroCalc(ArrayHelper.RangeToMatrix(cfs), ArrayHelper.RangeToMatrix(cfDay), interpSpace, zeroCompFreq, method, ArrayHelper.RangeToMatrix(values)));
 }
Пример #4
0
 ///<summary>
 ///</summary>
 ///<param name="startTime"></param>
 ///<param name="matTime"></param>
 ///<param name="curve"></param>
 ///<param name="interpSpace"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="method"></param>
 ///<returns></returns>
 public double FwDfromCurve(double startTime, double matTime, Excel.Range curve, string interpSpace, double zeroCompFreq, string method)
 {
     object[,] values = curve.Value[System.Reflection.Missing.Value] as object[, ];
     return(InterpolationFunctions.FWDfromCurve(startTime, matTime, ArrayHelper.RangeToMatrix(values), interpSpace, zeroCompFreq, method));
 }
Пример #5
0
 ///<summary>
 ///</summary>
 ///<param name="df"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="T"></param>
 ///<returns></returns>
 public double DF2Zero(double df, double zeroCompFreq, double T)
 {
     return(InterpolationFunctions.DF2Zero(df, zeroCompFreq, T));
 }
Пример #6
0
 ///<summary>
 ///</summary>
 ///<param name="zero"></param>
 ///<param name="zeroCompFreq"></param>
 ///<param name="T"></param>
 ///<returns></returns>
 public double Zero2DF(double zero, double zeroCompFreq, double T)
 {
     return(InterpolationFunctions.Zero2DF(zero, zeroCompFreq, T));
 }
Пример #7
0
 ///<summary>
 ///</summary>
 ///<param name="xyzData"></param>
 ///<param name="x"></param>
 ///<param name="y"></param>
 ///<returns></returns>
 public double BiLinearInterp2(Excel.Range xyzData, double x, double y)
 {
     object[,] values = xyzData.Value[System.Reflection.Missing.Value] as object[, ];
     return(InterpolationFunctions.BiLinearInterp2(ArrayHelper.RangeToMatrix(values), x, y));
 }
Пример #8
0
 ///<summary>
 ///</summary>
 ///<param name="xyData"></param>
 ///<param name="x"></param>
 ///<param name="col1"></param>
 ///<param name="col2"></param>
 ///<returns></returns>
 public double LogLinearInterp(Excel.Range xyData, double x, int col1, int col2)
 {
     object[,] values = xyData.Value[System.Reflection.Missing.Value] as object[, ];
     return(InterpolationFunctions.LogLinearInterp(Misc.Extract2Columns(ArrayHelper.RangeToMatrix(values), col1, col2), x));
 }