예제 #1
0
        //This function generate statistic data to summarizations in extended form.
        //It checks dependences beetwen duarion and dynamic of change, and also beetwen variability and dynamic of change.
        public List<SummaryRating> extendedFormDagrees(TrendsStatistics[] trendsStatistics, SummarizationParameters sumParams)
        {
            TrendsStatistics changeStatistics = new TrendsStatistics();
            ImprecisionDegree imp = new ImprecisionDegree();
            double characteristic = 0;
            SummaryRating extendedSummary = new SummaryRating();
            double[] dynamicOfChangeSum = new double[trendsStatistics[0].dynamicOfChangeData.Length];

            //here we will gather all characteristics with their dagrees
            List<SummaryRating> extendedSummaryRating = new List<SummaryRating>();

            //dagree of focus
            for (int i = 0; i < trendsStatistics.Length; i++)
            {
                changeStatistics.addStatisticValues(changeStatistics, trendsStatistics[i]);
            }

            for (int c = 0; c < trendsStatistics[0].dynamicOfChangeData.Length; c++)
            {
                dynamicOfChangeSum[c] = changeStatistics.dynamicOfChangeData[c].value;
            }

            //dagree of imprecision
            imp = calculateImprecision(sumParams);

            //dagree of truth: dynamic of change and duration
            for (int c = 0; c < trendsStatistics[0].dynamicOfChangeData.Length; c++)
            {
                for (int d = 0; d < trendsStatistics[0].durationData.Length; d++)
                {
                    for (int i = 0; i < trendsStatistics.Length; i++)
                    {
                        characteristic += (trendsStatistics[i].durationData[d].value < trendsStatistics[i].dynamicOfChangeData[c].value)
                                ? trendsStatistics[i].durationData[d].value : trendsStatistics[i].dynamicOfChangeData[c].value;
                    }

                    extendedSummary.type = 2;
                    extendedSummary.P = trendsStatistics[0].durationData[d].name;
                    extendedSummary.R = trendsStatistics[0].dynamicOfChangeData[c].name;
                    extendedSummary.truthCoefficient = characteristic / dynamicOfChangeSum[c];
                    extendedSummary.focusDagree = dynamicOfChangeSum[c] / trendsStatistics.Length;
                    extendedSummary.imprecisionDegree = 0.5 * imp.durationImprecision + 0.5 * imp.dynamicOfChangeImprecision;
                    extendedSummaryRating.Add(extendedSummary);
                    extendedSummary = new SummaryRating();
                    characteristic = 0;
                }
            }

            //dagree of truth: dynamic of change and variability
            for (int c = 0; c < trendsStatistics[0].dynamicOfChangeData.Length; c++)
            {
                for (int v = 0; v < trendsStatistics[0].variabilityData.Length; v++)
                {
                    for (int i = 0; i < trendsStatistics.Length; i++)
                    {
                        characteristic += (trendsStatistics[i].variabilityData[v].value < trendsStatistics[i].dynamicOfChangeData[c].value)
                                ? trendsStatistics[i].variabilityData[v].value : trendsStatistics[i].dynamicOfChangeData[c].value;
                    }

                    extendedSummary.type = 2;
                    extendedSummary.P = trendsStatistics[0].variabilityData[v].name;
                    extendedSummary.R = trendsStatistics[0].dynamicOfChangeData[c].name;
                    extendedSummary.truthCoefficient = characteristic / dynamicOfChangeSum[c];
                    extendedSummary.focusDagree = dynamicOfChangeSum[c] / trendsStatistics.Length;
                    extendedSummary.imprecisionDegree = 0.5 * imp.variabilityImprecision + 0.5 * imp.dynamicOfChangeImprecision;
                    extendedSummaryRating.Add(extendedSummary);
                    extendedSummary = new SummaryRating();
                    characteristic = 0;
                }
            }

            return extendedSummaryRating;
        }
예제 #2
0
        //Here we gather all data about trends and make statistics, wchich tell us for example how many (in fuzzy value -> [0,1]) trends are quickly increasing
        public List<SummaryRating> shortFormDegrees(TrendsStatistics[] trendsStatistics, SummarizationParameters sumParams)
        {
            List<SummaryRating> shortSummaryRating = new List<SummaryRating>();
            SummaryRating shortSummary = new SummaryRating();
            TrendsStatistics sumStatistics = new TrendsStatistics();
            ImprecisionDegree imp = new ImprecisionDegree();

            int numberOfTrends = trendsStatistics.Length;

            //dagree of imprecision
            imp = calculateImprecision(sumParams);

            for (int i = 0; i < trendsStatistics.Length; i++)
            {
                sumStatistics.addStatisticValues(sumStatistics, trendsStatistics[i]);
            }

            for (int i = 0; i < sumStatistics.dynamicOfChangeData.Length; i++)
            {
                shortSummary.type = 1;
                shortSummary.P = trendsStatistics[0].dynamicOfChangeData[i].name;
                shortSummary.truthCoefficient = sumStatistics.dynamicOfChangeData[i].value / numberOfTrends;
                shortSummary.imprecisionDegree = imp.dynamicOfChangeImprecision;
                shortSummaryRating.Add(shortSummary);
                shortSummary = new SummaryRating();
            }

            for (int i = 0; i < sumStatistics.durationData.Length; i++)
            {
                shortSummary.type = 1;
                shortSummary.P = trendsStatistics[0].durationData[i].name;
                shortSummary.truthCoefficient = sumStatistics.durationData[i].value / numberOfTrends;
                shortSummary.imprecisionDegree = imp.durationImprecision;
                shortSummaryRating.Add(shortSummary);
                shortSummary = new SummaryRating();
            }

            for (int i = 0; i < sumStatistics.variabilityData.Length; i++)
            {
                shortSummary.type = 1;
                shortSummary.P = trendsStatistics[0].variabilityData[i].name;
                shortSummary.truthCoefficient = sumStatistics.variabilityData[i].value / numberOfTrends;
                shortSummary.imprecisionDegree = imp.variabilityImprecision;
                shortSummaryRating.Add(shortSummary);
                shortSummary = new SummaryRating();
            }

            return shortSummaryRating;
        }