public override object GetHypothesisTestingForMean(object array, object m, object sigma, out object lessThan, out object greaterThan)
        {
            StandardDeviation sd = new StandardDeviation(array);

            if (!IsDouble(m) || !IsDouble(sigma))
            {
                throw new ArgumentException(ERROR_ARGUMENT_DOUBLE);
            }

            var strongTypeDataDouble = array as double[];

            double[] arrayDouble;

            if (strongTypeDataDouble != null)
            {
                arrayDouble = strongTypeDataDouble;
            }
            else
            {
                throw new ArgumentException(ERROR_ARGUMENT_DOUBLE_ARRAY);
            }

            double t = ((double)sd.GetMean() - (double)m) / ((double)sigma / Math.Sqrt(arrayDouble.Length));

            StudentTDistributionDouble tDistribution = new StudentTDistributionDouble(arrayDouble.Length - 1, t);

            lessThan    = (double)tDistribution.GetProbability();
            greaterThan = 1 - (double)lessThan;

            return(t);
        }
Exemplo n.º 2
0
        public override object GetConfidenceInterval(double cl, double s, int n)
        {
            StudentTDistributionDouble tdistribution = new StudentTDistributionDouble(n, 1.27);

            return(tdistribution.GetConfidenceInterval(cl, s));
        }
Exemplo n.º 3
0
        public override object GetTParameter(double cl, int n)
        {
            StudentTDistributionDouble tdistribution = new StudentTDistributionDouble(n, 1.27);

            return(tdistribution.GetTParameter(cl));
        }