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

Add missing reference model components to delay_group_lmpf and generated quantities #147

Merged
merged 60 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b58ecfe
add required delay_group_lmpf changes for missing ref model
seabbs Jul 31, 2022
3cadc35
debug to compilation
seabbs Jul 31, 2022
a004d8e
add missing reference model to gq
seabbs Jul 31, 2022
5dd2dbc
use segment where possible
seabbs Aug 1, 2022
b235579
add first draft of missing reference look-up
seabbs Aug 1, 2022
48acfdc
correct delay structure
seabbs Aug 1, 2022
9a47a13
model fitting
seabbs Aug 1, 2022
f172d8a
debug allocation of missing reference effects
seabbs Aug 1, 2022
c1e8396
model fitting but not recovering simulated proportion
seabbs Aug 1, 2022
28c47bd
update snaps for enw_missing
seabbs Aug 1, 2022
77cee2d
add plot
seabbs Aug 2, 2022
1856b89
make a output processing
seabbs Aug 2, 2022
a9f8e01
use the correct likelihood you tool
seabbs Aug 2, 2022
28a0d58
make example multi-threaded
seabbs Aug 2, 2022
ddee268
use the correct helper function (log1m_exp not log1m)
seabbs Aug 2, 2022
85a4617
add enw_incidence_to_cumulativ and update enw_new_reports to match
seabbs Aug 10, 2022
0223a5c
update nowcast date for missing example and clean up code
seabbs Aug 10, 2022
7bbd646
reset to same date as used in all other examples
seabbs Aug 10, 2022
3da960e
fix merge issues and turn off warning
seabbs Aug 10, 2022
f726334
use a fixed proportion missing
seabbs Aug 10, 2022
d5dbd24
explore example
seabbs Aug 11, 2022
09e5536
add enw_incidence_to_cumulative
seabbs Aug 11, 2022
c009112
add enw_incidence_to_cumulative
seabbs Aug 11, 2022
ac9c2dd
local CRAN check
seabbs Aug 11, 2022
6a7aac5
solve merge conflicts
seabbs Aug 11, 2022
7a00cbe
add internal helper functions for missing reference lookup
seabbs Aug 11, 2022
4aa7a18
add new global variables
seabbs Aug 11, 2022
be5bbe8
update wordlist
seabbs Aug 11, 2022
d9e8f4f
Merge branch 'develop' into feature-missing-reference-function
seabbs Aug 12, 2022
8a09ec7
add missing refeerence model definition
seabbs Aug 12, 2022
2d1964e
Merge branch 'feature-missing-reference-function' of https://github.c…
seabbs Aug 12, 2022
0d45c7b
write tests for enw_reps_with_complete_refs
seabbs Aug 16, 2022
8e7c1de
fix indexing bug with enw_reference_by_report
seabbs Aug 16, 2022
e77c079
merge develop
seabbs Aug 16, 2022
74ad2df
fix issues from #151 causing spurious warnings
seabbs Aug 16, 2022
8029a18
fix failing tests due to sorting standardisation
seabbs Aug 16, 2022
0b64683
debug ordering changes
seabbs Aug 16, 2022
caef167
more test fixes
seabbs Aug 16, 2022
83ef418
fix enw_complete_dates tests
seabbs Aug 17, 2022
bd0a430
add enw_simulate_missing_reference to package
seabbs Aug 17, 2022
b6cc38f
exporte enw_simulate_missing_reference
seabbs Aug 17, 2022
5808134
make cmdstanr tests skip locally
seabbs Aug 17, 2022
6a2ab6d
complete missing model convergence check
seabbs Aug 17, 2022
79154a5
update news and contribnuting
seabbs Aug 17, 2022
38ae0d0
typo in contributing
seabbs Aug 18, 2022
40af056
Change temp variable name
adrian-lison Aug 30, 2022
b890f81
Refactor filt_obs_indexed
adrian-lison Aug 30, 2022
1a7cb2c
Fix filt_obs_indexes
adrian-lison Aug 30, 2022
5231dec
Improve in-model code doc
adrian-lison Aug 31, 2022
a68bf80
Streamline time wording in in-model doc
adrian-lison Aug 31, 2022
3cbe6b4
Refactor variable names in delay_group_lpmf
adrian-lison Sep 1, 2022
6f3ff55
add localisation changes from main
seabbs Sep 1, 2022
da55c32
Merge branch 'develop' into feature-missing-reference-function
seabbs Sep 1, 2022
0e6a1c7
add usage warning for the missing data MVP
seabbs Sep 1, 2022
11d647b
update news
seabbs Sep 1, 2022
2686216
spelling and global variables
seabbs Sep 1, 2022
2ec8058
add handling of group-wise missing reference observations and look-ups
seabbs Sep 1, 2022
c3494e5
use filtered missing reference obs in likelihood
seabbs Sep 1, 2022
aeb7eef
add missing lookup variables
seabbs Sep 1, 2022
8bdf530
update test snapshot
seabbs Sep 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
debug allocation of missing reference effects
  • Loading branch information
seabbs committed Aug 1, 2022
commit f172d8a98b65a3795e15e08d28294e80bb3b6aef
4 changes: 2 additions & 2 deletions R/model-modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ enw_missing <- function(formula = ~1, data) {
data_list <- enw_formula_as_data_list(
prefix = "miss", drop_intercept = FALSE
)
data_list$missing_ref <- numeric(0)
data_list$obs_by_rep <- numeric(0)
data_list$missing_reference <- numeric(0)
data_list$obs_by_report <- numeric(0)
data_list$model_miss <- 0
data_list$miss_obs <- 0
} else {
Expand Down
2 changes: 1 addition & 1 deletion inst/stan/epinowcast.stan
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ generated quantities {
// Draw from observation model for observed counts with report and reference
pp_obs_tmp = obs_rng(log_exp_obs, phi, model_obs);
}

// Likelihood by snapshot (rather than by observation)
profile("generated_loglik") {
if (ologlik) {
Expand Down
3 changes: 2 additions & 1 deletion inst/stan/functions/apply_missing_reference_effects.stan
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ vector apply_missing_reference_effects(int start, int end, vector obs,
vector[n[3]] alloc_obs;
for (i in start:end) {
array[3] int l = filt_obs_indexes(i, i, csl, sl);
alloc_obs[(l[1] + 1):l[2]] = alloc_obs[(l[1] + 1):l[2]] + miss_ref_lprop[i];
alloc_obs[(l[1] + 1):l[2]] =
segment(obs, l[1] + 1, l[3]) + miss_ref_lprop[i];
}
return(alloc_obs);
}