[ENH] Addition of Set representation and support-aware plotting#983
Open
Khushmagrawal wants to merge 1 commit intosktime:mainfrom
Open
[ENH] Addition of Set representation and support-aware plotting#983Khushmagrawal wants to merge 1 commit intosktime:mainfrom
Khushmagrawal wants to merge 1 commit intosktime:mainfrom
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Reference Issues/PRs
Fixes #244
What does this implement/fix? Explain your changes.
I have implemented hierarchy of set classes to represent the mathematical support of distributions:
RealSet,IntegerSet,IntervalSet,FiniteSet, andEmptySet,UnionSetandIntersectionSet. These sets are designed to be tabular, meaning a single set object can store parameters (bounds/values) as arraysThe
BaseDistributionnow includes asupportproperty). This would allow distributions to programmatically communicate where their probability mass/density resides. This method was overrided currently only in few distributions to test different types of set -Binomial(IntegerSet),Poisson(IntegerSet),Empirical(FiniteSet),TruncatedDistribution(IntersectionSet), andZeroInflated(UnionSet) have been updated.The
plotfunctionality has been changed to usesupport.boundary()to determine exact x-axis limits. For discrete and mixed distributions, the plotter now queries the support for FiniteSet or IntegerSet components to identify exact coordinates for stem plots.Does your contribution introduce a new dependency? If yes, which one?
No new dependencies are introduced.
What should a reviewer concentrate their feedback on?
_plot_single, mixed distributions (like ZeroInflated) for pdf currently plot the continuous part as a line and the discrete mass as stems. Mathematically, a PDF of a mixed distribution includes Dirac delta spikes (infinite density). To distinguish Mass from Density, we mask the PDF line at spike points using np.isclose, would that be right?_get_bc_params(We currently utilizeoned_as="col"to force 1D parameter arrays ) into column vectors(N, 1))Did you add any tests for the change?
Yes,
test_set.pyhas been added to verify the symbolic set logicAny other comments?
Includes a minor fix for
ZeroInflated._ilocto ensure scalar-scalar indexing correctly delegates to_iat, which was necessary for cell-level plotting in array distributionsPR checklist
For all contributions
How to: add yourself to the all-contributors file in the
skproroot directory (not theCONTRIBUTORS.md). Common badges:code- fixing a bug, or adding code logic.doc- writing or improving documentation or docstrings.bug- reporting or diagnosing a bug (get this pluscodeif you also fixed the bug in the PR).maintenance- CI, test framework, release.See here for full badge reference