fit_and_rank_distributions
Fit multiple distribution families to data and rank them by information criteria to select the best-fitting distribution. Skips families unable to fit the data.
Instructions
ModelRisk: Fit several distribution families to a data range and rank them by goodness of fit. For each family it fits VoseFitObject and scores it with ModelRisk's information criteria — AIC, SIC (Schwarz/BIC) and HQIC — then ranks ascending (lower = better) by criterion. Families with no fit function, or that can't fit the data, are returned under skipped with a reason. Use this instead of guessing a single family for fit_distribution_to_data. Runs on a transient scratch sheet that is always deleted; the data is not modified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | Yes | Sheet holding the data. | |
| families | No | Families to try. Omit for a broad continuous default set. | |
| workbook | Yes | Workbook file name, e.g. 'model.xlsx'. | |
| criterion | No | Ranking criterion: 'SIC' (default), 'AIC', or 'HQIC'. | SIC |
| data_range | Yes | A1-style range of the data, e.g. 'A1:A200'. | |
| uncertainty | No | Fit with parameter uncertainty (second-order). Default False. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skipped | No | Families that could not be fitted, with a reason each. | |
| criterion | Yes | Criterion the ranking is sorted by (AIC / SIC / HQIC). | |
| candidates | Yes | Successfully-fitted families, best first. | |
| data_range | Yes | ||
| best_family | No | The top-ranked family, or null if every fit failed. | |
| sample_size | Yes |