Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="c"></param>
        public void AddCrossTableRegressions(Country c)
        {
            IDictionary <string, int> exclude = new Dictionary <string, int>();

            var x = IntelCore.ColumnConfigs.Keys.ToArray();

            for (var a = 0; a < x.Length; a++)
            {
                for (var b = 0; b < x.Length; b++)
                {
                    if (a != b)
                    {
                        var statName = $"{x[a]}_{x[b]}";
                        var reverse  = $"{x[b]}_{x[a]}";

                        if (!exclude.ContainsKey(statName))
                        {
                            var m = IntelCore.XValue(x[a], c);
                            var n = IntelCore.XValue(x[b], c);

                            if (!Stats.ContainsKey(statName))
                            {
                                Stats.Add(statName, new Statistic());
                            }
                            //Console.WriteLine($"AddStat: {statName}");

                            if (!(m is double.NaN || n is double.NaN))
                            {
                                Stats[statName].Add(m, n);
                            }

                            exclude.Add(reverse, 0);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public double Stand(string statName, Country c)
        {
            var xy = statName.Split('_');

            return(Stand(statName, IntelCore.XValue(xy[0], c), IntelCore.XValue(xy[1], c)));
        }