Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with StateSpaceSets v2 #392

Merged
merged 17 commits into from
Nov 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix marginal construction
  • Loading branch information
kahaaga committed Nov 16, 2024
commit 2065e596ea98ce4a01d6a3562036e33ac5233389
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ end

function marginal_entropies_mi3h_discrete(est::EntropyDecomposition{<:MutualInformation, <:DiscreteInfoEstimator}, x, y)
# Encode marginals to integers based on the outcome space.
eX, eY = codified_marginals(est.discretization, x, y)
eXY = StateSpaceSet(eX, eY)
eX::StateSpaceSet, eY::StateSpaceSet = StateSpaceSet.(codified_marginals(est.discretization, x, y))
eXY::StateSpaceSet = StateSpaceSet(eX, eY)

# The outcome space is no longer relevant from this point on. We're done discretizing,
# so now we can just count (i.e. use `UniqueElements` as the outcome space).
o = UniqueElements()

modified_est = estimator_with_overridden_parameters(est.definition, est.est)
HX = information(modified_est, est.pest, o, eX) # estimates entropy in the X marginal
HY = information(modified_est, est.pest, o, eY) # estimates entropy in the Y marginal
Expand Down