public IΦHat Calculate( INormalFactory normalFactory, IΦHatResultElementFactory ΦHatResultElementFactory, IΦHatFactory ΦHatFactory, IΦHatResultElementCalculation ΦHatResultElementCalculation, IslΛ slΛ, IExpectedValueΦ expectedValueΦ, IVarianceΦ varianceΦ, IVHat VHat, Iυ2 υ2) { return(ΦHatFactory.Create( slΛ.Value .Select(i => ΦHatResultElementCalculation.Calculate( normalFactory, ΦHatResultElementFactory, i.lIndexElement, i.sIndexElement, i.ΛIndexElement, expectedValueΦ, varianceΦ, VHat, υ2)) .ToImmutableList())); }
public IVHat Calculate( INormalFactory normalFactory, IVHatResultElementFactory VHatResultElementFactory, IVHatFactory VHatFactory, IRNBCalculation RNBCalculation, ItStarCalculation tStarCalculation, IVHatResultElementCalculation VHatResultElementCalculation, It t, IΛ Λ, IExpectedValueI expectedValueI, IVarianceI varianceI, Iυ2 υ2) { return(VHatFactory.Create( Λ.Value .Select(i => VHatResultElementCalculation.Calculate( normalFactory, VHatResultElementFactory, RNBCalculation, tStarCalculation, i, t, expectedValueI, varianceI, υ2)) .ToImmutableList())); }
public ItIndexElement Calculate( INormalFactory normalFactory, IRNBCalculation RNBCalculation, IΛIndexElement ΛIndexElement, It t, IExpectedValueI expectedValueI, IVarianceI varianceI, Iυ2 υ2) { return(t.Value .Select(i => KeyValuePair.Create( i, RNBCalculation.Calculate( normalFactory, i, ΛIndexElement, expectedValueI, varianceI, υ2.GetElementAtAsdecimal( ΛIndexElement)))) .OrderBy(i => i.Value) .LastOrDefault() .Key); }
public Iυ2 Create( ImmutableList <Iυ2ResultElement> value) { Iυ2 result = null; try { result = new υ2( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(result); }
public IΦHatResultElement Calculate( INormalFactory normalFactory, IΦHatResultElementFactory ΦHatResultElementFactory, IlIndexElement lIndexElement, IsIndexElement sIndexElement, IΛIndexElement ΛIndexElement, IExpectedValueΦ expectedValueΦ, IVarianceΦ varianceΦ, IVHat VHat, Iυ2 υ2) { // https://stackoverflow.com/questions/1662943/standard-normal-distribution-z-value-function-in-c-sharp MathNet.Numerics.Distributions.Normal normal = (MathNet.Numerics.Distributions.Normal)normalFactory.Create(); return(ΦHatResultElementFactory.Create( sIndexElement, lIndexElement, ΛIndexElement, (decimal)expectedValueΦ.GetElementAtAsdecimal( sIndexElement, lIndexElement, ΛIndexElement) + (decimal)normal.CumulativeDistribution( (double)(1 - υ2.GetElementAtAsdecimal( ΛIndexElement))) * (decimal)Math.Pow( Math.Sqrt( (double)VHat.GetElementAtAsdecimal( ΛIndexElement)), -1) * (decimal)varianceΦ.GetElementAtAsdecimal( sIndexElement, lIndexElement, ΛIndexElement))); }
public IVHatResultElement Calculate( INormalFactory normalFactory, IVHatResultElementFactory VHatResultElementFactory, IRNBCalculation RNBCalculation, ItStarCalculation tStarCalculation, IΛIndexElement ΛIndexElement, It t, IExpectedValueI expectedValueI, IVarianceI varianceI, Iυ2 υ2) { return(VHatResultElementFactory.Create( ΛIndexElement, varianceI.GetElementAtAsdecimal( tStarCalculation.Calculate( normalFactory, RNBCalculation, ΛIndexElement, t, expectedValueI, varianceI, υ2), ΛIndexElement))); }
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)); }