-
Notifications
You must be signed in to change notification settings - Fork 101
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
Conversation
tutorials/10-bayesian-differential-equations/10_bayesian-differential-equations.jmd
Outdated
Show resolved
Hide resolved
tutorials/10-bayesian-differential-equations/10_bayesian-differential-equations.jmd
Outdated
Show resolved
Hide resolved
tutorials/10-bayesian-differential-equations/10_bayesian-differential-equations.jmd
Outdated
Show resolved
Hide resolved
…rential-equations.jmd Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
using ReverseDiff | ||
|
||
using LinearAlgebra | ||
using Random |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Thanks, @devmotion - it looks good except for some clarification comments above. |
This PR updates most
MvNormal
calls to the new (not deprecated) syntax andtruncated
totruncated(...; 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.