Skip to content

Commit 9306edc

Browse files
minor tutorials edits
1 parent d02bed8 commit 9306edc

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/tutorials/observation_processes_measurements.qmd

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ from pyrenew.randomvariable import DistributionalVariable
3333
from pyrenew.deterministic import DeterministicVariable, DeterministicPMF
3434
```
3535

36-
# The Measurements Framework
36+
## The Measurements Class
3737

3838
The `Measurements` class models continuous signals derived from infections. Unlike count observations (hospital admissions, deaths), measurements are continuous values that may span orders of magnitude or even be negative (e.g., log-transformed data).
3939

@@ -44,7 +44,7 @@ The `Measurements` class models continuous signals derived from infections. Unli
4444
- Serological assay results
4545
- Environmental sensor readings
4646

47-
## The general pattern
47+
### The general pattern
4848

4949
All measurement observation processes follow the same pattern:
5050

@@ -62,7 +62,7 @@ The `Measurements` base class provides:
6262
- Integration with hierarchical noise models
6363
- Support for multiple sensors and subpopulations
6464

65-
## Comparison with count observations
65+
### Comparison with count observations
6666

6767
The core convolution structure is shared with count observations, but key aspects differ:
6868

@@ -74,7 +74,7 @@ The core convolution structure is shared with count observations, but key aspect
7474
| Scaling | Ascertainment rate $\alpha \in [0,1]$ | Domain-specific |
7575
| Subpop structure | Optional (`CountsBySubpop`) | Inherent (sensor/site effects) |
7676

77-
## The noise model
77+
### The noise model
7878

7979
Measurement data typically exhibits **sensor-level variability**: different instruments, labs, or sampling locations have systematic biases and different precision levels.
8080

@@ -106,7 +106,7 @@ noise = HierarchicalNormalNoise(
106106
)
107107
```
108108

109-
## The indexing system
109+
### The indexing system
110110

111111
Measurement observations use three index arrays to map observations to their context:
112112

@@ -122,7 +122,7 @@ This flexible indexing supports:
122122
- **Multiple sensors per subpopulation**: Different labs analyzing the same source
123123
- **Multiple subpopulations per sensor**: One sensor serving multiple areas (less common)
124124

125-
## Subclassing Measurements
125+
### Subclassing Measurements
126126

127127
To create a measurement process for your domain, subclass `Measurements` and implement:
128128

@@ -151,12 +151,12 @@ class MyMeasurement(Measurements):
151151
```
152152

153153

154-
# Wastewater Example
154+
## Measurement Example: Wastewater
155155

156156
To illustrate the framework, we specify a wastewater viral concentration observation process,
157157
based on the [PyRenew-HEW](https://github.com/cdcgov/pyrenew-hew) family of models.
158158

159-
## The wastewater signal
159+
**The wastewater signal**
160160

161161
Wastewater treatment plants measure viral RNA concentrations in sewage.
162162
The predicted concentration depends on:
@@ -180,7 +180,7 @@ Observations are log-concentrations with normal noise:
180180

181181
$$y_t \sim \text{Normal}(\log(\lambda_t) + \text{sensor\_mode}, \text{sensor\_sd})$$
182182

183-
## Implementing the Wastewater class
183+
### Implementing the Wastewater class
184184

185185
```{python}
186186
# | label: wastewater-class
@@ -264,9 +264,9 @@ class Wastewater(Measurements):
264264
return jnp.log(concentration)
265265
```
266266

267-
## Configuring wastewater-specific parameters
267+
#### Configuring wastewater-specific parameters
268268

269-
### Viral shedding kinetics
269+
**Viral shedding kinetics**
270270

271271
The shedding PMF describes what fraction of total viral shedding occurs on each day after infection:
272272

@@ -329,7 +329,7 @@ shedding_df = pd.DataFrame(
329329
)
330330
```
331331

332-
### Genome copies and wastewater volume
332+
**Genome copies and wastewater volume**
333333

334334
```{python}
335335
# | label: scaling-params
@@ -362,7 +362,7 @@ ww_noise = HierarchicalNormalNoise(
362362
)
363363
```
364364

365-
## Creating the wastewater observation process
365+
### Creating the wastewater observation process
366366

367367
```{python}
368368
# | label: create-process
@@ -376,7 +376,7 @@ ww_process = Wastewater(
376376
print(f"Required lookback: {ww_process.lookback_days()} days")
377377
```
378378

379-
## Demonstrations
379+
## Simulations
380380

381381
### Timeline alignment
382382

@@ -711,7 +711,7 @@ The diverging trajectories reflect the different underlying infection curves. Su
711711

712712
## Summary
713713

714-
The `Measurements` framework provides:
714+
The `Measurements` class provides:
715715

716716
1. **A consistent interface** for continuous observation processes
717717
2. **Hierarchical noise models** that capture sensor-level variability

0 commit comments

Comments
 (0)