Ejemplo n.º 1
0
        public static object acq_count(
            [ExcelArgument(Description = "Array")] object x)
        {
            double[] array = ExcelHelper.CheckArray <double>(x); //it is a bit wasteful to create a new array, just to count number of numeric values, but it keeps code cleaner

            return(array.Length);
        }
Ejemplo n.º 2
0
        public static object acq_absmin(
            [ExcelArgument(Description = "Array")] object x)
        {
            double[] array = ExcelHelper.CheckArray <double>(x);

            double min = ACQ.Math.Stats.Utils.AbsMin(array);

            return(ExcelHelper.CheckNan(min));
        }
Ejemplo n.º 3
0
        public static object acq_max(
            [ExcelArgument(Description = "Array")] object x)
        {
            double[] array = ExcelHelper.CheckArray <double>(x);

            double max = ACQ.Math.Stats.Utils.Max(array);

            return(ExcelHelper.CheckNan(max));
        }
Ejemplo n.º 4
0
        public static object acq_sumofsquares(
            [ExcelArgument(Description = "Array")] object x)
        {
            double[] array = ExcelHelper.CheckArray <double>(x);

            double sum_sqr = ACQ.Math.Stats.Utils.SumOfSquares(array);

            return(ExcelHelper.CheckNan(sum_sqr));
        }
Ejemplo n.º 5
0
        public static object acq_stdev(
            [ExcelArgument(Description = "Array")] object x)
        {
            double[] array = ExcelHelper.CheckArray <double>(x);

            double stdev = ACQ.Math.Stats.Utils.Std(array);

            return(ExcelHelper.CheckNan(stdev));
        }
Ejemplo n.º 6
0
        public static object acq_mean(
            [ExcelArgument(Description = "Array")] object x,
            [ExcelArgument(Description = "Array of Weights [optional]")] object w,
            [ExcelArgument(Description = "Ignore NA flag [optional] (default: false)")] object ignore_na)
        {
            double[] x_input = ExcelHelper.CheckArray <double>(x); //TODO: we need to check that correspondance between x and w is preserved
            double[] w_input = ExcelHelper.CheckArray <double>(w);

            bool na_rm = ExcelHelper.CheckValue <bool>(ignore_na, false);

            double result = ACQ.Math.Stats.Utils.WeightedMean(x_input, w_input, na_rm);

            return(ExcelHelper.CheckNan(result));
        }