This function fits a specific probability distribution to a set of data (range of cells) and returns information about the fit.
Table 75. CB.Fit Returned Data Type
The goodness-of-fit statistic for the fit of the data to the selected distribution |
You select the distribution to fit to your data (among the possible distributions listed in Table 76, CB.Fit Parameters) and the statistic to return.
CB.Fit must be used with CB.SetFitRange (CB.SetFitRange), as shown in the examples for this call.
Table 76. CB.Fit Parameters
See Table 77 | Used to specify the distribution to use for fitting. Values are listed in Table 77. | ||
See Table 78 | Used to specify which fitting statistics to return. Values appear in Table 78. | ||
If False, returns the statistic; if True, returns the p-value. The default is False. | |||
See Table 77 | If only one distribution is passed for Dist, DistBestFit returns the index of that distribution. Otherwise it returns the index of the best fitted distribution. | ||
See Table 78 | If a specific ranking method is passed for Criterion, CriterionBestFit returns the index of this ranking method. Otherwise, it returns the index of the selected ranking method. |
The following table shows Dist parameter values, used to select a distribution for fitting. You can only fit to distributions listed in this table.
Table 77. CB.Fit Dist Parameter Values — Required, Integer
The cbDfaExtremeValue constant is deprecated. It is included for Crystal Ball 2000.5 (5.5) compatibility and is replaced by cbDfaMinExtreme and cbDfaMaxExtreme in later versions of Crystal Ball . Beginning with version 11.1.1.0.00, the lognormal distribution has three parameters instead of two. If this call is used in a model that was created in an earlier version of Crystal Ball, the third parameter has a value of 0. |
The following table shows Criterion parameter values, used to specify which fitting statistics to return.