/// <summary>
        /// Gets the information scores for all experts, sorted by score.
        /// </summary>
        /// <returns>The information scores.</returns>
        public List <Tuple <Expert, double> > GetInformationScores()
        {
            var scores = Experts.Select(x => new Tuple <Expert, double> (x, GetInformationScore(x)))
                         .ToList();

            scores.Sort((x, y) => y.Item2.CompareTo(x.Item2));
            return(scores);
        }
Example #2
0
        /// <summary>
        /// Gets the weights for all experts, sorted.
        /// </summary>
        /// <returns>The weights.</returns>
        public IEnumerable <Tuple <Expert, double> > GetWeights()
        {
            var scores = Experts.Select(x => new Tuple <Expert, double> (x, GetCalibrationScore(x) * GetInformationScore(x)))
                         .ToList();

            scores.Sort((x, y) => y.Item2.CompareTo(x.Item2));
            var scaling = scores.Sum(x => x.Item2);

            return(scores.Select(x => new Tuple <Expert, double> (x.Item1, x.Item2 / scaling)));
        }
        /// <summary>
        /// Gets the weights for all experts, sorted.
        /// </summary>
        /// <returns>The weights.</returns>
        public IEnumerable <Tuple <Expert, double> > GetWeights(double alpha = 0)
        {
            var scores = Experts.Select(x => {
                var c = GetCalibrationScore(x);
                var i = GetInformationScore(x);
                return(new Tuple <Expert, double> (x, ((c >= alpha) ? c : 0) * i));
            }).ToList();

            scores.Sort((x, y) => y.Item2.CompareTo(x.Item2));
            var scaling = scores.Sum(x => x.Item2);

            return(!(scaling > 0) ? scores : scores.Select(x => new Tuple <Expert, double> (x.Item1, x.Item2 / scaling)));
        }
        private void RefreshAggregatedVectorMethod()
        {
            var norm    = Sqrt(Experts.Select(e => e.Weight).Sum(x => x * x));
            var vectors = Experts.Select(
                e => new Vector(
                    e.GlobalPriorityVector.GetColumn(0).Select(x => Pow(x, e.Weight / norm)).ToArray()
                    )
                ).ToList();

            var temp = new Matrix(vectors);

            var res = new Vector(temp.N);

            for (int i = 0; i < temp.N; ++i)
            {
                res[i] = Mult(temp.GetRow(i).X);
            }

            AggregatedVector = new Matrix(res);
            SelectedExpert.RefreshGlobalPriorityVector();
        }