-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to change shrinkage factor
- Loading branch information
Showing
5 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
|
||
#' jmpost settings | ||
#' | ||
#' @description | ||
#' Define settings that modify the behaviour of the `jmpost` package | ||
#' | ||
#' Each of the following are the name of options that can be set via: | ||
#' ``` | ||
#' options(<option_name> = <value>) | ||
#' ``` | ||
#' | ||
#' ## `jmpost.prior_shrinkage` | ||
#' | ||
#' Default = `0.5` | ||
#' | ||
#' By default all initial values are drawn as random sample from the respective prior | ||
#' distribution with a shrinkage factor towards the mean. That is: | ||
#' ``` | ||
#' initial_value = prior_sample * prior_shrinkage + (1 - prior_shrinkage) * prior_mean | ||
#' ``` | ||
#' This setting controls the shrinkage factor. A value of 0 means no shrinkage (i.e. | ||
#' pure random draw) whilst a value of 1 means the intial value is just the mean. | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' options(jmpost.prior_shrinkage = 0.5) | ||
#' } | ||
#' @name jmpost-settings | ||
NULL | ||
|
||
if (is.null(getOption("jmpost.prior_shrinkage", default = NULL))) { | ||
options("jmpost.prior_shrinkage" = 0.5) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters