public double CalcDisperssion() { var sumList = AXi.Select((value, index) => Math.Pow(Math.Abs(value - ExceptedValue), 2) * Ni[index]).Sum(); Disperssion = sumList / (n - 1); return(Disperssion); }
public double CalcExceptedValue() { var sumList = AXi.Zip(Ni, (x, y) => x * y).Sum(); ExceptedValue = sumList / n; return(ExceptedValue); }
public List <double> CalcAXi() { AXi.Clear(); for (int i = 0; i < Xi.Count - 1; i++) { AXi.Add((Xi[i] + Xi[i + 1]) / 2); } return(AXi); }
public List <double> CalcFrequencyF() { var a = ExceptedValue; sigma = Math.Sqrt(Disperssion); for (int i = 0; i < AXi.Count(); i++) { var power = Math.Pow(Math.E, (-1 * Math.Pow(AXi[i] - a, 2)) / (2 * Math.Pow(sigma, 2))); var firstMultiplier = 1 / (sigma * Math.Sqrt(2 * Math.PI)); FrequencyF.Add(firstMultiplier * power); } return(FrequencyF); }