Skip to content

Commit

Permalink
add shrinkage information to vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
gowerc committed Feb 5, 2024
1 parent af2518a commit 38ee15f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-Prior.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ test_that("jmpost.prior_shrinkage works as expected", {
)

## Reset Shrinkage factor
options("jmpost.prior_shrinkage" = 0.1)
options("jmpost.prior_shrinkage" = 0.5)
},
local_rnorm = \(...) 4
)
Expand Down
12 changes: 11 additions & 1 deletion vignettes/model_fitting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,17 @@ brierScore(sq)
By default `jmpost` will set the initial values for all parameters to be a random value
drawn from the prior distribution that has been shrunk towards the
mean of said distribution e.g. for a `prior_normal(4, 2)`
the initial value for each chain will be: `(4 + rnorm(1, 4, 2)) * 0.5`.
the initial value for each chain will be:
```
4 * shrinkage_factor + rnorm(1, 4, 2) * (1 - shrinkage_factor)
```

Note that the shrinkage factor is set to 0.5 by default and can be changed via the
`jmpost.prior_shrinkage` option e.g.

```
options("jmpost.prior_shrinkage" = 0.7)
```

If you wish to manually specify the initial values you can do so via the `initialValues()` function.
For example:
Expand Down

0 comments on commit 38ee15f

Please sign in to comment.