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

create_re: sigmas must be positive #59

Merged
merged 6 commits into from
Feb 16, 2024
Merged

create_re: sigmas must be positive #59

merged 6 commits into from
Feb 16, 2024

Conversation

behinger
Copy link
Collaborator

@behinger behinger commented Feb 4, 2022

No description provided.

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b8d6b75) 95.76% compared to head (f7ce437) 95.79%.

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.
📢 Have feedback on the report? Share it here.

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"
Copy link
Member

Choose a reason for hiding this comment

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

  1. @assert can be optimized out in certain cases, so there's no guarantee that this will execute
  2. On the mixed model side, the restriction is that sigma is greater than or equal to zero (if you're simulating singular fits).
  3. 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.

src/utilities.jl Outdated Show resolved Hide resolved
Copy link
Member

@palday palday left a 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

@palday palday merged commit a53a565 into main Feb 16, 2024
9 of 10 checks passed
@palday palday deleted the be_positive branch February 16, 2024 03:27
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.

None yet

2 participants