Пример #1
0
        public static double ComputeRawMomentFromCulumants(double[] cumulants, int n)
        {
            if (cumulants == null)
            {
                throw new ArgumentNullException("cumulants");
            }
            if (n < 0)
            {
                throw new ArgumentNullException("n");
            }
            if (cumulants.Length <= n)
            {
                throw new InvalidOperationException();
            }

            double K = 0.0;
            IntegerPartitionEnumerator e = new IntegerPartitionEnumerator(n);

            while (e.MoveNext())
            {
                double K1 = 1.0;
                int[]  fs = e.Current;
                foreach (int f in fs)
                {
                    K1 *= cumulants[f];
                }
                K += K1;
            }

            return(K);
        }
Пример #2
0
        public static double ComputeRawMomentFromCulumants(double[] cumulants, int n)
        {
            if (cumulants == null) throw new ArgumentNullException("cumulants");
            if (n < 0) throw new ArgumentNullException("n");
            if (cumulants.Length <= n) throw new InvalidOperationException();

            double K = 0.0;
            IntegerPartitionEnumerator e = new IntegerPartitionEnumerator(n);
            while (e.MoveNext()) {
                double K1 = 1.0;
                int[] fs = e.Current;
                foreach (int f in fs) {
                    K1 *= cumulants[f];
                }
                K += K1;
            }

            return (K);
        }