Accord.Statistics.Testing.TwoReceiverOperatingCurveTest.TwoReceiverOperatingCurveTest C# (CSharp) Method

TwoReceiverOperatingCurveTest() public method

Creates a new test for two ROC curves.
public TwoReceiverOperatingCurveTest ( ReceiverOperatingCharacteristic curve1, ReceiverOperatingCharacteristic curve2, double hypothesizedDifference, TwoSampleHypothesis alternate = TwoSampleHypothesis.ValuesAreDifferent ) : System
curve1 ReceiverOperatingCharacteristic The first ROC curve.
curve2 ReceiverOperatingCharacteristic The second ROC curve.
hypothesizedDifference double The hypothesized difference between the two areas.
alternate TwoSampleHypothesis The alternative hypothesis (research hypothesis) to test.
return System
        public TwoReceiverOperatingCurveTest(ReceiverOperatingCharacteristic curve1, ReceiverOperatingCharacteristic curve2,
            double hypothesizedDifference = 0, TwoSampleHypothesis alternate = TwoSampleHypothesis.ValuesAreDifferent)
        {
            this.Curve1 = curve1;
            this.Curve2 = curve2;

            double[] Vx1 = curve1.NegativeAccuracies;
            double[] Vy1 = curve1.PositiveAccuracies;

            double[] Vx2 = curve2.NegativeAccuracies;
            double[] Vy2 = curve2.PositiveAccuracies;

            double covx = Measures.Covariance(Vx1, Vx2);
            double covy = Measures.Covariance(Vy1, Vy2);
            double cov = covx / Vx1.Length + covy / Vy1.Length;

            this.EstimatedValue1 = curve1.Area;
            this.EstimatedValue2 = curve2.Area;
            this.ObservedDifference = EstimatedValue1 - EstimatedValue2;
            this.HypothesizedDifference = hypothesizedDifference;

            this.Variance1 = curve1.Variance;
            this.Variance2 = curve2.Variance;

            this.OverallVariance = Variance1 + Variance2 - 2 * cov;
            this.StandardError = System.Math.Sqrt(OverallVariance);

            // Compute Z statistic
            double z = (ObservedDifference - HypothesizedDifference) / StandardError;

            Compute(z, alternate);
        }
    }
TwoReceiverOperatingCurveTest