示例#1
0
        public static bool IsUniformWithChiSquare(int n, ReportList list)
        {
            List<Tuple<int, float, int, float>> data = ChiSquare(n, list);
            float sum = data.Sum(tuple => tuple.Item4);

            return !(sum > 16.919f);
        }
示例#2
0
 public ReportList(ReportList data)
 {
     InnerData = new List<float>(data.InnerData);
     Modoluse = data.Modoluse;
     Seed = data.Seed;
     Multiplier = data.Multiplier;
     Increment = data.Increment;
 }
示例#3
0
 public Report(ReportList data, List<Tuple<int, int>> analysisMultiplier, List<Tuple<int, int>> analysisIncrement,
     List<Tuple<int, int>> analysisSeed)
 {
     InitializeComponent();
     _reportList = data;
     _analysisOverMultiplier = analysisMultiplier;
     _analysisOverIncrement = analysisIncrement;
     _analysisOverSeed = analysisSeed;
 }
示例#4
0
        public static List<Tuple<int, float, int, float>> ChiSquare(int n, ReportList list)
        {
            var rL = new List<Tuple<int, float, int, float>>();

            for (int i = 0; i < n; i++)
            {
                var range = new Range(i*(1/(float) n), ((i + 1)*(1/(float) n)));
                int oi = list.GetNumberOfObservationInRange(range);
                int ei = list.InnerData.Count/n;
                float oiei = ((oi - ei)*(oi - ei)/(float) ei);
                rL.Add(new Tuple<int, float, int, float>(i + 1, oi, ei, oiei));
            }

            return rL;
        }
示例#5
0
        public static List<Tuple<int, float, float, float, float, float>> KSTest(ReportList list)
        {
            var rL = new List<Tuple<int, float, float, float, float, float>>();
            var cloneList = new List<float>(list.InnerData);
            cloneList.BubbleSort();
            int n = cloneList.Count;

            for (int i = 0; i < n; i++)
            {
                float ri = cloneList[i];
                float iDivn = (i + 1)/(float) n;
                float i1Divn = i/(float) n;
                rL.Add(new Tuple<int, float, float, float, float, float>(i + 1, ri, iDivn, i1Divn, Math.Abs(iDivn - ri),
                                                                         Math.Abs(ri - i1Divn)));
            }

            return rL;
        }
示例#6
0
        //public static List<>
        public static List<Tuple<int, int, int, float>> PokerTest(ReportList list)
        {
            var rL = new List<Tuple<int, int, int, float>>();
            int n = list.GetLength;
            int len = list.GetNumbersMaxLen;
            List<float> plist = PmList(len);

            int counter = 1;
            foreach (float item in plist)
            {
                double nei = Math.Round(n*item);
                int observation = list.GetDuplicationOccurrences(len - (counter - 1));
                rL.Add(new Tuple<int, int, int, float>(counter, observation, (int) nei,
                                                       (float) (Math.Pow(observation - nei, 2)/(float) nei)));
                counter++;
            }

            return rL;
        }
示例#7
0
 public static bool IsUniformWithKS(ReportList list)
 {
     return IsUniformWithKS(KSTest(list));
 }