|
1 | 1 |
|
2 |
| -""" |
3 |
| - ≪(μ,ν) |
| 2 | +# """ |
| 3 | +# ≪(μ,ν) |
4 | 4 |
|
5 |
| -# Absolute continuity |
| 5 | +# # Absolute continuity |
6 | 6 |
|
7 |
| -A measure μ is _absolutely continuous_ with respect to ν, written μ ≪ ν, if |
8 |
| -ν(A)==0 implies μ(A)==0 for every ν-measurable set A. |
| 7 | +# A measure μ is _absolutely continuous_ with respect to ν, written μ ≪ ν, if |
| 8 | +# ν(A)==0 implies μ(A)==0 for every ν-measurable set A. |
9 | 9 |
|
10 |
| -Less formally, suppose we have a set A with ν(A)==0. If μ(A)≠0, then there can |
11 |
| -be no way to "reweight" ν to get to μ. We can't make something from nothing. |
| 10 | +# Less formally, suppose we have a set A with ν(A)==0. If μ(A)≠0, then there can |
| 11 | +# be no way to "reweight" ν to get to μ. We can't make something from nothing. |
12 | 12 |
|
13 |
| -This "reweighting" is really a density function. If μ≪ν, then there is some |
14 |
| -function f that makes `μ == ∫(f,ν)` (see the help section for `∫`). |
| 13 | +# This "reweighting" is really a density function. If μ≪ν, then there is some |
| 14 | +# function f that makes `μ == ∫(f,ν)` (see the help section for `∫`). |
15 | 15 |
|
16 |
| -We can get this f directly via the Radon-Nikodym derivative, `f == 𝒹(μ,ν)` (see |
17 |
| -the help section for `𝒹`). |
| 16 | +# We can get this f directly via the Radon-Nikodym derivative, `f == 𝒹(μ,ν)` (see |
| 17 | +# the help section for `𝒹`). |
18 | 18 |
|
19 |
| -Note that `≪` is not a partial order, because it is not antisymmetric. That is |
20 |
| -to say, it's possible (in fact, common) to have two different measures `μ` and |
21 |
| -`ν` with `μ ≪ ν` and `ν ≪ μ`. A simple example of this is |
22 |
| -``` |
23 |
| -μ = Normal() |
24 |
| -ν = Lebesgue(ℝ) |
25 |
| -``` |
| 19 | +# Note that `≪` is not a partial order, because it is not antisymmetric. That is |
| 20 | +# to say, it's possible (in fact, common) to have two different measures `μ` and |
| 21 | +# `ν` with `μ ≪ ν` and `ν ≪ μ`. A simple example of this is |
| 22 | +# ``` |
| 23 | +# μ = Normal() |
| 24 | +# ν = Lebesgue(ℝ) |
| 25 | +# ``` |
26 | 26 |
|
27 |
| -When `≪` holds in both directions, the measures μ and ν are _equivalent_, |
28 |
| -written `μ ≃ ν`. See the help section for `≃` for more information. |
29 |
| -""" |
30 |
| -function ≪ end |
| 27 | +# When `≪` holds in both directions, the measures μ and ν are _equivalent_, |
| 28 | +# written `μ ≃ ν`. See the help section for `≃` for more information. |
| 29 | +# """ |
| 30 | +# function ≪ end |
31 | 31 |
|
32 | 32 |
|
33 |
| -export ≃ |
| 33 | +# export ≃ |
34 | 34 |
|
35 |
| -""" |
36 |
| - ≃(μ,ν) |
| 35 | +# """ |
| 36 | +# ≃(μ,ν) |
37 | 37 |
|
38 |
| -# Equivalence of Measure |
| 38 | +# # Equivalence of Measure |
39 | 39 |
|
40 |
| -Measures μ and ν on the same space X are equivalent, written `μ ≃ ν`, if `μ ≪ ν` |
41 |
| -and `ν ≪ μ`. Note that this is often written `~` in the literature, but this is |
42 |
| -overloaded in probabilistic programming, so we use this alternate notation. |
| 40 | +# Measures μ and ν on the same space X are equivalent, written `μ ≃ ν`, if `μ ≪ ν` |
| 41 | +# and `ν ≪ μ`. Note that this is often written `~` in the literature, but this is |
| 42 | +# overloaded in probabilistic programming, so we use this alternate notation. |
43 | 43 |
|
44 |
| -Also note that equivalence is very different from equality. For two equivalent |
45 |
| -measures, the sets of non-zero measure will be identical, but what that measure |
46 |
| -is in each case can be very different. |
47 |
| -""" |
48 |
| -function ≃(μ,ν) |
49 |
| - return (μ≪ν && ν≪μ) |
50 |
| -end |
| 44 | +# Also note that equivalence is very different from equality. For two equivalent |
| 45 | +# measures, the sets of non-zero measure will be identical, but what that measure |
| 46 | +# is in each case can be very different. |
| 47 | +# """ |
| 48 | +# function ≃(μ,ν) |
| 49 | +# return (μ≪ν && ν≪μ) |
| 50 | +# end |
51 | 51 |
|
52 |
| -export representative |
53 |
| - |
54 |
| -""" |
55 |
| - representative(μ::AbstractMeasure) -> AbstractMeasure |
56 |
| -
|
57 |
| -We need to be able to compute `μ ≪ ν` for each `μ` and `ν`. To do this directly |
58 |
| -would require a huge number of methods (quadratic in the number of defined |
59 |
| -measures). |
60 |
| -
|
61 |
| -This function is a way around that. When defining a new measure `μ`, you should |
62 |
| -also find some equivalent measure `ρ` that's "as primitive as possible". |
63 |
| -
|
64 |
| -If possible, `ρ` should be a `PrimitiveMeasure`, or a `Product` of these. If |
65 |
| -not, it should be a transform (`Pushforward` or `Pullback`) of a |
66 |
| -`PrimitiveMeasure` (or `Product` of these). |
67 |
| -""" |
68 |
| -function representative(μ) |
69 |
| - function f(μ) |
70 |
| - # Check if we're done |
71 |
| - isprimtype(μ) && return μ |
72 |
| - ν = basemeasure(μ) |
73 |
| - return ν |
74 |
| - end |
75 |
| - |
76 |
| - fix(f, μ) |
77 |
| -end |
78 |
| - |
79 |
| -function ≪(μ, ν) |
80 |
| - μ == ν && return true |
81 |
| - representative(μ) ≪ representative(ν) && return true |
82 |
| - return false |
83 |
| -end |
| 52 | +# function ≪(μ, ν) |
| 53 | +# μ == ν && return true |
| 54 | +# representative(μ) ≪ representative(ν) && return true |
| 55 | +# return false |
| 56 | +# end |
0 commit comments