Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions approaches/composed-distributions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ There is no translation step between the delay model, the infection model, and t
### Read the posterior back through the same tree

After fitting, the posterior is read back by applying the parameter draws to the same tree.
`update(template, chain)` reduces the chain to a point summary and returns one fitted tree; `update(template, table)` does the same from a Tables.jl table of values or priors, for a bulk edit outside a sampling loop.
Reading every draw rather than a point summary maps `update` over `param_draws(template, chain)`, so every delay mean, convolution, or contrast still comes from the fitted object itself, one draw at a time.
[DistributionsInference.jl](https://github.com/EpiAware/DistributionsInference.jl)'s `readback(template, chain)` reduces a fitted chain to a point summary and returns one fitted tree; `update(template, table)` does the equivalent from a Tables.jl table of values or priors, for a bulk edit outside a sampling loop.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this now called readback? I quite liked update can't it extend the method or similar or I guess that is mild type pyracy? Could we use DataFrame on a method and get the table and then do update .hmmm dfor the draws point etc I Wouold have though a param swich would be nicer than a new function

Reading every draw rather than a point summary uses `readback_draws(template, chain)`, so every delay mean, convolution, or contrast still comes from the fitted object itself, one draw at a time; `distribution_params` reads the same chain back to named values for any fittable object, tree or otherwise.
Nothing is recomputed in separate post-processing that could drift from the model.

## Where next
Expand All @@ -194,11 +194,12 @@ Nothing is recomputed in separate post-processing that could drift from the mode
models.
- Fitting outside Turing, or fitting a plain struct alongside a tree?
[DistributionsInference.jl](https://github.com/EpiAware/DistributionsInference.jl)
hosts the PPL-neutral log-density and readback that `as_logdensity` and
`as_turing` build on: `distribution_priors` assembles priors the same way
`param_priors` does for a tree, and `distribution_params` reads a fitted
chain back to the estimated values by name, whatever fittable object it
came from.
hosts a PPL-neutral log-density, `as_turing`, and chain readback

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened to aslogdneisty and stuff?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm distribution priors hold be for all trees and dists shouldn't it or both use param_priors? maybe the latter makes sense not sure?

(`readback`/`readback_draws`) that work generically over the fit-protocol
core a composed tree and a plain struct both satisfy: `distribution_priors`
assembles priors the same way `param_priors` does for a tree, and
`distribution_params` reads a fitted chain back to the estimated values
by name, whatever fittable object it came from.
- Ready to fit a full model with infection dynamics? See the
[composable Turing models approach](composable-turing-models.qmd).

Expand Down
Loading