-
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
Support initial values for constrained parameters #372
Conversation
Code Coverage Summary
Diff against main
Results for commit: a0a8a6f Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 160 suites 6m 26s ⏱️ Results for commit a9c9f1a. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 39f98f9 ♻️ This comment has been updated with latest results. |
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.
@gowerc A few things to clarify :)
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.
very nice @gowerc !
Closes #268
Generally tried to shield the user from this as much as possible and pushed all code to the behind the scenes. Each model (e.g.
LongitudinalGSF
) is responsible for setting the constraints on the priors which is done viaset_limits()
.initialValues()
then attempts to draw 100 values and discards any that do not meet the constraint. If there is more than 1 value that meets the constraint then 1 of these is sampled at random.For random effects parameters that were having their distribution set based on the initial value of the parent I've tried to reduce the variance of the values being produced by implementing a
median
function. In short this just generates 250 values following the above described method and then just takes the median across these. Originally we were just taking the centre point of the distribution but as users can now specify distributions whose centre point is potentially not a valid value this alternative was required.Misc changes
prior@init
slot toprior@centre
which better represents what this parameter is doing (its meant to denote the centre of the distribution or more accurately the point at which we shrink our initial values towards).test_data_01
which is generated by a helper function started throwing errors when the unit tests were run in parallel. I've had to change the code slightly such that the environment is now individually created in each file that needs it. This does unfortunately add some run time but I couldn't find another solution :(