private ParameterViewModel(ParameterInfo info, ConstructorViewModel owner, DoubleRange range, double value) { bool isInteger = info.ParameterType == typeof(int); double min = range.Min; double max = range.Max; if (min < -1e+5) { min = -1e+5; } if (max > 1e+5) { max = 1e+5; } double step = 0.1; if (isInteger) { step = 1; } Min = min; Max = max; Step = step; Value = value; Name = DistributionManager.Normalize(info.Name); Owner = owner; Parameter = info; IsDiscrete = isInteger; }
/// <summary> /// Initializes a new instance of the <see cref="GoodnessOfFitViewModel"/> class. /// </summary> /// /// <param name="gof">The goodness-of-fits results against a particular distribution.</param> /// public GoodnessOfFitViewModel(GoodnessOfFit gof) { this.Name = DistributionManager.Normalize(gof.Distribution.GetType().Name); // Transform the rank to ordinal positions // i.e. 0 to "1st", 1 to "2nd", 2 to "3rd" this.Rank = suffix(gof.ChiSquareRank + 1); this.ChiSquare = gof.ChiSquare; this.KolmogorovSmirnov = gof.KolmogorovSmirnov; }
private PropertyViewModel(PropertyInfo prop, DistributionViewModel distribution) { this.Property = prop; this.Owner = distribution; this.Name = DistributionManager.Normalize(prop.Name); }