public void GeteroSked(double[] EEeval, Chart repres)//устранение гетероскедостичности { for (int i = 0; i < Watches; i++) { for (int j = 0; j < Variables; j++) { _x[i, j] = _x[i, j] / EEeval[i]; } _y[i] = _y[i] / EEeval[i]; } SLE(_x, _y, Variables, Watches); YMul = new double[Watches]; YTempMake(X, YMul, Variables); EvalQual(YMul, YMain); TextManager text = new TextManager(); chart = new ChartManager(repres); chart.FormChart(); chart.ChartBuild(repres, YMul, file); }
public string text;//то, что вернет метод в форму public void Analyt(string[] lines, Label txt, Chart linear, string red = "") //нужнр создать событие и в его делегат потом забивать последовательность методов которорые должны быть выполнены или мб просто чтобы срабатывали после нажатия некоторые хз наверно первое лучше { _key = false; // ключ на наличие качественных переменных =1 значит есть file = new FileReader(lines); if (string.Compare(red, "") != 0) { file = new FileReader(lines, red); _key = true; } file.XYMaking(); if (_key) { Qualit(); } else { Linest(); } SLE(X, Y, Variables, Watches); YTempMake(X, Y, Variables); EvalQual(Y, YMain); chart = new ChartManager(linear); chart.FormChart(); chart.ChartBuild(linear, Y, file); //if (ShiftKey)txt.Text = $"olololo {Coeff[0]} { Coeff[ 1] } { Coeff[2] } "; }
public void AutoCorr(double[] E, Chart ExpChart)//устранение автокорреляции { double[,] EX = new double[Watches - 1, 1]; double[] E1 = new double[Watches - 1]; for (int i = 1; i < Watches - 1; i++) { EX[i - 1, 0] = E[i]; E1[i - 1] = E[i - 1]; } SLE(EX, E1, 1, Watches - 1); double co = Coeff[0]; SLE(_x, _y, Variables, Watches); Y[0] = 0; for (int _j = 0; _j < Variables; _j++) { Y[0] += X[0, _j] * Coeff[_j]; } for (int i = 1; i < Watches; i++) { Y[i] = co * (YMain[i - 1] - Y[i - 1]); for (int _j = 0; _j < Variables; _j++) { Y[i] += X[i, _j] * Coeff[_j]; } } EvalQual(Y, YMain); TextManager text = new TextManager(); chart = new ChartManager(ExpChart); chart.FormChart(); chart.ChartBuild(ExpChart, Y, file); }
public void MultiColl(Chart linear, double[] Rs)//устранение мультиколлинеарности { int l = 0; double p1 = Rs[0]; for (int i = 1; i < file.Variables; i++) { if (p1 < Rs[i]) { l = i; p1 = Rs[i]; } } double[] p = new double[Watches]; for (int i = 0; i < Watches; i++) { p[i] = _x[i, l]; for (int j = 0; j < Variables; j++) { _x[i, j] = _x[i, j] / p[i]; } _y[i] = _y[i] / p[i]; } SLE(_x, _y, Variables, Watches); YMul = new double[Watches]; YTempMake(X, YMul, Variables); EvalQual(YMul, YMain); TextManager text = new TextManager(); chart = new ChartManager(linear); chart.FormChart(); chart.ChartBuild(linear, YMul, file); }
public void ShiftFunk(Chart linear, Label txt, string Shifts = "") { if (string.Compare(Shifts, "") != 0 && ShiftKey) { string[] Shiftsa = Shifts.Split(' ', ' '); this.Shift = Convert.ToInt32(Shiftsa[0]); } int variables = Variables * 2; double[,] x1 = new double[Watches, variables]; double[,] X1 = new double[Watches, variables]; for (int i = 0; i < Watches; i++) { for (int j = 0; j < variables; j++) { if (i < Shift) { if (j < Variables) { x1[i, j] = _x[i, j]; } else { x1[i, j] = 0; } } else if (j > Variables) { x1[i, j] = _x[i, j - Variables]; } else { x1[i, j] = 0; } } x1[i, 0] = _x[i, 0]; if (i >= Shift) { x1[i, Variables] = _x[i, 0]; } else { x1[i, Variables] = 0; } } for (int i = 0; i < Watches; i++) { for (int j = 0; j < variables; j++) { if (i < Shift) { if (j < Variables) { X1[i, j] = X[i, j]; } else { X1[i, j] = 0; } } else if (j > Variables) { X1[i, j] = X[i, j - Variables]; } else { X1[i, j] = 0; } } X1[i, 0] = X[i, 0]; if (i >= Shift) { X1[i, Variables] = X[i, 0]; } else { X1[i, Variables] = 0; } } /*txt.Text = $"{x1[0, 0]} {x1[0, 1]} {x1[0, 2]} {x1[0, 3]} {x1[0, 4]} {x1[0, 5]}\n" + * $"{x1[1, 0]} {x1[1, 1]} {x1[1, 2]} {x1[1, 3]} {x1[1, 4]} {x1[1, 5]}\n" + * $"{x1[10, 0]} {x1[10, 1]} {x1[10, 2]} {x1[10, 3]} {x1[10, 4]} {x1[10, 5]}\n"+ * $"{Shift}";*/ SLE(x1, _y, variables, Watches); YTempMake(X1, Y, variables); EvalQual(Y, YMain); TextManager text = new TextManager(); chart = new ChartManager(linear); chart.FormChart(); chart.ChartBuild(linear, Y, file); }