Esempio n. 1
0
 public IExpectedValueIResultElement Calculate(
     IExpectedValueIResultElementFactory expectedValueIResultElementFactory,
     ItIndexElement tIndexElement,
     IΛIndexElement ΛIndexElement,
     Il l,
     It t,
     Ist st,
     IExpectedValueΦ expectedValueΦ,
     Iz z)
 {
     return(expectedValueIResultElementFactory.Create(
                tIndexElement,
                ΛIndexElement,
                st.Value
                .Select(w =>
                        expectedValueΦ.GetElementAtAsdecimal(
                            w.sIndexElement,
                            l.GetElementAt(
                                tIndexElement.Key
                                -
                                w.tIndexElement.Key
                                +
                                (int)Math.Floor(
                                    (decimal)w.tIndexElement.Key
                                    /
                                    (tIndexElement.Key + 1))
                                *
                                t.GetT()),
                            ΛIndexElement)
                        *
                        z.GetElementAtAsint(
                            w.sIndexElement,
                            w.tIndexElement))
                .Sum()));
 }
        public IExpectedValueIResultElementFactory CreateExpectedValueIResultElementFactory()
        {
            IExpectedValueIResultElementFactory factory = null;

            try
            {
                factory = new ExpectedValueIResultElementFactory();
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(factory);
        }
Esempio n. 3
0
        public IExpectedValueIResultElementFactory CreateExpectedValueIResultElementFactory()
        {
            IExpectedValueIResultElementFactory factory = null;

            try
            {
                factory = new ExpectedValueIResultElementFactory();
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(factory);
        }
Esempio n. 4
0
 public IExpectedValueI Calculate(
     IExpectedValueIResultElementFactory expectedValueIResultElementFactory,
     IExpectedValueIFactory expectedValueIFactory,
     IExpectedValueIResultElementCalculation expectedValueIResultElementCalculation,
     Il l,
     It t,
     Ist st,
     ItΛ tΛ,
     IExpectedValueΦ expectedValueΦ,
     Iz z)
 {
     return(expectedValueIFactory.Create(
                tΛ.Value
                .Select(i => expectedValueIResultElementCalculation.Calculate(
                            expectedValueIResultElementFactory,
                            i.tIndexElement,
                            i.ΛIndexElement,
                            l,
                            t,
                            st,
                            expectedValueΦ,
                            z))
                .ToImmutableList()));
 }
        public IΦHat Calculate(
            IExpectedValueIResultElementCalculationFactory expectedValueIResultElementCalculationFactory,
            IExpectedValueΦResultElementCalculationFactory expectedValueΦResultElementCalculationFactory,
            IVarianceIResultElementCalculationFactory varianceIResultElementCalculationFactory,
            IVarianceΦResultElementCalculationFactory varianceΦResultElementCalculationFactory,
            IVHatResultElementCalculationFactory VHatResultElementCalculationFactory,
            Iυ2ResultElementCalculationFactory υ2ResultElementCalculationFactory,
            IΦHatResultElementCalculationFactory ΦHatResultElementCalculationFactory,
            IExpectedValueICalculationFactory expectedValueICalculationFactory,
            IExpectedValueΦCalculationFactory expectedValueΦCalculationFactory,
            IMRNBCalculationFactory MRNBCalculationFactory,
            IRNBCalculationFactory RNBCalculationFactory,
            ItStarCalculationFactory tStarCalculationFactory,
            IVarianceICalculationFactory varianceICalculationFactory,
            IVarianceΦCalculationFactory varianceΦCalculationFactory,
            IVHatCalculationFactory VHatCalculationFactory,
            Iυ2CalculationFactory υ2CalculationFactory,
            INormalFactory normalFactory,
            IExpectedValueIResultElementFactory expectedValueIResultElementFactory,
            IExpectedValueΦResultElementFactory expectedValueΦResultElementFactory,
            IVarianceIResultElementFactory varianceIResultElementFactory,
            IVarianceΦResultElementFactory varianceΦResultElementFactory,
            IVHatResultElementFactory VHatResultElementFactory,
            Iυ2ResultElementFactory υ2ResultElementFactory,
            IΦHatResultElementFactory ΦHatResultElementFactory,
            IExpectedValueIFactory expectedValueIFactory,
            IExpectedValueΦFactory expectedValueΦFactory,
            IVarianceIFactory varianceIFactory,
            IVarianceΦFactory varianceΦFactory,
            IVHatFactory VHatFactory,
            Iυ2Factory υ2Factory,
            IΦHatFactory ΦHatFactory,
            Il l,
            It t,
            IΛ Λ,
            IslΛ slΛ,
            Ist st,
            ItΛ tΛ,
            IL L,
            Ip p,
            Iμ μ,
            Iσ σ,
            IΩ Ω,
            Iz z)
        {
            // ExpectedValueΦ
            IExpectedValueΦ expectedValueΦ = expectedValueΦCalculationFactory.Create()
                                             .Calculate(
                expectedValueΦResultElementFactory,
                expectedValueΦFactory,
                expectedValueΦResultElementCalculationFactory.Create(),
                l,
                t,
                slΛ,
                L,
                p,
                μ);

            // VarianceΦ
            IVarianceΦ varianceΦ = varianceΦCalculationFactory.Create()
                                   .Calculate(
                varianceΦResultElementFactory,
                varianceΦFactory,
                varianceΦResultElementCalculationFactory.Create(),
                l,
                t,
                slΛ,
                L,
                p,
                μ,
                σ);

            // ExpectedValueI
            IExpectedValueI expectedValueI = expectedValueICalculationFactory.Create()
                                             .Calculate(
                expectedValueIResultElementFactory,
                expectedValueIFactory,
                expectedValueIResultElementCalculationFactory.Create(),
                l,
                t,
                st,
                tΛ,
                expectedValueΦ,
                z);

            // VarianceI
            IVarianceI varianceI = varianceICalculationFactory.Create()
                                   .Calculate(
                varianceIResultElementFactory,
                varianceIFactory,
                varianceIResultElementCalculationFactory.Create(),
                l,
                t,
                st,
                tΛ,
                varianceΦ,
                z);

            // υ2
            Iυ2 υ2 = υ2CalculationFactory.Create()
                     .Calculate(
                normalFactory,
                υ2ResultElementFactory,
                υ2Factory,
                MRNBCalculationFactory.Create(),
                RNBCalculationFactory.Create(),
                υ2ResultElementCalculationFactory.Create(),
                t,
                Λ,
                Ω,
                expectedValueI,
                varianceI);

            // VHat
            IVHat VHat = VHatCalculationFactory.Create()
                         .Calculate(
                normalFactory,
                VHatResultElementFactory,
                VHatFactory,
                RNBCalculationFactory.Create(),
                tStarCalculationFactory.Create(),
                VHatResultElementCalculationFactory.Create(),
                t,
                Λ,
                expectedValueI,
                varianceI,
                υ2);

            return(this.Calculate(
                       normalFactory,
                       ΦHatResultElementFactory,
                       ΦHatFactory,
                       ΦHatResultElementCalculationFactory.Create(),
                       slΛ,
                       expectedValueΦ,
                       varianceΦ,
                       VHat,
                       υ2));
        }