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

Distributions should return log probability #386

Closed
stephentu opened this issue Jan 16, 2015 · 3 comments
Closed

Distributions should return log probability #386

stephentu opened this issue Jan 16, 2015 · 3 comments
Assignees

Comments

@stephentu
Copy link
Contributor

the distributions should also have log probability (we could call it a score instead). this would encourage and allow consumers (such as HMM) to work in log space as much as possible for better numerical stability.

@rcurtin
Copy link
Member

rcurtin commented Jan 16, 2015

This is related to #230 (and maybe #231).

I would agree that log-probability is a good idea. Maybe it's a good idea to make both available; i.e. leave Probability() intact but also add LogProbability() or something. That should help keep any downstream consumers from converting to and from logspace unnecessarily.

@stephentu
Copy link
Contributor Author

Yes I agree, the implementations should offer both, implement one of them (which ever is faster/more stable), and defer the other to Exp(LogProbability()) or Log(Probability()).

@stephentu stephentu self-assigned this Jan 17, 2015
@stephentu
Copy link
Contributor Author

This is addressed in cb4df6f. Now when the HMM code gets around to using log probabilities, we might consider storing log probabilities directly in DiscreteDistribution to avoid having to compute a log every time. Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants