Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14226


Ignore:
Timestamp:
08/02/16 16:16:29 (8 years ago)
Author:
gkronber
Message:

#2649 adapted OnlineSharpeRatioCalculator and OnlineNormalizedMeanSquaredErrorCalculator to use PopulationVariance instead of Variance (minor difference for vectors with only a few elements)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineSharpeRatioCalculator.cs

    r14185 r14226  
    3131    public double SharpeRatio {
    3232      get {
    33         if (meanAndVarianceCalculator.Variance > 0)
    34           return meanAndVarianceCalculator.Mean / Math.Sqrt(meanAndVarianceCalculator.Variance);
     33        if (meanAndVarianceCalculator.PopulationVariance > 0)
     34          return meanAndVarianceCalculator.Mean / Math.Sqrt(meanAndVarianceCalculator.PopulationVariance);
    3535        else return 0.0;
    3636      }
     
    4646    public OnlineCalculatorError ErrorState {
    4747      get {
    48         return meanAndVarianceCalculator.MeanErrorState | meanAndVarianceCalculator.VarianceErrorState | profitCalculator.ErrorState;
     48        return meanAndVarianceCalculator.MeanErrorState | meanAndVarianceCalculator.PopulationVarianceErrorState | profitCalculator.ErrorState;
    4949      }
    5050    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineNormalizedMeanSquaredErrorCalculator.cs

    r14185 r14226  
    3030    public double NormalizedMeanSquaredError {
    3131      get {
    32         double var = originalVarianceCalculator.Variance;
     32        double var = originalVarianceCalculator.PopulationVariance;
    3333        double m = meanSquaredErrorCalculator.Mean;
    3434        return var > 0 ? m / var : 0.0;
     
    4444    #region IOnlineCalculator Members
    4545    public OnlineCalculatorError ErrorState {
    46       get { return meanSquaredErrorCalculator.MeanErrorState | originalVarianceCalculator.VarianceErrorState; }
     46      get { return meanSquaredErrorCalculator.MeanErrorState | originalVarianceCalculator.PopulationVarianceErrorState; }
    4747    }
    4848    public double Value {
Note: See TracChangeset for help on using the changeset viewer.