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

Closes #1213 added logpdf for BernoulliLogit #1214

Merged
merged 3 commits into from
Apr 9, 2020

Conversation

HarrisonWilde
Copy link
Member

…Logit to distributions.jl

@devmotion
Copy link
Member

I'm not sure if separate types are necessary here, wouldn't just another constructor be sufficient?

I also don't think one should define separate vector-valued distributions since one can define it easily as a product of univariate distributions (in fact, I think VecBinomialLogit should be removed).

@HarrisonWilde
Copy link
Member Author

That is fair enough, agreed on the vector distributions, I did think it unnecessary but thought I would follow the lead of BinomialLogit, should I remove all of them then?

And what do you mean by another constructor sorry?

@codecov
Copy link

codecov bot commented Apr 8, 2020

Codecov Report

Merging #1214 into master will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1214      +/-   ##
==========================================
- Coverage   65.64%   65.59%   -0.06%     
==========================================
  Files          25       25              
  Lines        1278     1279       +1     
==========================================
  Hits          839      839              
- Misses        439      440       +1     
Impacted Files Coverage Δ
src/Turing.jl 100.00% <ø> (ø)
src/stdlib/distributions.jl 52.38% <0.00%> (-1.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5c47f1...7b96e50. Read the comment docs.

@devmotion
Copy link
Member

That is fair enough, agreed on the vector distributions, I did think it unnecessary but thought I would follow the lead of BinomialLogit, should I remove all of them then?

Just don't add VecBernoulliLogit, I'd say 😃

And what do you mean by another constructor sorry?

Sorry, I should have explained it better. I meant that maybe it would be sufficient to add the line

BernoulliLogit(logitp::Real) = BinomialLogit(1, logitp)

and export BernoulliLogit. Then users would be able to use BernoulliLogit but actually internally we would still use the BinomialLogit distribution, so it would just be an additional convenient constructor for BinomialLogit.

@HarrisonWilde HarrisonWilde changed the title Closes #1213 added pdf and logpdf for BernoulliLogit and VecBernoulli… Closes #1213 added logpdf for BernoulliLogit and VecBernoulli… Apr 9, 2020
@HarrisonWilde HarrisonWilde changed the title Closes #1213 added logpdf for BernoulliLogit and VecBernoulli… Closes #1213 added logpdf for BernoulliLogit Apr 9, 2020
@yebai yebai merged commit 5440b3f into TuringLang:master Apr 9, 2020
phipsgabler pushed a commit to phipsgabler/Turing.jl that referenced this pull request May 12, 2020
* Closes TuringLang#1213 added pdf and logpdf for BernoulliLogit and VecBernoulliLogit to distributions.jl

* Closes TuringLang#1213 added constructor for BernoulliLogit to call BinomialLogit(1, p) to distributions.jl

Co-authored-by: Hong Ge <[email protected]>
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