From 38ee15f57ee461c9c5a9f76d9da801707b5a882a Mon Sep 17 00:00:00 2001 From: gowerc Date: Mon, 5 Feb 2024 17:35:18 +0000 Subject: [PATCH] add shrinkage information to vignette --- tests/testthat/test-Prior.R | 2 +- vignettes/model_fitting.Rmd | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-Prior.R b/tests/testthat/test-Prior.R index 859f9223..1defd442 100644 --- a/tests/testthat/test-Prior.R +++ b/tests/testthat/test-Prior.R @@ -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 ) diff --git a/vignettes/model_fitting.Rmd b/vignettes/model_fitting.Rmd index 4f639e19..5ea6db0c 100644 --- a/vignettes/model_fitting.Rmd +++ b/vignettes/model_fitting.Rmd @@ -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: