|
a |
|
b/R/ref_priors.R |
|
|
1 |
|
|
|
2 |
## ON THE PURPOSE OF THESE FUNCTIONS |
|
|
3 |
|
|
|
4 |
## These functions are no longer used in outbreaker2, but were part of the |
|
|
5 |
## original implementation, and are still used in testing procedures to ensure |
|
|
6 |
## that Rcpp versions give identical results. |
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
## We use an exponential prior for the mutation rate; the prior rate, which does |
|
|
14 |
## not change in the MCMC, is enclosed in the returned function. |
|
|
15 |
|
|
|
16 |
.prior_mu <- function(param, rate) { |
|
|
17 |
stats::dexp(param$mu, rate, log = TRUE) |
|
|
18 |
} |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
## We use a beta prior for the reporting probability (which contrains it to lie |
|
|
26 |
## between 0 and 1); the 2 shape parameters, which do not change in the MCMC, |
|
|
27 |
## are enclosed in the returned function. |
|
|
28 |
|
|
|
29 |
.prior_pi <- function(param, shape1, shape2) { |
|
|
30 |
stats::dbeta(param$pi, shape1, shape2, log = TRUE) |
|
|
31 |
} |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
## We use a beta prior for the contact reporting coverage (which contrains it to lie |
|
|
35 |
## between 0 and 1); the 2 shape parameters, which do not change in the MCMC, |
|
|
36 |
## are enclosed in the returned function. |
|
|
37 |
|
|
|
38 |
.prior_eps <- function(param, shape1, shape2) { |
|
|
39 |
stats::dbeta(param$eps, shape1, shape2, log = TRUE) |
|
|
40 |
} |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
## We use a beta prior for the non-infectious contact rate (which contrains it |
|
|
45 |
## to lie between 0 and 1); the 2 shape parameters, which do not change in the |
|
|
46 |
## MCMC, are enclosed in the returned function. |
|
|
47 |
|
|
|
48 |
.prior_lambda <- function(param, shape1, shape2) { |
|
|
49 |
stats::dbeta(param$lambda, shape1, shape2, log = TRUE) |
|
|
50 |
} |