Skip to content

Conversation

@TimothyWillard
Copy link
Collaborator

No description provided.

Added `dataframe` method to `vaxflux.uptake.SeasonalUptakeModel` to
create a pandas DataFrame of each posterior incidence time series.
Preliminary usage of the `SeasonalUptakeModel.dataframe` method and
attempts to diagnose fitting issues.
@TimothyWillard TimothyWillard force-pushed the dataframe-extraction-utilities branch from 11077f9 to c855223 Compare April 2, 2025 13:20
Added internal `vaxflux.covariates._covariate_categories_product`
utility for quickly creating a product of user provided
`CovariateCategories`s to loop over.
Added a function to generate a set of valid observations from user
provided inputs for the purpose of generating test data.
Added a new demo notebook, `synthetic_data.ipynb` to demo the usage of
`vaxflux.data.sample_dataset`.
@TimothyWillard TimothyWillard force-pushed the dataframe-extraction-utilities branch from 2ba9ff1 to fb127e4 Compare April 2, 2025 17:02
Changed the `epsilon` argument of `vaxflux.data.sample_dataset` to not
have a default value.
Fixed bug where `vaxflux.dates._infer_ranges_from_observations` could
not create `SeasonRange` because the provided columns were called
'season_start/end_date' instead of 'start/end_date'. Fixed issue by
adding helper to `vaxflux._util._rename_keys` to rename those dict keys
before creating `SeasonRange` instance.
Attempted to fit a model to the synthetic data generated in the
`synthetic_data.ipynb` demo notebook. However, model does not want to
sample due to an indexing issue.
Fixed bug where the season and covariate category limited dims were
incorrectly swapped for
`vaxflux.covariates.GaussianRandomWalkCovariate`. Bug allowed for the
case of those being equal to work, but would constraint seasons to the
covariate category limited size when season was larger silently.
Successfully ran sampling after the season and category limited dims
switch bug fix, but sampling still displays convergence issues.
Added broad keyword arguments to the
`vaxflux.uptake.SeasonalUptakeModel` starting with
'constrain_prevalence', a boolean to dictate if a potential term
constraining prevalence to [0,1] should be included.
Still getting fitting issues even with the prevalence constraint
potential removed.
Allow a user to specify the observational sigma to relax fitting
strictness. Appears to be the main cause of chain non-mixing from
before.
Updated this demo with fits, don't look great but are mixing.
Added a custom option to pool the `epsilon` parameter across time series
to share more information. This is helpful if there is good reason to
believe variation will be similar (i.e. comparable population sizes),
but won't work in general. Might be worth at some point trying to scale
this parameter by population size.
Fits seem to display some odd upward bias in fits that need to be
examined. First checking that analytically the sum is being done
correctly and then seeing if the sampling procedure might be introducing
bias.
For the synthetic data demo:
* Shortened the data by a month since later data wasn't doing much, and
* Added more plots for the parameter estimates, seems clear that the
  model is systematically mis-estimating many of the parameters.
@TimothyWillard TimothyWillard force-pushed the dataframe-extraction-utilities branch from 90af5a2 to 8ff838b Compare April 3, 2025 18:40
Even with tightened priors the model still has biased estimates for some
of the parameters.
Added `vaxflux.interventions` module with the `Intervention` class to
represent the affect of an intervention on the parameters for uptake.
Added a pydantic object to represent the implementation of an
intervention, allows for the ability to re-use interventions across
seasons and covariates.
Attempted to implement a custom log-probability for the sum of gamma
distributed variables, however the prelim fitting results did not look
very promising.
@TimothyWillard TimothyWillard merged commit 734ddd5 into main Apr 3, 2025
3 checks passed
@TimothyWillard TimothyWillard deleted the dataframe-extraction-utilities branch April 3, 2025 21:52
TimothyWillard added a commit that referenced this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants