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

Adding StickBreakingWeights distribution class #5200

Merged
merged 18 commits into from
Jan 18, 2022

Conversation

larryshamalama
Copy link
Member

This pull request adds a class for truncated stick-breaking weights which are vital in the construction of Dirichlet Processes, which I hope to work on soon. See section 1.1 in Ishwaran and James (2001). My previous attempt as a PR is #4971 .

Some tests are failing, will have to resolve them first.

CC: @ricardoV94 @AustinRochford @fonnesbeck

Copy link
Member Author

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

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

Two sets of tests not passing locally in test_distributions.py and test_distributions_moments.py. The test in test_distributions_random.py seems okay (from my perspective)

pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/tests/test_distributions.py Show resolved Hide resolved
pymc/tests/test_distributions_random.py Show resolved Hide resolved
pymc/tests/test_distributions_moments.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #5200 (7885768) into main (d52655d) will increase coverage by 0.01%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5200      +/-   ##
==========================================
+ Coverage   80.36%   80.38%   +0.01%     
==========================================
  Files          89       89              
  Lines       14808    14867      +59     
==========================================
+ Hits        11901    11951      +50     
- Misses       2907     2916       +9     
Impacted Files Coverage Δ
pymc/distributions/__init__.py 100.00% <ø> (ø)
pymc/distributions/multivariate.py 75.57% <93.33%> (+1.44%) ⬆️
pymc/distributions/continuous.py 96.93% <0.00%> (-0.50%) ⬇️

@larryshamalama larryshamalama marked this pull request as draft November 18, 2021 15:25
@larryshamalama larryshamalama force-pushed the add_sbw branch 2 times, most recently from 1fb33c7 to 028d77a Compare December 9, 2021 07:45
Copy link
Member Author

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

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

Question about test_distributions.py

pymc/tests/test_distributions_moments.py Show resolved Hide resolved
pymc/tests/test_distributions.py Show resolved Hide resolved
@larryshamalama larryshamalama marked this pull request as ready for review December 11, 2021 00:16
Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Looks great. Left some comments bellow, mostly concerning tests. Glad to see this PR entering the polishing phase!

pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/tests/test_distributions.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/tests/test_distributions_random.py Show resolved Hide resolved
Copy link
Member Author

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

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

December 20 work in progress

pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/tests/test_distributions_random.py Show resolved Hide resolved
pymc/tests/test_distributions.py Outdated Show resolved Hide resolved
Copy link
Member Author

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

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

Two new sets of tests + question in make_node

pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/tests/test_distributions.py Show resolved Hide resolved
pymc/tests/test_distributions_random.py Show resolved Hide resolved
Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Looks great! Left some comments, let me know if anything is confusing

pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Show resolved Hide resolved
pymc/tests/test_distributions.py Outdated Show resolved Hide resolved
pymc/distributions/multivariate.py Outdated Show resolved Hide resolved
Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

LGTM. Awesome work @larryshamalama

@ricardoV94 ricardoV94 merged commit b71bb74 into pymc-devs:main Jan 18, 2022
@larryshamalama larryshamalama deleted the add_sbw branch January 18, 2022 19:53
@larryshamalama
Copy link
Member Author

As always, thanks so much for all your suggestions and help @ricardoV94

@twiecki
Copy link
Member

twiecki commented Feb 4, 2022

Would be great to have an example NB in pymc-examples that shows how to use this.

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.

3 participants