Skip to content

136 bayesian age sex model#137

Open
alaparicioc wants to merge 29 commits intodevfrom
136-bayesian-age-sex-model
Open

136 bayesian age sex model#137
alaparicioc wants to merge 29 commits intodevfrom
136-bayesian-age-sex-model

Conversation

@alaparicioc
Copy link
Collaborator

Related to issue #136, the current best-performing model is 397_covs_model with sex and customised age groups (0-14, 15-19, 20-29, 30-39, 40-49, 50-59, 60+), with constraints and covariates implemented to integrate Facebook and Instagram daily active users into a single Bayesian framework.

The code is in https://github.com/OxfordDemSci/UkraineNowPop/tree/a303f345e2ab3622718f30da5972648acf1d47f4/src/analysis/multi-source_statistical.

If you have any problems running this model, e.g., coming from the new structure of the repository, let me know and I will modifythe required scripts.

All results are saved in the DemSci shared folder: K:\DemSci\projects\2023_WHO_Ukraine_Population\wd\wd_andrea\out\modelling\397_covs_model

alter the master_index file to match with the most recent model. Feel free to reject this if it messes up with other aspects
code to modify inpt data for stan model
initil values for stan model
code to run model
code to assess parameters
@alaparicioc alaparicioc self-assigned this Jan 11, 2026
@alaparicioc alaparicioc added the modelling_construction Code of different levels of model label Jan 11, 2026
Copy link
Member

@doug-leasure doug-leasure left a comment

Choose a reason for hiding this comment

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

Thanks @alaparicioc . I needed to make quite a few changes here to fix broken paths to get these scripts to work, but I think I've done all of that now. There are a few things that I need you to look at:

  1. See my comment on 397_covs_model_config.R about the many-to-many join and the error generated in that section of code (related to calculating ratio_children_female). I'm worried there is an error here that needs to be corrected.
  2. I integrated your model into the pre-existing workflow, and I would appreciate if you can please try to stick with this going forward so that our various models can be run a bit more interchangeably. See the changes that I made to .../multi-source_statistical/1_mcmc.R and .../multi-source_statistical/models/5_agesex_model_config.R.
  3. I made commits to resolve many of the issues that I found. I documented those with review comments and resolved the comments where I was able to make commits to fix things. Please check the remaining comments that are unresolved and resolve them once you are able to either confirm there is not a problem or make a commit to fix the problem.
  4. I haven't reviewed the eval script yet or worked to integrate it with the pre-existing modelling workflow. I will come back to that once you've fixed the first point.

@alaparicioc
Copy link
Collaborator Author

alaparicioc commented Jan 13, 2026

Hi. Regarding your comments:

  1. See my comment on 397_covs_model_config.R about the many-to-many join and the error generated in that section of code (related to calculating ratio_children_female). I'm worried there is an error here that needs to be corrected.

I went though the code and I did not get the same. I re-run this part of the code and realised the by attribute was the piece of code which was making a difference. I have amended it.

  1. I integrated your model into the pre-existing workflow, and I would appreciate if you can please try to stick with this going forward so that our various models can be run a bit more interchangeably. See the changes that I made to .../multi-source_statistical/1_mcmc.R and .../multi-source_statistical/models/5_agesex_model_config.R.

Will do

  1. I made commits to resolve many of the issues that I found. I documented those with review comments and resolved the comments where I was able to make commits to fix things. Please check the remaining comments that are unresolved and resolve them once you are able to either confirm there is not a problem or make a commit to fix the problem.

Which aspects were unresolved exactly? The only unresolved problem was the many-to-many join, for which I have amended the code. The ones about the warnings are about the last age group. I replied to the comments respectively.

  1. I haven't reviewed the eval script yet or worked to integrate it with the pre-existing modelling workflow. I will come back to that once you've fixed the first point.

Totally fine

Let me know if you find anything else that needs amending.

Additonally, is it possible to keep the README.md in the place where the modified files are? I think that explaining the workflow is useful.

removing indexes to join children and female population
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modelling_construction Code of different levels of model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants