Skip to content

Commit 57275f5

Browse files
committed
Upstream condition and decondition from AbstractPPL
1 parent cdaa663 commit 57275f5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/AbstractMCMC.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,40 @@ The `MCMCSerial` algorithm allows users to sample serially, with no thread or pr
8080
"""
8181
struct MCMCSerial <: AbstractMCMCEnsemble end
8282

83+
"""
84+
decondition(conditioned_model)
85+
86+
Remove the conditioning (i.e., observation data) from `conditioned_model`, turning it into a
87+
generative model over prior and observed variables.
88+
89+
The invariant
90+
91+
```
92+
m == condition(decondition(m), obs)
93+
```
94+
95+
should hold for models `m` with conditioned variables `obs`.
96+
"""
97+
function decondition end
98+
99+
"""
100+
condition(model, observations)
101+
102+
Condition the generative model `model` on some observed data, creating a new model of the (possibly
103+
unnormalized) posterior distribution over them.
104+
105+
`observations` can be of any supported internal trace type, or a fixed probability expression.
106+
107+
The invariant
108+
109+
```
110+
m = decondition(condition(m, obs))
111+
```
112+
113+
should hold for generative models `m` and arbitrary `obs`.
114+
"""
115+
function condition end
116+
83117
"""
84118
recompute_logprob!!(rng, model, sampler, state)
85119

0 commit comments

Comments
 (0)