Skip to content

Fix inconsistent variable name #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/src/ref/mcmc.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,19 @@ m = sqrt(m1 * m2)
```
However, there are many combinations of `m1` and `m2` that have the same geometric mean.
In other words, the geometric mean is not *invertible*.
However, if we return the additional degree of freedom alongside the geometric mean (`dof`), then we do have an invertible function:
However, if we return the additional degree of freedom alongside the geometric mean (`u`), then we do have an invertible function:
```julia
function merge_means(m1, m2)
m = sqrt(m1 * m2)
dof = m1 / (m1 + m2)
(m, dof)
u = m1 / (m1 + m2)
(m, u)
end
```
The inverse function is:
```julia
function split_mean(m, dof)
m1 = m * sqrt((dof / (1 - dof)))
m2 = m * sqrt(((1 - dof) / dof))
function split_mean(m, u)
m1 = m * sqrt((u / (1 - u)))
m2 = m * sqrt(((1 - u) / u))
(m1, m2)
end
```
Expand All @@ -301,7 +301,7 @@ The proposal is responsible for generating the extra degree of freedom when spli
# currently two segments, switch to one
else
# currently one segment, switch to two
{:dof} ~ uniform_continuous(0, 1)
{:u} ~ uniform_continuous(0, 1)
end
end
```
Expand Down