/// <summary> /// Computes a p-value for a given distribution. /// </summary> /// <param name="distribution">Values used to compute the p-value.</param> /// <returns>Level of significance (p-value)</returns> public HypothesisTestingData Test(List <double> dist1) { var x = new double[dist1.Count]; var n = dist1.Count; dist1.CopyTo(x); var pValue = double.MaxValue; //alglib.(x, n, out pValue); var t = new HypothesisTestingData(pValue); return(t); }
public HypothesisTestingData Test(List <double> dist1, List <double> dist2) { var one = new double[dist1.Count]; dist1.CopyTo(one); var two = new double[dist2.Count]; dist1.CopyTo(two); var pValue = double.MaxValue; // TwoSampleKolmogorovSmirnovTest tester = new TwoSampleKolmogorovSmirnovTest(one, two, TwoSampleKolmogorovSmirnovTestHypothesis.SamplesDistributionsAreUnequal); // pValue = testc.PValue; var data = new HypothesisTestingData(pValue, pValue, pValue); return(data); }
/// <summary> /// Computes a p-value for a given distribution. /// </summary> /// <returns>Level of significance (p-value)</returns> public HypothesisTestingData Test(List <double> dist1, List <double> dist2) { var y = new double[dist2.Count]; var x = new double[dist1.Count]; var n = dist1.Count; var m = dist2.Count; dist1.CopyTo(x); dist2.CopyTo(y); var twoTail = double.MaxValue; var leftTail = double.MaxValue; var rightTail = double.MaxValue; alglib.unequalvariancettest(x, n, y, m, out twoTail, out leftTail, out rightTail); var t = new HypothesisTestingData(twoTail, leftTail, rightTail); return(t); }