diff options
author | Justin Cally <jcally@student.unimelb.edu.au> | 2022-04-12 10:34:31 +1000 |
---|---|---|
committer | Justin Cally <jcally@student.unimelb.edu.au> | 2022-04-12 10:34:31 +1000 |
commit | 54ee1f7f8f436df1d93474208e20c326776c0343 (patch) | |
tree | 13689537a0978dfe1d0a327052819a7f05c9ab9c | |
parent | 074be5504491afa296557215afc77f5ad9c98688 (diff) |
add laplace function
-rw-r--r-- | R/priors.R | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -88,6 +88,16 @@ gamma <- function(shape=1, rate=1){ list(dist=5, par1=shape, par2=rate, par3=0, autoscale=FALSE) } +#' @rdname priors +#' @export +laplace <- function(location=0, scale=2.5, autoscale=TRUE){ + stopifnot(all(scale > 0)) + if((length(location) > 1) & (length(scale) > 1)){ + stopifnot(length(location) == length(scale)) + } + list(dist=6, par1=location, par2=scale, par3=0, autoscale=autoscale) +} + null_prior <- function(){ list(dist=0, par1=0, par2=0, par3=0, autoscale=FALSE) } |