Skip to content

Updates to Mixture docs. #2799

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

Merged
merged 3 commits into from
Jan 15, 2018
Merged

Updates to Mixture docs. #2799

merged 3 commits into from
Jan 15, 2018

Conversation

ericmjl
Copy link
Member

@ericmjl ericmjl commented Jan 15, 2018

@junpenglao @ColCarroll this is the new PR having nuked my fork and started over 😄.

Please review!

# 2-Mixture Poisson distribution
with pm.Model() as model:
lam = pm.Exponential('lam', lam=1, shape=(2,)) # `shape=(2,)` indicates two mixtures.
components = pm.Poisson.dist(mu=lam, shape=(2,)) # must use dist, not plain Poisson object!
Copy link
Member

@twiecki twiecki Jan 15, 2018

Choose a reason for hiding this comment

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

I would adjust the comment a bit, maybe: # as we just need the logp, rather than add a RV to the model, we need to call .dist()

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@twiecki twiecki merged commit e300f3a into pymc-devs:master Jan 15, 2018
@twiecki
Copy link
Member

twiecki commented Jan 15, 2018

Thanks @ericmjl!

@ericmjl
Copy link
Member Author

ericmjl commented Jan 15, 2018

My pleasure!


Example
-------
# 2-Mixture Poisson distribution
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't display correctly. Need to add the code tag.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to check: should be .. code-block:: python?

Copy link
Member

Choose a reason for hiding this comment

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

http://livesphinx.herokuapp.com/ is directionally helpful

Copy link
Member

Choose a reason for hiding this comment

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

(that is to say, yes, that's it, but then it needs a newline after it, and possibly indentation.)

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