Skip to content

Commit

Permalink
Merge branch 'main' into 435-update-infectionswithfeedback-process-to…
Browse files Browse the repository at this point in the history
…-handle-batch-input-within-numpyro-plate-context
  • Loading branch information
sbidari authored Sep 10, 2024
2 parents f89aa9d + 145ced6 commit b7fb437
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pip install git+https://github.com/CDCgov/PyRenew@main

## Models Implemented With PyRenew

- [CDCgov/pyrenew-covid-wastewaterpyrenew-covid-wastewater](https://github.com/CDCgov/pyrenew-covid-wastewater): _Models and infrastructure for forecasting COVID-19 hospitalizations using wastewater data with PyRenew._
- [CDCgov/pyrenew-covid-wastewater](https://github.com/CDCgov/pyrenew-covid-wastewater): _Models and infrastructure for forecasting COVID-19 hospitalizations using wastewater data with PyRenew._
- [CDCgov/pyrenew-flu-light](https://github.com/CDCgov/pyrenew-flu-light/): _An instantiation in PyRenew of an influenza forecasting model used in the 2023-24 respiratory season._

## Resources
Expand Down
2 changes: 1 addition & 1 deletion pyrenew/convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def _new_scanner(


def compute_delay_ascertained_incidence(
p_observed_given_incident: ArrayLike,
latent_incidence: ArrayLike,
delay_incidence_to_observation_pmf: ArrayLike,
p_observed_given_incident: ArrayLike = 1,
) -> ArrayLike:
"""
Computes incidences observed according
Expand Down
2 changes: 1 addition & 1 deletion pyrenew/latent/hospitaladmissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def sample(
) = self.infection_to_admission_interval_rv(**kwargs)

latent_hospital_admissions = compute_delay_ascertained_incidence(
infection_hosp_rate.value,
latent_infections.value,
infection_to_admission_interval.value,
infection_hosp_rate.value,
)

# Applying the day of the week effect. For this we need to:
Expand Down
13 changes: 12 additions & 1 deletion test/test_incidence_observed_with_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,19 @@ def test(obs_rate, latent_incidence, delay_interval, expected_output):
incidence observed with a delay
"""
result = compute_delay_ascertained_incidence(
obs_rate,
latent_incidence,
delay_interval,
obs_rate,
)
assert_array_equal(result, expected_output)


def test_default_obs_rate():
"""
Compute incidence observed with a delay and default observation rate
"""
result = compute_delay_ascertained_incidence(
jnp.array([1.0, 2.0, 3.0]),
jnp.array([1.0]),
)
assert_array_equal(result, jnp.array([1.0, 2.0, 3.0]))

0 comments on commit b7fb437

Please sign in to comment.