Commit 1c76e79
authored
Heterogeneity index update (#62)
## Summary
Updates the heterogeneity index implementation to match the generalized
methodology.
- computes heterogeneity for the output and all inputs in one call
- normalizes regional sensitivity profiles before calculating H
- supports continuous and categorical custom partitions
- excludes a categorical input from its own regional sensitivity profile
- skips H_Y for categorical outputs with an explanatory warning
- exposes raw and normalized profiles, regional SI sums, region counts,
and individual contributions through H.details
- adds plotting from the returned HeterogeneityResult object
- uses a minimum regional sample size of 100 observations
- adds unit tests for the new behavior
## API
Basic analysis:
```python
H = simdec.heterogeneity_indices(
output=y,
inputs=X
)
```
Custom partition:
```python
H = simdec.heterogeneity_indices(
output=y,
inputs=X,
custom_partition=Z
)
```
Results:
```python
H.indices
H.details["X1"]
H.plot("X1")
```1 parent 1405643 commit 1c76e79
2 files changed
Lines changed: 760 additions & 270 deletions
0 commit comments