Skip to content

Commit

Permalink
Merge pull request #107 from mrc-ide/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bobverity authored Feb 10, 2022
2 parents 3603a7b + 0248fb4 commit 476d94f
Show file tree
Hide file tree
Showing 81 changed files with 1,216 additions and 147 deletions.
Binary file modified .DS_Store
Binary file not shown.
85 changes: 43 additions & 42 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
Package: drjacoby
Type: Package
Title: Flexible Markov Chain Monte Carlo via Reparameterization
Version: 1.5.0
Authors@R: c(
person("Bob", "Verity", email = "[email protected]", role = c("aut", "cre")),
person("Pete", "Winskill", email = "[email protected]", role = c("aut"))
)
Description: drjacoby is an R package for performing Bayesian inference via
Markov chain monte carlo (MCMC). In addition to being highly flexible it
implements some advanced techniques that can improve mixing in tricky
situations.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
LinkingTo:
Rcpp
Imports:
Rcpp,
coda,
parallel,
ggplot2,
RcppXPtrUtils,
usethis,
tools,
rlang,
cowplot,
dplyr,
magrittr,
readr
SystemRequirements: C++11
Suggests:
testthat,
covr,
knitr,
rmarkdown,
microbenchmark,
gridExtra
BugReports: https://github.com/mrc-ide/drjacoby/issues
VignetteBuilder: knitr
Depends: R (>= 3.1.0)
Package: drjacoby
Type: Package
Title: Flexible Markov Chain Monte Carlo via Reparameterization
Version: 1.5.2
Authors@R: c(
person("Bob", "Verity", email = "[email protected]", role = c("aut", "cre")),
person("Pete", "Winskill", email = "[email protected]", role = c("aut"))
)
Description: drjacoby is an R package for performing Bayesian inference via
Markov chain monte carlo (MCMC). In addition to being highly flexible it
implements some advanced techniques that can improve mixing in tricky
situations.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
LinkingTo:
Rcpp
Imports:
Rcpp,
coda,
parallel,
ggplot2,
RcppXPtrUtils,
usethis,
tools,
rlang,
cowplot,
dplyr,
magrittr,
readr,
data.table
SystemRequirements: C++11
Suggests:
testthat,
covr,
knitr,
rmarkdown,
microbenchmark,
gridExtra
BugReports: https://github.com/mrc-ide/drjacoby/issues
VignetteBuilder: knitr
Depends: R (>= 3.1.0)
11 changes: 11 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#' Population data.
#'
#' Example population growth data.
#'
#' @format A data frame with 20 rows and 2 variables:
#' \describe{
#' \item{pop}{population size}
#' \item{time}{time}
#' ...
#' }
"population_data"
7 changes: 6 additions & 1 deletion R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ check_params <- function(x) {
#' raised to the power \eqn{\beta[i]^\alpha}, meaning we can use the
#' \eqn{\alpha} parameter to concentrate rungs towards the start or the end of
#' the temperature scale.
#' @param target_acceptance Target acceptance rate. Should be between 0 and 1.
#' Default of 0.44, set as optimum for unvariate proposal distributions.
#' @param cluster option to pass in a cluster environment, allowing chains to be
#' run in parallel (see package "parallel").
#' @param coupling_on whether to implement Metropolis-coupling over temperature
Expand Down Expand Up @@ -217,6 +219,7 @@ run_mcmc <- function(data,
chains = 5,
beta_manual = NULL,
alpha = 1.0,
target_acceptance = 0.44,
cluster = NULL,
coupling_on = TRUE,
pb_markdown = FALSE,
Expand Down Expand Up @@ -250,6 +253,7 @@ run_mcmc <- function(data,
assert_single_pos_int(chains, zero_allowed = FALSE)
assert_single_logical(coupling_on)
assert_single_pos(alpha)
assert_bounded(target_acceptance, 0, 1)

# check df_params
df_params <- check_params(df_params)
Expand Down Expand Up @@ -362,7 +366,8 @@ run_mcmc <- function(data,
beta_raised = beta_raised,
save_hot_draws = save_hot_draws,
pb_markdown = pb_markdown,
silent = silent)
silent = silent,
target_acceptance = target_acceptance)

# functions to pass to C++
args_functions <- list(loglike = loglike,
Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ navbar:
href: articles/metropolis_coupling.html
- text: "Running Parallel Chains"
href: articles/parallel.html
- text: "Getting Model Fits"
href: articles/getting_model_fits.html
- text: "Using Likelihood Blocks"
href: articles/blocks.html
- text: "Checks"
Expand Down
Binary file added data/population_data.rda
Binary file not shown.
5 changes: 4 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 79 additions & 6 deletions docs/articles/blocks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/blocks_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/blocks_files/figure-html/unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions docs/articles/checks_double_well.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions docs/articles/checks_multilevel_blocks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 476d94f

Please sign in to comment.