internal static IAnalysisPhaseTwo CreateAnalysisPhaseTwo( PhaseTwoAnalysisKind phaseTwo, IFunctionSelector goodnessOfFit, ParametersPack args) { phaseTwo.ThrowIfNull(nameof(phaseTwo)); if (PhaseTwoAnalysisKind.NormalDistribution.Equals(phaseTwo)) { // TODO: add formulas for solution based on Sturges's formula. throw new NotImplementedException( "Normal distribution analysis for phase 2 is not implemented." ); } if (PhaseTwoAnalysisKind.BetaDistribution.Equals(phaseTwo)) { var regression = Regression.Create(goodnessOfFit); return(new BetaDistributionAnalysisPhaseTwo(args, regression)); } throw new ArgumentOutOfRangeException( nameof(phaseTwo), phaseTwo, $"Unknown analysis kind for phase 2 value: {phaseTwo.ToLogString()}" ); }