analyzer
laser.cholera.metapop.analyzer
¶
End-of-run model-likelihood analyzer.
On the final tick, calls
calc_model_likelihood
with observed and estimated reported cases / deaths, plus any optional
weight / sigma / epidemic-peak parameters available on model.params,
and stashes the scalar result on model.log_likelihood. Gated on
params.calc_likelihood; if disabled, model.log_likelihood is set
to nan; if the likelihood call raises ValueError, it's set to
-inf so downstream code (calibration sweeps, etc.) can detect the
failure without a try/except at every call site.
Analyzer
¶
Final-tick likelihood evaluator for calibration / scoring workflows.
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The parent |
Source code in src/laser/cholera/metapop/analyzer.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
__init__
¶
Register the analyzer on the model (no state is allocated).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The |
required |
check
¶
No-op: Analyzer has no prerequisites that need pre-tick validation.
The likelihood call validates its own inputs on the final tick.
__call__
¶
Calculate log likelihood on the final tick.
Source code in src/laser/cholera/metapop/analyzer.py
plot
¶
Yield one Matplotlib figure overlaying every SEIRV channel for the largest patch.
Pulls the R-transposed series from model.results (so channels
are indexed [patch, tick]) and plots all of S, Isym,
Iasym, R, V1, V2 for the single largest-by-initial-S
patch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure
|
Optional existing Matplotlib |
None
|
Yields:
| Type | Description |
|---|---|
str
|
The string label |