Esempio n. 1
0
        private double S0ij(InitialAnalysMultidimensionalData X, InitialAnalysMultidimensionalData Y, int i, int j, double N1, double N2)
        {
            double rez = 0;
            double xij = 0,
                   yij = 0,
                   xi  = 0,
                   xj  = 0,
                   yi  = 0,
                   yj  = 0;

            xi = X.ISA[i].unsortl.Sum();
            yi = Y.ISA[i].unsortl.Sum();
            xj = X.ISA[j].unsortl.Sum();
            yj = Y.ISA[j].unsortl.Sum();
            for (int L = 0; L < N1; L++)
            {
                xij += X.ISA[i].unsortl[L] * X.ISA[j].unsortl[L];
            }
            for (int L = 0; L < N2; L++)
            {
                yij += Y.ISA[i].unsortl[L] * Y.ISA[j].unsortl[L];
            }
            rez  = -(xi + yi) * (xj + yj) / (N1 + N2);
            rez += xij + yij;
            rez /= N1 + N2 - 2;
            return(rez);
        }
 private double[,] xdF(InitialAnalysMultidimensionalData IAMD)
 {
     double[,] rez = new double[1, IAMD.n];
     for (int i = 0; i < IAMD.Ex.Length; i++)
     {
         rez[0, i] = IAMD.Ex[i];
     }
     return(rez);
 }
Esempio n. 3
0
        public Data SravnSredF(InitialAnalysMultidimensionalData X, InitialAnalysMultidimensionalData Y)
        {
            Data rez = new Data();

            double[,] S0 = S0F(X, Y);
            double[,] S1 = S1F(X, Y);
            rez.Name     = "Рівність багатомірних середніх при рівності DC матриці";
            rez.Q        = -(N1 + N2 - 2 - n / 2) * Math.Log(Matrix.Determinant(S1) / Matrix.Determinant(S0));
            rez.QKvant   = Hi.HIF(X.ISA[0].alf.Q, n);
            rez.H        = rez.Q <= rez.QKvant;
            return(rez);
        }
Esempio n. 4
0
        private double[,] S0F(InitialAnalysMultidimensionalData X, InitialAnalysMultidimensionalData Y)
        {
            int n = X.ISA.Count;

            double[,] rez = new double[n, n];
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    rez[i, j] = S0ij(X, Y, i, j, X.ISA[0].unsortl.Length, Y.ISA[0].unsortl.Length);
                }
            }
            return(rez);
        }
        static public double Normalf(InitialAnalysMultidimensionalData IAM, double[] X)
        {
            double[,] Xm = new double[1, IAM.n];
            double[,] E  = new double[1, IAM.n];
            for (int c = 0; c < IAM.n; c++)
            {
                E[0, c]  = IAM.Ex[c];
                Xm[0, c] = X[c] - IAM.Ex[c];
            }
            double znam = Math.Sqrt(Math.Pow(2 * Math.PI, IAM.n) * Matrix.Determinant(IAM.DC));

            double[,] XEX = Matrix.MultiplicNumber(Matrix.MultiplicMatrix(
                                                       Matrix.MultiplicMatrix(Xm, Matrix.InverseMatrix(IAM.DC)), Matrix.TranspMatrix(Xm))
                                                   , -0.5);
            return(Math.Exp(XEX[0, 0]) / znam);
        }
 private double[,] SdF(InitialAnalysMultidimensionalData IAMD)
 {
     double[,] rez;
     double[,] X = new double[IAMD.N, IAMD.n];
     double[,] XT;
     double[,] Ex = xdF(IAMD);
     for (int i = 0; i < IAMD.n; i++)
     {
         for (int l = 0; l < IAMD.N; l++)
         {
             X[l, i] = IAMD.ISA[i].unsortl[l] - Ex[0, i];
         }
     }
     XT  = Matrix.TranspMatrix(X);
     rez = Matrix.MultiplicMatrix(XT, X);
     rez = Matrix.MultiplicNumber(rez, 1.0 / (IAMD.N - 1));
     return(rez);
 }
Esempio n. 7
0
        public UniformityDoubleMultidimensionalData(List <InitialStatisticalAnalys> ISA, List <List <int> > ind)
        {
            X = new InitialAnalysMultidimensionalData(ISA, ind[0], 0);
            Y = new InitialAnalysMultidimensionalData(ISA, ind[1], 0);


            n  = ind[0].Count;
            N1 = ISA[ind[0][0]].unsortl.Length;
            N2 = ISA[ind[1][0]].unsortl.Length;
            for (int i = 1; i < n; i++)
            {
                if (N1 != ISA[ind[0][i]].unsortl.Length || N2 != ISA[ind[0][i]].unsortl.Length)
                {
                    MessageBox.Show("Not correct input data", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            Refresh();
        }