File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
usage/predictive-distributions Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,21 @@ Depending on your data, you may naturally want to create different visualisation
115
115
116
116
## Prior predictive distribution
117
117
118
- Alternatively, if we use the prior distribution of the parameters, we obtain the * prior predictive distribution* :
118
+ Alternatively, if we use the prior distribution of the parameters $p(\theta)$ , we obtain the * prior predictive distribution* :
119
119
120
120
$$
121
121
p(\tilde{x}) = \int p(\tilde{x} | \theta) p(\theta) d\theta,
122
122
$$
123
123
124
- This is simpler, as there is no need to pass a chain in: we can sample from the deconditioned model directly, using Turing's ` Prior ` sampler.
124
+ In exactly analogous fashion to above, you could sample from the prior distribution of the conditioned model, and _ then_ pass that to ` predict ` :
125
+
126
+ ``` {julia}
127
+ prior_params = sample(model, Prior(), 1_000; progress=false)
128
+ prior_predictive_samples = predict(predictive_model, prior_params)
129
+ ```
130
+
131
+ In fact there is a simpler way: you can directly sample from the deconditioned model, using Turing's ` Prior ` sampler.
132
+ This will, in a single call, generate prior samples for both the parameters as well as the new data.
125
133
126
134
``` {julia}
127
135
prior_predictive_samples = sample(predictive_model, Prior(), 1_000; progress=false)
You can’t perform that action at this time.
0 commit comments