File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,46 @@ should hold for generative models `m` and arbitrary `obs`.
6262"""
6363function condition end
6464
65+ """
66+ fix(model, params)
67+
68+ Fix the values of parameters specified in `params` within the probabilistic model `model`.
69+ This operation is equivalent to treating the fixed parameters as being drawn from a point mass
70+ distribution centered at the values specified in `params`.
71+
72+ Conceptually, this is similar to Pearl's do-operator in causal inference, where we intervene
73+ on variables by setting them to specific values, effectively cutting off their dependencies
74+ on their usual causes in the model.
75+
76+ The invariant
77+
78+ ```
79+ m == unfix(fix(m, params))
80+ ```
81+
82+ should hold for any model `m` and parameters `params`.
83+ """
84+ function fix end
85+
86+
87+ """
88+ unfix(model)
89+
90+ Remove any fixed parameters from the model `model`, returning a new model without the fixed parameters.
91+
92+ This function reverses the effect of `fix()` by removing parameter constraints that were previously set.
93+ It returns a new model where all previously fixed parameters are allowed to vary according to their
94+ original distributions in the model.
95+
96+ The invariant
97+
98+ ```
99+ m == unfix(fix(m, params))
100+ ```
101+
102+ should hold for any model `m` and parameters `params`.
103+ """
104+ function unfix end
65105
66106"""
67107 rand([rng=Random.default_rng()], [T=NamedTuple], model::AbstractProbabilisticProgram) -> T
You can’t perform that action at this time.
0 commit comments