public static double FExp(List <double> X, double x) { double lamda = 1 / PointMark.Ave(X); double F = 1 - Math.Exp(-lamda * x); return(F); }
public static List <double> standartA(List <double> A, double sum) { List <double> X = new List <double>(); for (int i = 0; i < sum; i++) { A[i] = (A[i] - PointMark.Ave(A)) / PointMark.SQRAve(PointMark.Disp(A, PointMark.Ave(A))); } return(A); }
public static double dov_exp(List <double> X, double sum, double x) { double D = 0; double N = sum; double lamda = 1 / PointMark.Ave(X); double nk = Quantil.NormalQuantil(); double D_lyam = Math.Pow(lamda, 2) / N; D = nk * Math.Sqrt(Math.Pow(x, 2) * Math.Exp(-2 * lamda * x) * D_lyam); return(D); }
private void експоненціальнийToolStripMenuItem_Click(object sender, EventArgs e) { X.Sort(); chart1.Series.Add("exp"); chart1.Series["exp"].Color = Color.Violet; chart1.Series["exp"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; chart1.Series["exp"].BorderWidth = 1; chart1.Series["exp"].BorderColor = Color.Black; double D = 0; for (double i = X[0]; i < X.Max(); i += 0.01 * (X.Max() - X.Min())) { chart1.Series["exp"].Points.AddXY(i, Restore.fExp(X, i) * step); } chart2.Series.Add("exp"); chart2.Series.Add("exp+"); chart2.Series["exp+"].Color = Color.Pink; chart2.Series["exp+"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; chart2.Series["exp+"].BorderWidth = 1; chart2.Series["exp+"].BorderColor = Color.Pink; chart2.Series.Add("exp-"); chart2.Series["exp-"].Color = Color.Violet; chart2.Series["exp-"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; chart2.Series["exp-"].BorderWidth = 1; chart2.Series["exp-"].BorderColor = Color.Violet; chart2.Series["exp"].Color = Color.DarkBlue; chart2.Series["exp"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; chart2.Series["exp"].BorderWidth = 1; chart2.Series["exp"].BorderColor = Color.Black; double lyambda = 1 / PointMark.Ave(X); double nk = Quantil.NormalQuantil(); double D_lyam = Math.Pow(lyambda, 2) / sum; for (double i = X[0]; i < X.Max(); i += 0.01 * (X.Max() - X.Min())) { D = Math.Pow(i, 2) * Math.Exp(-2 * lyambda * i) * (Math.Pow(lyambda, 2) / sum); chart2.Series["exp+"].Points.AddXY(i, Restore.FExp(X, i) + Quantil.StudentQuantil(sum, X) * Math.Sqrt(D)); chart2.Series["exp"].Points.AddXY(i, Restore.FExp(X, i)); chart2.Series["exp+"].Points.AddXY(i, Restore.FExp(X, i) - Quantil.StudentQuantil(sum, X) * Math.Sqrt(D)); } }
public static List <double> AbnormalsX(List <double> X, double sum) { int N = 0; double t = 1.55 + 0.8 * (Math.Sqrt(Math.Abs(PointMark.Exes(X, PointMark.Ave(X), PointMark.DisSqrAve(X, PointMark.Ave(X))))) * Math.Log10(sum / 10)), A = PointMark.Ave(X) - t * PointMark.DisSqrAve(X, PointMark.Ave(X)), B = PointMark.Ave(X) + t * PointMark.DisSqrAve(X, PointMark.Ave(X)); List <double> F = new List <double>(); /*double[] Buf_allnum = new double[allnum.Length];*/ // temporary array for (int i = 0; i < sum; i++) { if (X[i] < B && X[i] > A) { F.Add(X[i]); } } X = F; N = X.Count; return(X); }
public static double FLogNorm(List <double> A, double x) { List <double> PA = new List <double>(); for (int i = 0; i < A.Count; i++) { PA.Add(Math.Pow(A[i], 2)); } for (int i = 0; i < A.Count; i++) { if (A[i] < 0) { A[i] = Math.Abs(A[i]); } } double mu = PointMark.Ave(A) /*2 * Math.Log(Moment.StartMoment(1,A.Count,A))-1/2*Math.Log(Moment.StartMoment(2, A.Count, A))*/; double sigm = PointMark.Disp(A, PointMark.Ave(A)) /*Math.Sqrt(Math.Log(Moment.StartMoment(2, A.Count, A)) - 2* Math.Log(Moment.StartMoment(1, A.Count, A)))*/; double FLN = (1.0 / 2) + (1.0 / 2) * (AdvancedMath.Erf((Math.Log(x) - mu) / (sigm))); return(FLN); }
public void GridWrite(DataGridView dataGridView1, DataGridView dataGridView2, int NumClass, List <double> X) { X.Sort(); dataGridView2.ScrollBars = ScrollBars.Vertical; dataGridView2.Rows.Clear(); dataGridView2.Columns.Add("No", "Номер"); dataGridView2.Columns.Add("Element", "Значення"); for (int i = 0; i < X.Count; i++) { dataGridView2.Rows.Add(i + 1, Math.Round(X[i], 4)); } AVE = Math.Round(PointMark.Ave(X), 4); double MED = PointMark.Med(X); double MAD = PointMark.Mad(X, MED); double disp = Math.Round(PointMark.Disp(X, AVE), 4); SQRAve = Math.Round(PointMark.SQRAve(disp), 4); double disposeSQRAve = Math.Round(PointMark.DisSqrAve(X, AVE), 4); double As = Math.Round(PointMark.Assimetric(X, AVE, disposeSQRAve), 4); double Ex = Math.Round(PointMark.Exes(X, AVE, disposeSQRAve), 4); double ContrEx = Math.Round(PointMark.ConterEx(Ex), 4); double Var_Pirson = Math.Round(PointMark.Var_Pirson(AVE, SQRAve), 4); double no_param_kovar = Math.Round(PointMark.No_Param_Kovar(MED, MAD), 4); double yolsh = Math.Round(PointMark.Yolsh(X), 4); double llSQRAve = Math.Round(Interval_Mark.LowLimitSQRAve(SQRAve, sum, X), 4); double llAVE = Math.Round(Interval_Mark.LowLimitAve(AVE, SQRAve, sum, X), 4); double llAs = Math.Round(Interval_Mark.LowLimitAssimetric(As, sum, X), 4); double llEx = Math.Round(Interval_Mark.LowLimitExes(Ex, sum, X), 4); double llContrEX = Math.Round(Interval_Mark.LowLimitContrExes(ContrEx, Ex, sum, X), 4); double llPirson = Math.Round(Interval_Mark.LowLimitPirson(Var_Pirson, sum, X), 4); double hlSQRAve = Math.Round(Interval_Mark.HighLimitSQRAve(SQRAve, sum, X), 4); double hlAVE = Math.Round(Interval_Mark.HighLimitAve(AVE, SQRAve, sum, X), 4); double hlAs = Math.Round(Interval_Mark.HighLimitAssimetric(As, sum, X), 4); double hlEx = Math.Round(Interval_Mark.HighLimitExes(Ex, sum, X), 4); double hlContrEX = Math.Round(Interval_Mark.HighLimitContrExes(ContrEx, Ex, sum, X), 4); double hlPirson = Math.Round(Interval_Mark.HighLimitPirson(Var_Pirson, sum, X), 4); double sAve = Math.Round(Mark.sigmaAve(SQRAve, sum), 4); double sSQRAve = Math.Round(Mark.sigmaSQRAve(SQRAve, sum), 4); double sAs = Math.Round(Mark.sigmaAssimetric(sum), 4); double sEx = Math.Round(Mark.sigmaExes(sum), 4); double sContrEx = Math.Round(Mark.sigmaContrExes(Ex, sum), 4); double sPiroson = Math.Round(Mark.sigmaPirson(Var_Pirson, sum), 4); dataGridView1.Columns.Clear(); dataGridView1.Rows.Clear(); dataGridView1.ScrollBars = ScrollBars.Vertical; dataGridView1.AutoResizeColumns(); dataGridView1.Columns.Add("Mark", "Оцінка"); dataGridView1.Columns.Add("Lowlimit", "Нижня Границя"); dataGridView1.Columns.Add("PMark", "Точкова оцінка"); dataGridView1.Columns.Add("sigma", "σ"); dataGridView1.Columns.Add("Highlimit", "Верхня Границя"); dataGridView1.Rows.Add("MED", "", MED, "", ""); dataGridView1.Rows.Add("MAD", "", MAD, "", ""); dataGridView1.Rows.Add("Медіана середніх Уолша", "", yolsh, "", ""); dataGridView1.Rows.Add("Середнє", llAVE, AVE, sAve, hlAVE); dataGridView1.Rows.Add("Дисперсія", "", disp, "", ""); dataGridView1.Rows.Add("Середнє квадратичне відхилення", llSQRAve, SQRAve, sSQRAve, hlSQRAve); dataGridView1.Rows.Add("Коефіцієнт асиметрії", llAs, As, sAs, hlAs); dataGridView1.Rows.Add("Коефіцієнт ексцесу", llEx, Ex, sEx, hlEx); dataGridView1.Rows.Add("Коефіцієнт контрексцесу", llContrEX, ContrEx, sContrEx, hlContrEX); dataGridView1.Rows.Add("Коефіціент варіації Пірсона", llPirson, Var_Pirson, sPiroson, hlPirson); dataGridView1.Rows.Add("Непараметричний коефіцієнт варіації", "", no_param_kovar, "", ""); }