Skip to content

Heterogeneity index update - #62

Merged
gnopik merged 6 commits into
mainfrom
heterogeneity-index-update
Sep 19, 2026
Merged

gnopik merged 6 commits into
mainfrom
heterogeneity-index-update

Conversation

@gnopik

@gnopik gnopik commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

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:

H = simdec.heterogeneity_indices(
    output=y,
    inputs=X
)

Custom partition:

H = simdec.heterogeneity_indices(
    output=y,
    inputs=X,
    custom_partition=Z
)

Results:

H.indices
H.details["X1"]
H.plot("X1")

@netlify

netlify Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploy Preview for simdec-io ready!

Name Link
🔨 Latest commit 6fcd662
🔍 Latest deploy log https://app.netlify.com/projects/simdec-io/deploys/6aae42739d58a60008a695a5
😎 Deploy Preview https://deploy-preview-62--simdec-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@tupui tupui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 👍

Comment thread src/simdec/heterogeneity_indices.py Outdated
Comment on lines +8 to +9
import simdec as sd
from .sensitivity_indices import sensitivity_indices

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad, imports should not be relative.

@gnopik
gnopik merged commit 1c76e79 into main Sep 19, 2026
8 checks passed
@gnopik
gnopik deleted the heterogeneity-index-update branch September 19, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants