You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* DOC: Add reference to "The Book of Statistical Proofs"
* DOC: Add citation to "The Book of Statistical Proofs"
* DOC: Add another reference to The Book of Statistical Proofs
* DOC: Add links to preliz functions
* DOC: Add another link to maxent in preliz
Updated the reference to the 'maxent' function to include a link for better clarity.
Copy file name to clipboardExpand all lines: Chapters/Model_comparison.qmd
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ for p, ax in zip([0.5, 0.1, 0.9, 0.0001], axes.ravel()):
98
98
ax.set_ylim(-0.05, 1.05)
99
99
```
100
100
101
-
The concept of entropy appears many times in statistics. It can be useful, for example when defining priors. In general we want to use a prior that has maximum entropy given our knowledge (see for example [PreliZ](https://preliz.readthedocs.io/en/latest/)'s `maxent` function). And also when comparing models as we will see in the next section.
101
+
The concept of entropy appears many times in statistics. It can be useful, for example when defining priors. In general we want to use a prior that has maximum entropy given our knowledge (see for example [PreliZ](https://preliz.readthedocs.io/en/latest/)'s [`maxent`](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.maxent) function). And also when comparing models as we will see in the next section.
102
102
103
103
## KL divergence {#sec-kl-divergence}
104
104
@@ -118,7 +118,7 @@ $$
118
118
$$
119
119
120
120
121
-
If $p$ represents the **data generating process** or the **population** or the **true** distribution, and $q$ represents our model. It may seems that this expressions are all useless because we don't know $p$. That the reason we are trying to fit a model in the first place. But, if our goal is to compare $m$ models represented with $q_0, q_1 \cdots q_m$, we can can still use the KL divergence to compare them! The reason is that even when we do not know $p$, its entropy is a constant term for all comparisons.
121
+
If $p$ represents the **data generating process** or the **population** or the **true** distribution, and $q$ represents our model. It may seems that this expressions are all useless because we don't know $p$. That the reason we are trying to fit a model in the first place. But, if our goal is to compare $m$ models represented with $q_0, q_1, \cdots, q_m$, we can can still use the KL divergence to compare them! The reason is that even when we do not know $p$, its entropy is a constant term for all comparisons.
This is true only when $H_0$ is a particular case of $H_1$, [see](https://statproofbook.github.io/P/bf-sddr).
496
+
This is true only when $H_0$ is a particular case of $H_1$, see[The Book of Statistical Proofs](https://statproofbook.github.io/P/bf-sddr)[@soch_2024].
497
497
498
498
Let's do it. We only need to sample the prior and posterior for a model. Let's try the BetaBinomial model with a Uniform prior:
Copy file name to clipboardExpand all lines: Chapters/Prior_elicitation.qmd
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ For some priors in a model, we may know or assume that most of the mass is withi
107
107
108
108
## Maximum entropy distributions with maxent
109
109
110
-
In PreliZ we can compute maximum entropy priors using the function `maxent`. It works for unidimensional distributions. The first argument is a PreliZ distribution. Then we specify an upper and lower bound and the probability between them.
110
+
In PreliZ we can compute maximum entropy priors using the function [`maxent`](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.maxent). It works for unidimensional distributions. The first argument is a PreliZ distribution. Then we specify an upper and lower bound and the probability between them.
111
111
112
112
As an example, we want to elicit a scale parameter. From domain knowledge we know the parameter has a relatively high probability of being less than 3. Hence, we could use a HalfNormal distribution and do:
There are many other method for direct elicitation of parameters. For instance the [quartile](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.quartile)functions identifies a distribution that matches specified
144
-
quartiles, and [Quartine_int](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.QuartileInt) provides an interactive approach to achieve the same, offering a more hands-on experience for refining distributions.
143
+
There are many other method for direct elicitation of parameters. For instance the [`quartile`](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.quartile)function identifies a distribution that matches specified
144
+
quartiles, and [`Quartine_int`](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.QuartileInt) provides an interactive approach to achieve the same, offering a more hands-on experience for refining distributions.
145
145
146
-
One method worth of special mention is the [Roulette](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.Roulette) method allows which allows users to find a prior distribution by drawing it interactively [@morris_2014]. The name "roulette" comes from the analogy of placing a limited set of chips where one believes the mass of a distribution should be concentrated. In this method, a grid of `m` equally sized bins is provided, covering the range of `x`, and users allocate a total of `n` chips across the bins. Effectively, this creates a histogram,representing the user's information about the distribution. The method then identifies the best-fitting distribution from a predefined pool of options, translating the drawn histogram into a suitable probabilistic model.
146
+
One method worth of special mention is the [`Roulette`](https://preliz.readthedocs.io/en/latest/unidimensional.html#preliz.unidimensional.Roulette) method allows which allows users to find a prior distribution by drawing it interactively [@morris_2014]. The name "roulette" comes from the analogy of placing a limited set of chips where one believes the mass of a distribution should be concentrated. In this method, a grid of `m` equally sized bins is provided, covering the range of `x`, and users allocate a total of `n` chips across the bins. Effectively, this creates a histogram,representing the user's information about the distribution. The method then identifies the best-fitting distribution from a predefined pool of options, translating the drawn histogram into a suitable probabilistic model.
147
147
148
148
As this is an interactive method we can't show it here, but you can run the following cell to see how it works.
149
149
@@ -253,7 +253,7 @@ The new priors still generate some values that are too wide, but at least the bu
253
253
254
254
The process described in the previous section is straightforward: sample from the prior predictive --> plot --> refine --> repeat. On the good side, this is a very flexible approach and can be a good way to understand the effect of individual parameters in the predictions of a model. But it can be time-consuming and it requires some understanding of the model so you know which parameters to tweak and in which direction.
255
255
256
-
One way to improve this workflow is by adding interactivity. We can do this with PreliZ's function, `predictive_explorer`. Which we can not show here, in a full glory but you can see an static image in @fig-predictive-explorer, and you can try it for yourself by running the following block of code.
256
+
One way to improve this workflow is by adding interactivity. We can do this with PreliZ's function, [`predictive_explorer`](https://preliz.readthedocs.io/en/latest/predictive.html#preliz.predictive.predictive_explorer). Which we can not show here, in a full glory but you can see a static image in @fig-predictive-explorer, and you can try it for yourself by running the following block of code.
Copy file name to clipboardExpand all lines: Chapters/Prior_posterior_predictive_checks.qmd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -454,7 +454,7 @@ $$
454
454
U = F_Y(Y)
455
455
$$
456
456
457
-
follows a standard Uniform distribution. A proof of this result can be found in the [The Book of Statistical Proofs](https://statproofbook.github.io/P/cdf-pit.html).
457
+
follows a standard Uniform distribution. A proof of this result can be found in [The Book of Statistical Proofs](https://statproofbook.github.io/P/cdf-pit.html)[@soch_2024].
458
458
459
459
In other words if we apply the CDF of any continuous distribution to a random variable with that distribution, the result will be a random variable with a standard uniform distribution. This is a very powerful result, as it allows us to use the standard uniform distribution as a reference distribution for many statistical tests, including posterior predictive checks.
0 commit comments