///<summary> ///</summary> ///<param name="ratedaysAsArray"></param> ///<param name="rateamtsAsArray"></param> ///<param name="divdaysAsArray"></param> ///<param name="divamtsAsArray"></param> ///<param name="voltimesAsArray"></param> ///<param name="volatilitiesAsRange"></param> ///<param name="spot"></param> ///<param name="callstrike"></param> ///<param name="putstrike"></param> ///<param name="maturity"></param> ///<param name="kappa"></param> ///<param name="theta"></param> ///<param name="sigma"></param> ///<param name="profiletimes"></param> ///<param name="confidence"></param> ///<param name="tstepSize"></param> ///<param name="simulations"></param> ///<param name="seed"></param> ///<returns></returns> public double[,] GetCollarPCE(Excel.Range ratedaysAsArray, Excel.Range rateamtsAsArray, Excel.Range divdaysAsArray, Excel.Range divamtsAsArray, Excel.Range voltimesAsArray, Excel.Range volatilitiesAsRange, double spot, double callstrike, double putstrike, double maturity, double kappa, double theta, double sigma, Excel.Range profiletimes, double confidence, double tstepSize, int simulations, int seed) { //Map Ranges var rateamts = DataRangeHelper.StripDoubleRange(rateamtsAsArray); var divamts = DataRangeHelper.StripDoubleRange(divamtsAsArray); var voltimes = DataRangeHelper.StripDoubleRange(voltimesAsArray); var divdays = DataRangeHelper.StripIntRange(divdaysAsArray); var ratedays = DataRangeHelper.StripIntRange(ratedaysAsArray); var profile = DataRangeHelper.StripDoubleRange(profiletimes); var volatilities = volatilitiesAsRange.Value[System.Reflection.Missing.Value] as object[, ]; var volatilitiesAsDoubles = RangeHelper.RangeToDoubleMatrix(volatilities); List <OrcWingParameters> volSurf = UnpackWing(volatilitiesAsDoubles, voltimes.ToArray(), spot, ratedays.ToArray(), rateamts.ToArray(), divdays.ToArray(), divamts.ToArray()); CleanDivs(ref divdays, ref divamts); double[,] results = EquityPCEAnalytics.GetCollarPCE("CollarPCE", ratedays.ToArray(), rateamts.ToArray(), divdays.ToArray(), divamts.ToArray(), volSurf, spot, callstrike, putstrike, maturity, kappa, theta, sigma, profile.ToArray(), confidence, tstepSize, simulations, seed); //int n = profiletimes.Length; //var lhs = new double[profiletimes.Length]; //for (int i = 0; i < n; i++) //{ // lhs[i] = results[i, 1]; //} return(results); }