Пример #1
0
 private Func<IList<double>, double> GetHeightMinFuncEx(CorridorByStDevRatio func) {
   switch(func) {
     case CorridorByStDevRatio.HPAverage:
       return values => values.StandardDeviation().Avg(values.StDevByRegressoin());
     case CorridorByStDevRatio.Height:
       return values => values.StDevByRegressoin();
     case CorridorByStDevRatio.Price:
       return values => values.StandardDeviation();
     case CorridorByStDevRatio.HeightPrice:
       return values => values.StandardDeviation() + values.StDevByRegressoin();
     case CorridorByStDevRatio.Height2:
       return values => values.StDevByRegressoin() * 2;
     case CorridorByStDevRatio.Price12:
       return values => values.StandardDeviation() * _stDevUniformRatio / 2;
     case CorridorByStDevRatio.Price2:
       return values => values.StandardDeviation() * 2;
     default:
       throw new NotSupportedException(new { CorridorByStDevRatioFunc } + "");
   }
 }
Пример #2
0
 private Func<double> GetHeightMinFunc(CorridorByStDevRatio func) {
   switch(func) {
     case CorridorByStDevRatio.HPAverage:
       return () => StDevByPriceAvg.Avg(StDevByHeight);
     case CorridorByStDevRatio.Height:
       return () => StDevByHeight;
     case CorridorByStDevRatio.Price:
       return () => StDevByPriceAvg;
     case CorridorByStDevRatio.HeightPrice:
       return () => StDevByPriceAvg + StDevByHeight;
     case CorridorByStDevRatio.Height2:
       return () => StDevByHeight * 2;
     case CorridorByStDevRatio.Price12:
       return () => StDevByPriceAvg * _stDevUniformRatio / 2;
     case CorridorByStDevRatio.Price2:
       return () => StDevByPriceAvg * 2;
     default:
       throw new NotSupportedException(new { CorridorByStDevRatioFunc } + "");
   }
 }