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

Update truncated and MvNormal #325

Merged
merged 6 commits into from
Oct 10, 2022
Merged

Update truncated and MvNormal #325

merged 6 commits into from
Oct 10, 2022

Conversation

devmotion
Copy link
Member

This PR updates most MvNormal calls to the new (not deprecated) syntax and truncated to truncated(...; lower=..., upper=...). The last one is less problematic (e.g. for ForwardDiff) in particular if only one bound is non-finite and hence does not have to be specified; additionally, it avoids possibly undesired promotions.

devmotion and others added 5 commits October 5, 2022 13:07
@devmotion devmotion requested a review from yebai October 10, 2022 11:21
using ReverseDiff

using LinearAlgebra
using Random
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why we are switching styles for imports?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no consistent style currently (and also not when this PR is merged), I mainly felt that the diff is simpler when adding or removing packages if they are on separate lines.


# Calculate all the mu terms.
mu = intercept .+ x * coefficients
return y ~ MvNormal(mu, sqrt(σ₂))
return y ~ MvNormal(mu, σ² * I)
Copy link
Member

Choose a reason for hiding this comment

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

This is nicer than the old syntax.

@yebai
Copy link
Member

yebai commented Oct 10, 2022

Thanks, @devmotion - it looks good except for some clarification comments above.

@yebai yebai merged commit ca91841 into master Oct 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the dw/truncated branch October 10, 2022 15:46
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.

2 participants