Skip to content

Commit

Permalink
WIP with unit-test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Nov 7, 2024
1 parent f67557c commit 7a19942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion inst/analysis/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@
"RemoteUsername": "cmmid",
"RemoteRepo": "paramix",
"RemoteRef": "main",
"RemoteSha": "7d5e46f5afe942a94bd8486c5f1dc48756163261",
"RemoteSha": "f67557c943c3111027d12d84d457d408431cde54",
"Requirements": [
"R",
"data.table"
Expand Down
10 changes: 6 additions & 4 deletions inst/analysis/scripts/param.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,22 @@ for (i in seq_along(widths)) {
}
}

bound_pop_dt <- pop_dt[, .(from = c(from, max(from) + 1L), weight = c(weight, 0))]

mapping_dt <- alembic(
f_param = f_ifr, f_pop = pop_dt[, .(from, weight)],
f_param = f_ifr, f_pop = bound_pop_dt,
model_partition = model_agelimits,
output_partition = pop_dt[, seq(min(from), max(from) + 1L)]
output_partition = bound_pop_dt[, seq(min(from), max(from))]
)

# using `parameter_summary` instead of `blend`, because we want to compare to
# the naive alternatives
ifr_params <- parameter_summary(
f_param = f_ifr, f_pop = pop_dt[, .(from, weight)],
f_param = f_ifr, f_pop = bound_pop_dt,
model_partition = model_agelimits
)

ifr_params[, model_from := model_agelimits[model_category]]
ifr_params[, model_partition := model_agelimits[model_category]]

save(
model_agelimits, ifr_params, mapping_dt, cmij, sim_pars, cmijfull,
Expand Down

0 comments on commit 7a19942

Please sign in to comment.