-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add missing reference model components to delay_group_lmpf and generated quantities #147
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
The indexing is savage but I couldn't spot any flaws.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Did a little more work on this and fixed a small bug in the ordering of data for the simulation that may have been causing some issues. The issue with not recovering missingness proportions sadly has not been resolved and appears to be present across multiple nowcast dates (though not always an underestimate),. I have now:
I still need to:
Example nowcast (with a daily random walk on the proportion missing)Note: Not entirely clear what is driving the day of the week effect seen here) Example nowcast (fixed proportion missing)Example nowcast (fixed proportion missing for a different date) |
So I was in a pedantic mood and made some changes to the in-code model documentation to make it a bit more intuitive (at least for me - hoping my brain is not too strange so others would profit as well 😆 ) |
This is still a riddle. Using print statements in stan, and copying the results into R (as a replacement for debugging), I have verified that no observations from imp_obs get lost further downstream:
|
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.
@adrian-lison changes look good. Updates to model documentation are a big improvement.
I thought that this issue was maybe due to how we define the random walk (i.e it starts from |
The model being overly flexible in the wrong places is a sensible suggestion. If we moved testing to the implementations that also have a flexible expectation model that would perhaps help explore this?
Could this also be a tension between picking a more extreme growth rate and the right missingness proportion? The log-normal random walk may limit the amount of change over time required to fit this data well.
This is a good suggestion and could well be the root cause. Both options for exploring are sensible. In general, we are crying out for a model simulator to ease testing and boost confidence. Something that also concerns me is that perhaps this is highlighting a bug elsewhere. Perhaps with model specification or allocation of delays? I was fairly confident that was all working as intended but it hasn't recently been tested on clean simulated data (i.e not since initial development).
This I found quite concerning and enforces my concern there is a bug elsewhere. Seems quite hard to explain/understand. In terms of moving this forward, I wonder if perhaps we should merge this into (this is a great investigation by the way, can you put the exploratory code for this somewhere so we can explore more in the future?) |
Proposed tasks to get an MVP to merge:
|
Hey sam, thanks for your replies! I agree that adding this to develop may be a good idea. I think I can work on the open tasks as suggested above by you. Can add my investigation code to the example script we already have. For my own models, I have written a simulator that creates linelists based on a renewal process, which can then be used to create nowcasting datasets. I could maybe create a PR for this, although it would be more work to get it into the style of epinowcast (need to switch from dplyr to data.table e.g.). |
So I think I have covered the minimum ground required to merge this as is.....
I think this would be useful.
Yeah I think having something in the repository we can play with would be great - regardless of implementation style. Perhaps lets add to the repo and put in the |
As discussed I have gone ahead and merged this into |
As pointed out in #138 I have now made things a bit complicated for us (@adrian-lison and myself) in terms of implementing the missing reference model. This PR aims to implement a simplistic version of the missing reference model to the
delay_group_lmpf
and to the generated quantities with the idea we can make an improved version in the future/based on this implementation.So far I have implemented:
delay_group_lpmf
based on if the missingness model is requireddmax
) observations to just observed observationsBefore being marked as not a draft this PR needs:
enw_missing()
This PR implements part of #43.