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

Implement a SoftAsymmetricLaplace distribution #2872

Merged
merged 8 commits into from
Jun 14, 2021
Merged

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Jun 11, 2021

Resolves #2868

This adds a flexible univariate distribution with exponential tails and an infinitely differentiable concave log density.
image

Numerical stability

This may be numerically unstable due to the log(erfc(-)), which will be replace by torch.logerfc(-) after pytorch/pytorch#31945

Tested

  • Added examples to tests/distributions/conftest.py

pyro/distributions/asymmetriclaplace.py Outdated Show resolved Hide resolved
pyro/distributions/asymmetriclaplace.py Outdated Show resolved Hide resolved
# left = Integrate[e^(-t/L - ((x+t)/S)^2/2)/sqrt(2 pi)/S, {t,0,Infinity}]
# = 1/2 e^((2 L x + S^2)/(2 L^2)) erfc((L x + S^2)/(sqrt(2) L S))
# right = Integrate[e^(-t/R - ((x-t)/S)^2/2)/sqrt(2 pi)/S, {t,0,Infinity}]
# = 1/2 e^((S^2 - 2 R x)/(2 R^2)) erfc((S^2 - R x)/(sqrt(2) R S))
Copy link
Member

Choose a reason for hiding this comment

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

the approach sounds reasonable to me. I haven't checked the details but we can trust the tests I think.

@fritzo
Copy link
Member Author

fritzo commented Jun 14, 2021

@fehiepsi @neerajprad any ideas how to fix coveralls? Our config seems pretty different from the parallel example on github/marketplace/actions.

@fehiepsi fehiepsi merged commit a6d120d into dev Jun 14, 2021
@fehiepsi
Copy link
Member

The coveralls issue is not related to this PR so I just made a fix and merged to see if the dev branch passes CI. We can change what to put to ci.yml file later if needed.

@fritzo
Copy link
Member Author

fritzo commented Jun 14, 2021

Thanks for reviewing @fehiepsi !

@fritzo fritzo deleted the soft-asymmetric-laplace branch September 27, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR an AsymmetricSoftLaplace distribution
2 participants