Accord.Statistics.Testing.Power.BaseOneSamplePowerAnalysis.ComputeEffect C# (CSharp) Méthode

ComputeEffect() public méthode

Computes the minimum detectable effect size for the test considering the power given in Power, the number of samples in Samples and the significance level Size.
public ComputeEffect ( ) : void
Résultat void
        public virtual void ComputeEffect()
        {
            double requiredPower = Power;

            // Attempt to locate the optimal sample size
            // to attain the required power by locating
            // a zero in the difference function:

            double sol = BrentSearch.FindRoot(eff =>
            {
                Effect = eff;
                ComputePower();

                return requiredPower - Power;
            },

            lowerBound: 1e-5,
            upperBound: 1e+5);

            
            // Check it
            Effect = sol;
            ComputePower();

            double newPower = Power;
            Power = requiredPower;

            if (Math.Abs(requiredPower - newPower) > 1e-5)
                Effect = Double.NaN;
        }