Real-time nowcasting: right-truncation vs the reporting triangle
In real time the most recent days of a surveillance series are incomplete. A case with reference day
].
This package corrects right-truncation two ways, and this tutorial fits and compares both on the same simulated data. RightTruncate is the marginal correction. It keeps only each reference day's observed-so-far total and scales the expected count by the reporting-delay CDF, the EpiNow2-style CDF-scaling nowcast. ReportTriangle is the joint correction. It keeps the full reference-day × reporting-delay triangle and scores it cell by cell, the epinowcast-style nowcast. The two share one reporting-delay kernel, so the triangle's observed row-sums are exactly the observed-so-far totals the marginal correction conditions on. Both leave the renewal infection process and its latent
The two corrections
The infection pipeline produces
Summing the joint model's observed cells over
The renewal model
Both corrections wrap the same composed renewal model as the renewal tutorial, an autoregressive Renewal infection process observed with a NegativeBinomialError.
using ComposableTuringIDModels, Distributions, Random, Turing, Mooncake
using ADTypes: AutoMooncake
using CSV, DataFrames
Random.seed!(20240625)
adt = AutoMooncake(; config = nothing)
latent = AR(
damp = [truncated(Normal(0.8, 0.05), 0, 1)],
init = [Normal(0.0, 0.25)],
ϵ_t = HierarchicalNormal(std = HalfNormal(0.1)))
renewal = Renewal(; generation_time = Gamma(1.4, 1 / 0.38),
rt = latent, initialisation = Normal(log(1.0), 1.0))
error = NegativeBinomialError(cluster_factor = HalfNormal(0.1))Simulate a reporting triangle
We take the fully-reported Italy confirmed-case series as the eventual totals, split each day's total across reporting delays with the delay PMF, then mask the cells not yet reported at ReportingPMF discretises the reporting delay with the same CensoredDistributions.jl path the rest of the package uses.
datapath = joinpath(pkgdir(ComposableTuringIDModels),
"docs", "src", "tutorials", "data", "italy_data.csv")
italy = CSV.read(datapath, DataFrame)
n = 45
eventual = italy.confirm[1:n] # eventual (complete) totals
reporting_delay = LogNormal(1.6, 0.5) # mean ≈ 5.6 days
delay_pmf = ReportingPMF(reporting_delay; D = 10)
pmf = delay_pmf.pmf # delays 0 … Dmax
Dmax = length(pmf) - 1Split each reference day's eventual total across delays with a multinomial draw, then keep only the cells reported by
full_triangle = reduce(vcat,
(permutedims(rand(Multinomial(eventual[t], pmf))) for t in 1:n))
mask = [t + d <= n for t in 1:n, d in 0:Dmax]
reported_triangle = full_triangle .* mask
observed_so_far = vec(sum(reported_triangle, dims = 2))
(complete_tail = eventual[(end - 4):end],
truncated_tail = observed_so_far[(end - 4):end])(complete_tail = [4782, 4668, 4585, 4805, 4316], truncated_tail = [2245, 1249, 432, 58, 0])The recent days are visibly thinned, the most recent day showing only a fraction of its eventual count.
Visualise the data
The reporting triangle is the native data object. Plotting it with AlgebraOfGraphics, the not-yet-reported cells blanked, shows the staircase of missing counts in the recent corner.
using AlgebraOfGraphics, CairoMakie, DataFrames
tri_df = DataFrame(
reference = repeat(1:n, outer = Dmax + 1),
delay = repeat(0:Dmax, inner = n),
count = vec(full_triangle),
reported = vec(mask))
tri_df.shown = ifelse.(tri_df.reported, Float64.(tri_df.count), NaN)
draw(data(tri_df) *
mapping(:reference, :delay, :shown => "Reported cases") * visual(Heatmap);
axis = (xlabel = "Reference day", ylabel = "Reporting delay (days)"))
The same truncation reads as a shortfall in the tail when the observed-so-far row-sums are drawn against the eventual totals.
comp_df = DataFrame(
reference = repeat(1:n, 2),
count = vcat(eventual, observed_so_far),
series = repeat(["eventual total", "observed so far"], inner = n))
draw(data(comp_df) * mapping(:reference, :count, color = :series) *
visual(Lines); axis = (xlabel = "Reference day", ylabel = "Cases"))
Three fits
We fit the plain renewal model three ways with NUTS, drawing four chains with 1000 warmup iterations each so the cross-chain RightTruncate applies the marginal correction to the same observed-so-far totals. ReportTriangle applies the joint correction to the reporting triangle, built through the shared define_y_t hook.
naive_model = IDModel(renewal, error)
naive_post = as_turing_model(naive_model, observed_so_far, n)
naive_chain = sample(
naive_post, NUTS(1000, 0.95; adtype = adt), MCMCThreads(), 250, 4;
progress = false)
rt_obs = RightTruncate(error, ReportingCDF(reporting_delay; D = 10))
rt_model = IDModel(renewal, rt_obs)
rt_post = as_turing_model(rt_model, observed_so_far, n)
rt_chain = sample(
rt_post, NUTS(1000, 0.95; adtype = adt), MCMCThreads(), 250, 4;
progress = false)
tri_obs = ReportTriangle(error, delay_pmf)
tri_data = define_y_t(tri_obs, reported_triangle, eventual)
tri_model = IDModel(renewal, tri_obs)
tri_post = as_turing_model(tri_model, tri_data, n)
tri_chain = sample(
tri_post, NUTS(1000, 0.95; adtype = adt), MCMCThreads(), 250, 4;
progress = false)┌ Info: Found initial step size
└ ϵ = 0.025
┌ Info: Found initial step size
└ ϵ = 0.025
┌ Info: Found initial step size
└ ϵ = 0.00625
┌ Info: Found initial step size
└ ϵ = 0.0125
┌ Warning: There were 4 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Warning: There were 4 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Info: Found initial step size
└ ϵ = 0.025
┌ Info: Found initial step size
└ ϵ = 0.003125
┌ Info: Found initial step size
└ ϵ = 0.025
┌ Info: Found initial step size
└ ϵ = 0.00625
┌ Warning: There were 2 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Warning: There were 6 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Warning: There were 8 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Info: Found initial step size
└ ϵ = 0.0125
┌ Info: Found initial step size
└ ϵ = 0.0125
┌ Info: Found initial step size
└ ϵ = 0.0125
┌ Info: Found initial step size
└ ϵ = 0.0125As a reference we also fit the plain model to the complete (untruncated) series, what the analyst would eventually see.
complete_post = as_turing_model(naive_model, eventual, n)
complete_chain = sample(
complete_post, NUTS(1000, 0.95; adtype = adt), MCMCThreads(), 250, 4;
progress = false)┌ Info: Found initial step size
└ ϵ = 0.00625
┌ Info: Found initial step size
└ ϵ = 0.003125
┌ Info: Found initial step size
└ ϵ = 0.00078125
┌ Info: Found initial step size
└ ϵ = 0.0125
┌ Warning: There were 1 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483
┌ Warning: There were 1 divergent transitions. Consider reparameterising your model or using a smaller step size. For adaptive samplers such as NUTS and HMCDA, consider increasing `target_accept`.
└ @ Turing.Inference ~/.julia/packages/Turing/4sXd9/src/mcmc/hmc.jl:483Recent Rt
generated_observables. Averaging it over the most recent window shows the bias and its removal. Right-truncation biases the naive recent
using Statistics
function recent_Rt(post, chain; window = 7)
gens = vec(generated_observables(post, nothing, chain).generated)
Rt_mean = mean(exp.(g.Z_t) for g in gens)
round(mean(Rt_mean[(end - window + 1):end]), digits = 2)
end
(complete = recent_Rt(complete_post, complete_chain),
naive = recent_Rt(naive_post, naive_chain),
right_truncate = recent_Rt(rt_post, rt_chain),
report_triangle = recent_Rt(tri_post, tri_chain))(complete = 0.91, naive = 0.3, right_truncate = 0.9, report_triangle = 0.88)Posterior prediction, nowcast, and Rt
Three views of the fits share the reference-day axis with the recent window shaded. The RightTruncate model's posterior-predictive observed-so-far, recovered with predict on the same model with the observations set to missing, against the data it was fit to.
ts = 1:n
Rt_complete = gen_bands(complete_post, complete_chain, g -> exp.(g.Z_t))
Rt_naive = gen_bands(naive_post, naive_chain, g -> exp.(g.Z_t))
Rt_rt = gen_bands(rt_post, rt_chain, g -> exp.(g.Z_t))
Rt_tri = gen_bands(tri_post, tri_chain, g -> exp.(g.Z_t))
now_rt = gen_bands(rt_post, rt_chain, g -> g.I_t)
now_tri = gen_bands(tri_post, tri_chain, g -> g.I_t)
rt_pred = predict(as_turing_model(rt_model, fill(missing, n), n), rt_chain)
yt = predictive_bands(rt_pred, n)
fig = Figure(; size = (780, 820))
ax1 = Axis(fig[1, 1]; ylabel = "Reproduction number Rₜ")
vspan!(ax1, n - 6, n; color = (:grey, 0.15))
ci_ribbon!(ax1, ts, Rt_complete; color = :black, label = "complete (reference)")
ci_ribbon!(ax1, ts, Rt_naive; color = :crimson, label = "naive")
ci_ribbon!(ax1, ts, Rt_rt; color = :seagreen, label = "right-truncate")
ci_ribbon!(ax1, ts, Rt_tri; color = :steelblue, label = "report-triangle")
hlines!(ax1, [1.0]; color = :grey, linestyle = :dash)
axislegend(ax1; position = :lb, nbanks = 2)
ax2 = Axis(fig[2, 1]; ylabel = "Eventual cases (nowcast)")
vspan!(ax2, n - 6, n; color = (:grey, 0.15))
ci_ribbon!(ax2, ts, now_rt; color = :seagreen, label = "right-truncate")
ci_ribbon!(ax2, ts, now_tri; color = :steelblue, label = "report-triangle")
lines!(ax2, ts, Float64.(eventual); color = :black, linewidth = 2,
label = "true eventual")
scatter!(ax2, ts, observed_so_far; color = :grey, markersize = 6,
label = "observed so far")
axislegend(ax2; position = :lt)
ax3 = Axis(fig[3, 1]; xlabel = "Reference day", ylabel = "Observed-so-far")
vspan!(ax3, n - 6, n; color = (:grey, 0.15))
ci_ribbon!(ax3, ts, yt; color = :teal, label = "posterior predictive")
scatter!(ax3, ts, observed_so_far; color = :black, markersize = 6,
label = "observed")
axislegend(ax3; position = :lt)
fig
In the shaded recent window the naive RightTruncate fit reproduces the observed-so-far series it saw.
Shared parameters
Neither correction touches the renewal process, so both recover the same shared parameters, the autoregressive damping damp[1]), the innovation scale std), the observation overdispersion (cluster_factor) and the initial infections (init_incidence). sample returns a FlexiChains chain that summarystats summarises directly, giving point estimates and their uncertainty alongside the effective sample size and
using MCMCChains
summarystats(tri_chain)╭─FlexiSummary (9 statistics) ─────────────────────────────────────────────────╮
│ iter collapsed │
│ chain collapsed │
│ ↓ stat = [mean, std, mcse, ess_bulk, ess_tail, rhat, q5, q50, q95] │
│ │
│ Parameters (95) ── AbstractPPL.VarName │
│ Float64 init[1], damp, ρ, std, ϵ_t[1], ϵ_t[2], ϵ_t[3], ϵ_t[4], ϵ_t[5], │
│ ϵ_t[6], ϵ_t[7], ϵ_t[8], ϵ_t[9], ϵ_t[10], ϵ_t[11], ϵ_t[12], │
│ ϵ_t[13], ϵ_t[14], ϵ_t[15], ϵ_t[16], ϵ_t[17], ϵ_t[18], ϵ_t[19], │
│ ϵ_t[20], ϵ_t[21], ϵ_t[22], ϵ_t[23], ϵ_t[24], ϵ_t[25], ϵ_t[26], │
│ ϵ_t[27], ϵ_t[28], ϵ_t[29], ϵ_t[30], ϵ_t[31], ϵ_t[32], ϵ_t[33], │
│ ϵ_t[34], ϵ_t[35], ϵ_t[36], ϵ_t[37], ϵ_t[38], ϵ_t[39], ϵ_t[40], │
│ ϵ_t[41], ϵ_t[42], ϵ_t[43], ϵ_t[44], init_incidence, exp_I_t[1], │
│ exp_I_t[2], exp_I_t[3], exp_I_t[4], exp_I_t[5], exp_I_t[6], │
│ exp_I_t[7], exp_I_t[8], exp_I_t[9], exp_I_t[10], exp_I_t[11], │
│ exp_I_t[12], exp_I_t[13], exp_I_t[14], exp_I_t[15], exp_I_t[16], │
│ exp_I_t[17], exp_I_t[18], exp_I_t[19], exp_I_t[20], exp_I_t[21], │
│ exp_I_t[22], exp_I_t[23], exp_I_t[24], exp_I_t[25], exp_I_t[26], │
│ exp_I_t[27], exp_I_t[28], exp_I_t[29], exp_I_t[30], exp_I_t[31], │
│ exp_I_t[32], exp_I_t[33], exp_I_t[34], exp_I_t[35], exp_I_t[36], │
│ exp_I_t[37], exp_I_t[38], exp_I_t[39], exp_I_t[40], exp_I_t[41], │
│ exp_I_t[42], exp_I_t[43], exp_I_t[44], exp_I_t[45], │
│ cluster_factor │
│ │
│ Extras (14) │
│ Float64 n_steps, is_accept, acceptance_rate, log_density, │
│ hamiltonian_energy, hamiltonian_energy_error, │
│ max_hamiltonian_energy_error, tree_depth, numerical_error, │
│ step_size, nom_step_size, logprior, loglikelihood, logjoint │
│ │
│ Summary │
│ param mean std mcse ess_bulk ess_tail … │
│ init[1] 0.0879 0.2656 0.0183 211.8951 253.8102 … │
│ damp 0.7861 0.0432 0.0078 28.4030 45.8175 … │
│ ρ 0.7861 0.0432 0.0078 28.4030 45.8175 … │
│ std 0.3271 0.0306 0.0048 40.7853 85.5830 … │
│ ϵ_t[1] 2.9438 0.6322 0.0525 144.9493 260.3099 … │
│ ϵ_t[2] -0.0724 0.5508 0.0469 139.6060 274.4868 … │
│ ϵ_t[3] 1.1419 0.4946 0.0402 152.1407 211.1976 … │
│ ϵ_t[4] -0.3008 0.4387 0.0363 146.7092 308.2991 … │
│ ϵ_t[5] -0.3753 0.3911 0.0280 196.3288 335.1441 … │
│ ϵ_t[6] 2.8919 0.3849 0.0313 154.6851 218.9697 … │
│ ϵ_t[7] -0.5183 0.3402 0.0413 67.4381 149.8256 … │
│ ϵ_t[8] -0.2336 0.3048 0.0343 79.4190 168.6441 … │
│ ϵ_t[9] 2.2655 0.3177 0.0405 61.5549 184.2943 … │
│ ϵ_t[10] -1.8490 0.3036 0.0393 60.7456 109.8691 … │
│ ϵ_t[11] 0.6962 0.2229 0.0207 117.3111 267.1974 … │
│ ϵ_t[12] 0.5492 0.2120 0.0206 105.7847 207.0501 … │
│ ϵ_t[13] 0.6823 0.2168 0.0261 70.3811 165.3166 … │
│ ϵ_t[14] -0.1135 0.1987 0.0228 76.7927 208.6676 … │
│ ϵ_t[15] 1.2658 0.1981 0.0237 71.7805 164.3190 … │
│ ϵ_t[16] 0.3321 0.1752 0.0290 28.0747 75.8288 … │
│ ϵ_t[17] 0.3150 0.1575 0.0195 68.7770 86.5687 … │
│ ϵ_t[18] -2.0318 0.2275 0.0286 62.9531 99.3042 … │
│ ϵ_t[19] 2.4809 0.2475 0.0343 51.5778 94.6131 … │
│ ϵ_t[20] 0.2770 0.1405 0.0225 32.7163 109.4017 … │
│ ϵ_t[21] -0.3114 0.1210 0.0137 77.3035 146.5997 … │
│ ϵ_t[22] 0.8452 0.1305 0.0173 56.8232 127.8126 … │
│ ϵ_t[23] -0.7995 0.1323 0.0165 64.0265 164.1360 … │
│ ϵ_t[24] 0.9632 0.1174 0.0152 59.4417 147.1908 … │
│ ϵ_t[25] -0.4838 0.1022 0.0112 82.0860 154.9212 … │
│ ϵ_t[26] 0.4679 0.0914 0.0103 78.5941 195.0563 … │
│ ϵ_t[27] 0.6596 0.1060 0.0131 68.5530 171.5044 … │
│ ϵ_t[28] 0.2535 0.0900 0.0112 65.8927 124.3162 … │
│ ϵ_t[29] 0.1726 0.0908 0.0124 53.8343 116.1523 … │
│ ϵ_t[30] -0.6053 0.0942 0.0109 76.9746 104.1003 … │
│ ϵ_t[31] -0.5316 0.0833 0.0103 64.8936 185.4487 … │
│ ϵ_t[32] 0.2391 0.0643 0.0054 137.8995 328.1250 … │
│ ϵ_t[33] -0.0297 0.0609 0.0050 147.9421 327.9993 … │
│ ϵ_t[34] 0.4992 0.0755 0.0080 88.6567 238.3976 … │
│ ϵ_t[35] -0.1179 0.0677 0.0054 158.7254 231.6484 … │
│ ϵ_t[36] 0.0003 0.0636 0.0050 162.1097 216.6683 … │
│ ϵ_t[37] -0.4223 0.0781 0.0072 118.3233 214.1209 … │
│ ϵ_t[38] -0.8492 0.1062 0.0135 62.9164 169.9956 … │
│ ϵ_t[39] -0.0138 0.0936 0.0104 80.9046 213.4548 … │
│ ϵ_t[40] 0.5289 0.1153 0.0134 73.8496 192.0139 … │
│ ϵ_t[41] -0.0896 0.1251 0.0124 106.6910 210.0980 … │
│ ϵ_t[42] -0.1372 0.1839 0.0170 117.9064 235.6158 … │
│ ϵ_t[43] 0.0501 0.4151 0.0309 183.1239 274.4100 … │
│ ϵ_t[44] -0.2542 1.0119 0.0689 216.5451 363.8361 … │
│ init_incide… 2.9581 0.2089 0.0178 141.0999 207.1034 … │
│ exp_I_t[1] 20.2117 3.9459 0.3229 149.6006 267.0789 … │
│ exp_I_t[2] 52.7187 6.8852 0.4140 284.2979 465.5494 … │
│ exp_I_t[3] 57.3619 6.7740 0.3859 303.6876 643.5783 … │
│ exp_I_t[4] 90.9492 8.8350 0.4756 342.7529 783.8557 … │
│ exp_I_t[5] 93.0338 8.6138 0.4641 341.8364 577.2817 … │
│ exp_I_t[6] 88.9958 8.6023 0.5187 278.8946 515.2557 … │
│ exp_I_t[7] 238.6325 14.8131 0.8584 304.3710 565.6782 … │
│ exp_I_t[8] 239.4567 14.2494 0.7953 321.4927 417.7422 … │
│ exp_I_t[9] 246.6399 15.3677 1.0691 207.5231 495.6591 … │
│ exp_I_t[10] 548.7388 23.2573 0.8784 703.3436 905.8324 … │
│ exp_I_t[11] 352.6604 19.0918 1.0488 335.2330 397.0682 … │
│ exp_I_t[12] 468.1203 21.2337 1.4210 222.3039 524.2497 … │
│ exp_I_t[13] 585.1930 24.4619 1.5256 256.9969 603.2693 … │
│ exp_I_t[14] 766.3547 28.1599 1.7952 245.4690 407.3866 … │
│ exp_I_t[15] 785.9908 28.1271 1.7294 263.9089 511.9243 … │
│ exp_I_t[16] 1242.5730 35.5738 2.4826 203.6406 682.9616 … │
│ exp_I_t[17] 1495.3057 38.5486 2.0547 353.3445 741.0364 … │
│ exp_I_t[18] 1787.8713 44.8494 1.6953 693.6386 685.9424 … │
│ exp_I_t[19] 991.7564 32.0700 1.0359 957.4529 729.3318 … │
│ exp_I_t[20] 2303.4612 50.7966 2.4591 429.2021 657.6410 … │
│ exp_I_t[21] 2652.9979 52.6592 2.5873 417.5582 757.7559 … │
│ exp_I_t[22] 2547.4627 49.9920 2.4956 404.1169 518.7289 … │
│ exp_I_t[23] 3492.6225 60.2951 2.5117 588.6668 651.7584 … │
│ exp_I_t[24] 2832.1424 52.3043 2.1107 616.5889 637.7160 … │
│ exp_I_t[25] 3990.9320 66.2812 2.5471 681.5450 697.8230 … │
│ exp_I_t[26] 3526.8407 59.6178 2.8058 455.2274 650.0977 … │
│ exp_I_t[27] 4208.6028 70.2403 4.2992 265.8513 509.4250 … │
│ exp_I_t[28] 5328.4278 73.4881 3.6837 397.2618 619.0715 … │
│ exp_I_t[29] 5977.5684 85.2979 4.3772 378.4486 493.8862 … │
│ exp_I_t[30] 6550.6093 82.4207 3.6433 508.8883 632.9563 … │
│ exp_I_t[31] 5565.2485 77.5514 3.7865 426.7044 688.6725 … │
│ exp_I_t[32] 4786.9170 71.3173 3.7307 366.4591 507.1403 … │
│ exp_I_t[33] 5247.0593 72.6299 4.8344 229.0360 430.6332 … │
│ exp_I_t[34] 5215.4533 76.6615 4.3222 315.8073 596.4442 … │
│ exp_I_t[35] 6152.8072 85.6647 4.5509 352.4840 735.0283 … │
│ exp_I_t[36] 5947.9133 84.1444 5.1776 262.7144 601.0952 … │
│ exp_I_t[37] 5988.4922 84.8646 5.2608 259.4066 307.8485 … │
│ exp_I_t[38] 5256.1879 81.9522 3.6544 503.4975 576.6743 … │
│ exp_I_t[39] 4013.9112 73.4136 3.6248 411.9780 666.6456 … │
│ exp_I_t[40] 4040.7717 83.9295 5.3243 247.6223 389.8536 … │
│ exp_I_t[41] 4788.4835 112.1533 7.6984 210.5528 349.5175 … │
│ exp_I_t[42] 4605.0862 144.3077 11.1676 167.3123 289.7484 … │
│ exp_I_t[43] 4381.7643 216.4835 15.1456 203.7866 463.3762 … │
│ exp_I_t[44] 4469.4049 545.2102 39.3594 195.7146 325.2016 … │
│ exp_I_t[45] 4336.6002 1570.0056 102.2730 232.0198 456.6162 … │
│ cluster_fac… 0.0099 0.0063 0.0004 199.3007 235.9550 … │
╰──────────────────────────────────────────────────────────────────────────────╯Prior versus posterior
Sampling the reporting-triangle model with Prior and overlaying it on the posterior with PairPlots.jl confirms the joint correction still identifies the shared parameters from the thinned triangle.
using PairPlots
prior_chain = sample(tri_post, Prior(), 1000; progress = false)
pp_keys = [@varname(damp), @varname(std),
@varname(cluster_factor), @varname(init_incidence)]
pairplot(
PairPlots.Series(tri_chain[pp_keys]; label = "posterior"),
PairPlots.Series(prior_chain[pp_keys]; label = "prior"))
References
- S. Abbott, J. Hellewell, R. N. Thompson, K. Sherratt, H. P. Gibbs, N. I. Bosse, J. D. Munday, S. Meakin, E. L. Doughty, J. Y. Chun and others. Estimating the time-varying reproduction number of SARS-CoV-2 using national and subnational case counts. Wellcome Open Research 5, 112 (2020).