static public double HiSqurdFound(InitialStatisticalAnalys gr, int l) { double Hi = 0; List <double> Y4 = new List <double>(); double L = (double)1 / gr.Mx.Q; for (double i = gr.l[0], v = 0; v < gr.Y2.Count; i += gr.Step.Q, v++) { if (l == 0) { Y4.Add(Distributions.NormalFFound(((i + gr.Step.Q) - gr.Mx.Q) / gr.Gx.Q) - Distributions.NormalFFound((i - gr.Mx.Q) / gr.Gx.Q)); } else if (l == 1) { double F2 = 1 - Math.Exp(-(1 / gr.Mx.Q) * (gr.Min.Q + gr.Step.Q * (v + 1))); double F1 = 1 - Math.Exp(-(1 / gr.Mx.Q) * (gr.Min.Q + gr.Step.Q * (v))); Y4.Add(F2 - F1); } else if (l == 2) { Y4.Add(gr.Step.Q / gr.Len.Q); } } for (int i = 0; i < gr.m.Q; i++) { Hi += (Math.Pow(Y4[i] - gr.f[i], 2) / Y4[i]) * gr.l.Count; } return(Math.Round(Hi, 4)); }
static private double DFound(List <double> ML, InitialStatisticalAnalys gr, int Type, double Mx, double Gx) { double[] D = new double[2]; for (int i = 0; i < gr.l.Count - 1; i++) { double l = 0; double lmin = 0; if (Type == 0) { double v1 = Distributions.NormalFFound((gr.l[i] - Mx) / Gx); l = Math.Abs(gr.F[i] - v1); if (i > 0) { v1 = Distributions.NormalFFound((gr.l[i - 1] - Mx) / Gx); lmin = Math.Abs(gr.F[i] - v1); } } else if (Type == 1) { l = Math.Abs(gr.F[i] - 1 + Math.Pow(2.73, -(1 / (Mx - gr.Min.Q)) * (gr.l[i] - gr.Min.Q))); if (i > 0) { lmin = Math.Abs(gr.F[i] - 1 + Math.Pow(2.73, -(1 / (Mx - gr.Min.Q)) * (gr.l[i - 1] - gr.l[0]))); } } else if (Type == 2) { l = Math.Abs(gr.F[i] - ((gr.l[i] - gr.l[0]) / gr.Len.Q)); if (i > 0) { lmin = Math.Abs(gr.F[i] - ((gr.l[i - 1] - ML[0]) / gr.Len.Q)); } } D[1] = Math.Max(l, D[1]); D[0] = Math.Max(lmin, D[0]); } return(Math.Max(D[0], D[1])); }