Risk Distribution Fitter
Overview
The Risk Distribution Fitter skill provides capabilities for calibrating probability distributions from historical data or expert judgment. It supports both data-driven fitting using statistical methods and expert elicitation protocols for subjective probability assessment.
Capabilities
- Maximum likelihood estimation (MLE)
- Method of moments estimation
- Bayesian parameter estimation
- Goodness-of-fit testing (KS, AD, Chi-square)
- Distribution comparison and selection
- Expert elicitation protocol support (3-point, 5-point)
- PERT distribution calculation
- Visualization of fitted distributions
Used By Processes
- Monte Carlo Simulation for Decision Support
- Predictive Analytics Implementation
- Decision Quality Assessment
Usage
Data-Driven Fitting
# Fit distributions to historical data
fitting_config = {
"data": [/* historical observations */],
"candidate_distributions": [
"normal", "lognormal", "gamma", "weibull",
"exponential", "beta", "triangular"
],
"fitting_method": "mle",
"selection_criterion": "AIC"
}
Expert Elicitation
# 3-point estimate (PERT)
expert_estimate = {
"method": "PERT",
"minimum": 50000,
"most_likely": 75000,
"maximum": 120000,
"confidence_level": 0.90 # optional: confidence that true value is within range
}
# 5-point estimate (for more precision)
detailed_estimate = {
"method": "5_point",
"P10": 45000,
"P25": 60000,
"P50": 75000,
"P75": 95000,
"P90": 115000
}
Supported Distributions
| Distribution |
Use Case |
Parameters |
| Normal |
Symmetric, unbounded |
mean, std |
| Lognormal |
Right-skewed, positive |
mu, sigma |
| Triangular |
Bounded with mode |
min, mode, max |
| PERT |
Bounded, weighted mode |
min, mode, max |
| Uniform |
Equal probability |
min, max |
| Beta |
Bounded, flexible shape |
alpha, beta |
| Gamma |
Positive, right-skewed |
shape, scale |
| Weibull |
Reliability/time |
shape, scale |
| Exponential |
Memoryless |
rate |
Goodness-of-Fit Tests
- Kolmogorov-Smirnov (KS): Distribution-free, sensitive to center
- Anderson-Darling (AD): More sensitive to tails
- Chi-Square: Categorical/binned data
- Cramér-von Mises: Similar to KS, different weighting
Model Selection Criteria
- AIC (Akaike Information Criterion): Balance fit and complexity
- BIC (Bayesian Information Criterion): Stronger penalty for parameters
- Log-Likelihood: Raw fit quality
Input Schema
{
"fitting_mode": "data_driven|expert_elicitation",
"data_driven_config": {
"data": ["number"],
"candidate_distributions": ["string"],
"fitting_method": "mle|mom|bayesian",
"selection_criterion": "AIC|BIC|likelihood"
},
"expert_elicitation_config": {
"method": "3_point|5_point|PERT|direct",
"estimates": "object",
"confidence_level": "number"
},
"options": {
"gof_tests": ["KS", "AD", "chi_square"],
"visualize": "boolean",
"compare_all": "boolean"
}
}
Output Schema
{
"best_fit": {
"distribution": "string",
"parameters": "object",
"gof_statistics": {
"test_name": {
"statistic": "number",
"p_value": "number"
}
},
"selection_score": "number"
},
"all_fits": [
{
"distribution": "string",
"parameters": "object",
"scores": "object"
}
],
"summary": {
"mean": "number",
"std": "number",
"percentiles": "object"
},
"visualization_path": "string",
"recommendations": ["string"]
}
Best Practices
- Use data-driven fitting when sufficient historical data exists (n > 30)
- Validate fitted distributions against holdout data
- Use PERT for expert estimates when asymmetry is expected
- Document expert credentials and elicitation process
- Consider mixture distributions for multimodal data
- Always visualize fitted distribution against data/estimates
- Use multiple goodness-of-fit tests for robustness
Expert Elicitation Guidelines
- Explain probability concepts clearly
- Use familiar reference points
- Ask for extreme estimates first, then middle
- Check for overconfidence (typical: too narrow ranges)
- Consider debiasing techniques
- Document reasoning behind estimates
Integration Points
- Feeds into Monte Carlo Engine for simulation inputs
- Supports Calibration Trainer for expert accuracy assessment
- Connects with Bayesian Network Analyzer for CPT estimation
- Integrates with Risk Register Manager for risk quantification
1---
2name: risk-distribution-fitter
3description: Probability distribution fitting skill for calibrating uncertainty models from historical data or expert judgment
4allowed-tools:
5 - Read
6 - Write
7 - Glob
8 - Grep
9 - Bash
10metadata:
11 source: https://skillmd.com/skills/a5c-ai/risk-distribution-fitter
12 specialization: decision-intelligence
13 domain: business
14 category: simulation
15 priority: medium
16 tools-libraries:
17 - scipy.stats
18 - fitter
19 - pomegranate
20 - distfit
21graph:
22 domains: [domain:business-intelligence]
23 skillAreas: [skill-area:quantitative-modeling, skill-area:statistical-analysis, skill-area:financial-risk-modeling]
24 roles: [role:quantitative-analyst, role:risk-analyst, role:data-scientist]
25---
26
27# Risk Distribution Fitter
28
29## Overview
30
31The Risk Distribution Fitter skill provides capabilities for calibrating probability distributions from historical data or expert judgment. It supports both data-driven fitting using statistical methods and expert elicitation protocols for subjective probability assessment.
32
33## Capabilities
34
35- Maximum likelihood estimation (MLE)
36- Method of moments estimation
37- Bayesian parameter estimation
38- Goodness-of-fit testing (KS, AD, Chi-square)
39- Distribution comparison and selection
40- Expert elicitation protocol support (3-point, 5-point)
41- PERT distribution calculation
42- Visualization of fitted distributions
43
44## Used By Processes
45
46- Monte Carlo Simulation for Decision Support
47- Predictive Analytics Implementation
48- Decision Quality Assessment
49
50## Usage
51
52### Data-Driven Fitting
53
54```python
55# Fit distributions to historical data
56fitting_config = {
57 "data": [/* historical observations */],
58 "candidate_distributions": [
59 "normal", "lognormal", "gamma", "weibull",
60 "exponential", "beta", "triangular"
61 ],
62 "fitting_method": "mle",
63 "selection_criterion": "AIC"
64}
65```
66
67### Expert Elicitation
68
69```python
70# 3-point estimate (PERT)
71expert_estimate = {
72 "method": "PERT",
73 "minimum": 50000,
74 "most_likely": 75000,
75 "maximum": 120000,
76 "confidence_level": 0.90 # optional: confidence that true value is within range
77}
78
79# 5-point estimate (for more precision)
80detailed_estimate = {
81 "method": "5_point",
82 "P10": 45000,
83 "P25": 60000,
84 "P50": 75000,
85 "P75": 95000,
86 "P90": 115000
87}
88```
89
90### Supported Distributions
91
92| Distribution | Use Case | Parameters |
93|-------------|----------|------------|
94| Normal | Symmetric, unbounded | mean, std |
95| Lognormal | Right-skewed, positive | mu, sigma |
96| Triangular | Bounded with mode | min, mode, max |
97| PERT | Bounded, weighted mode | min, mode, max |
98| Uniform | Equal probability | min, max |
99| Beta | Bounded, flexible shape | alpha, beta |
100| Gamma | Positive, right-skewed | shape, scale |
101| Weibull | Reliability/time | shape, scale |
102| Exponential | Memoryless | rate |
103
104### Goodness-of-Fit Tests
105
106- **Kolmogorov-Smirnov (KS)**: Distribution-free, sensitive to center
107- **Anderson-Darling (AD)**: More sensitive to tails
108- **Chi-Square**: Categorical/binned data
109- **Cramér-von Mises**: Similar to KS, different weighting
110
111### Model Selection Criteria
112
113- **AIC (Akaike Information Criterion)**: Balance fit and complexity
114- **BIC (Bayesian Information Criterion)**: Stronger penalty for parameters
115- **Log-Likelihood**: Raw fit quality
116
117## Input Schema
118
119```json
120{
121 "fitting_mode": "data_driven|expert_elicitation",
122 "data_driven_config": {
123 "data": ["number"],
124 "candidate_distributions": ["string"],
125 "fitting_method": "mle|mom|bayesian",
126 "selection_criterion": "AIC|BIC|likelihood"
127 },
128 "expert_elicitation_config": {
129 "method": "3_point|5_point|PERT|direct",
130 "estimates": "object",
131 "confidence_level": "number"
132 },
133 "options": {
134 "gof_tests": ["KS", "AD", "chi_square"],
135 "visualize": "boolean",
136 "compare_all": "boolean"
137 }
138}
139```
140
141## Output Schema
142
143```json
144{
145 "best_fit": {
146 "distribution": "string",
147 "parameters": "object",
148 "gof_statistics": {
149 "test_name": {
150 "statistic": "number",
151 "p_value": "number"
152 }
153 },
154 "selection_score": "number"
155 },
156 "all_fits": [
157 {
158 "distribution": "string",
159 "parameters": "object",
160 "scores": "object"
161 }
162 ],
163 "summary": {
164 "mean": "number",
165 "std": "number",
166 "percentiles": "object"
167 },
168 "visualization_path": "string",
169 "recommendations": ["string"]
170}
171```
172
173## Best Practices
174
1751. Use data-driven fitting when sufficient historical data exists (n > 30)
1762. Validate fitted distributions against holdout data
1773. Use PERT for expert estimates when asymmetry is expected
1784. Document expert credentials and elicitation process
1795. Consider mixture distributions for multimodal data
1806. Always visualize fitted distribution against data/estimates
1817. Use multiple goodness-of-fit tests for robustness
182
183## Expert Elicitation Guidelines
184
1851. Explain probability concepts clearly
1862. Use familiar reference points
1873. Ask for extreme estimates first, then middle
1884. Check for overconfidence (typical: too narrow ranges)
1895. Consider debiasing techniques
1906. Document reasoning behind estimates
191
192## Integration Points
193
194- Feeds into Monte Carlo Engine for simulation inputs
195- Supports Calibration Trainer for expert accuracy assessment
196- Connects with Bayesian Network Analyzer for CPT estimation
197- Integrates with Risk Register Manager for risk quantification