Exemplo n.º 1
0
        public AnalyticRuleSettings Aggregate()
        {
            ReliabilityEvaluator            evaluator   = new ReliabilityEvaluator(item);
            AnalyticItemSettingsReliability reliability = evaluator.Evaluate();
            AnalyticRuleSettings            result      =
                new AnalyticRuleSettings(item.Type, reliability);

            result.EngineType       = item.TargetEngineType;
            result.EngineFamilyType = item.TargetEngineFamilyType;

            // 1. Get math expectation
            double m = item.GetDoubleValues().Average();
            // 2. Get Sigma
            double sigma = Sigma.Get(item.GetDoubleValues().ToList());
            float  a     = StandardAggregatorSettings.OptimalBound;
            float  b     = StandardAggregatorSettings.MaxAcceptableBound;

            result.SettingsMolecule.StatisticalAtom.MinOptimal = 0;
            // 3. Get optimal bound as M + A*Sigma
            result.SettingsMolecule.StatisticalAtom.
            MaxOptimal = m + a * sigma;
            // 4. Get acceptable bound as M + B*Sigma
            result.SettingsMolecule.StatisticalAtom.
            MaxAcceptable = m + b * sigma;
            result.SettingsMolecule.StatisticalAtom.MinAcceptable = 0;
            return(result);
        }
Exemplo n.º 2
0
        public AnalyticRuleSettings Aggregate()
        {
            ReliabilityEvaluator evaluator = new ReliabilityEvaluator(item);
            AnalyticRuleSettings result    =
                new AnalyticRuleSettings(item.Type, evaluator.Evaluate());

            result.EngineType       = item.TargetEngineType;
            result.EngineFamilyType = item.TargetEngineFamilyType;

            // 1. get median
            double M = item.GetDoubleValues().Average();

            // 2. Get Sigma
            double sigma = Sigma.Get(item.GetDoubleValues().ToList());

            // 3. Get a and b values
            float a = StandardAggregatorSettings.OptimalBound;
            float b = StandardAggregatorSettings.MaxAcceptableBound;

            // 4. Get optimal bounds as M +/- a*sigma
            result.SettingsMolecule.StatisticalAtom.MinOptimal = M - a * sigma;
            result.SettingsMolecule.StatisticalAtom.MaxOptimal = M + a * sigma;

            // 5. Get acceptable bounds as M +/- b*sigma
            result.SettingsMolecule.StatisticalAtom.MinAcceptable = M - b * sigma;
            result.SettingsMolecule.StatisticalAtom.MaxAcceptable = M + b * sigma;

            return(result);
        }