Esempio n. 1
0
        public override object GetHypothesisTestingForMean(object array, object m, object sigma, out object lessThan, out object greaterThan)
        {
            StandardDeviation sd = new StandardDeviation(array);

            if (!IsFloat(m) || !IsFloat(sigma))
            {
                throw new ArgumentException(ERROR_ARGUMENT_FLOAT);
            }

            var strongTypeDataFloat = array as float[];

            float[] arrayFloat;

            if (strongTypeDataFloat != null)
            {
                arrayFloat = strongTypeDataFloat;
            }
            else
            {
                throw new ArgumentException(ERROR_ARGUMENT_FLOAT_ARRAY);
            }

            float t = ((float)sd.GetMean() - (float)m) / ((float)sigma / Convert.ToSingle(Math.Sqrt(arrayFloat.Length)));

            StudentTDistributionFloat tDistribution = new StudentTDistributionFloat(arrayFloat.Length - 1, t);

            lessThan    = Convert.ToSingle(tDistribution.GetProbability());
            greaterThan = Convert.ToSingle(1 - (float)lessThan);

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

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

            return(tdistribution.GetTParameter(cl));
        }