-
Notifications
You must be signed in to change notification settings - Fork 4
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
create_re: sigmas must be positive #59
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
+ Coverage 95.76% 95.79% +0.03%
==========================================
Files 4 4
Lines 118 119 +1
==========================================
+ Hits 113 114 +1
Misses 5 5 ☔ View full report in Codecov by Sentry. |
src/utilities.jl
Outdated
@@ -281,6 +281,7 @@ random effects. | |||
[`update!`](@ref) requires. | |||
""" | |||
function create_re(sigmas...; corrmat=nothing) | |||
@assert all(>(0),sigmas) "all σs must be positive" |
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.
@assert
can be optimized out in certain cases, so there's no guarantee that this will execute- On the mixed model side, the restriction is that sigma is greater than or equal to zero (if you're simulating singular fits).
- I have very mixed feelings about this level of hand holding. While this is certainly an assumption of the code (and should probably be mentioned in the docstring), a user that knowlingly passes a negative variance for simulation can't be trusted with simulation at all. 😉 If it's about catching sigmas that were programmatically generated elsewhere and there was a bug in that elsewhere, then elsewhere should be responsible for its own bug.
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.
CI failures seem unrelated
No description provided.