Skip to content

Commit

Permalink
Document data type coercion in lfmcmc.R
Browse files Browse the repository at this point in the history
  • Loading branch information
apulsipher committed Nov 20, 2024
1 parent 97edc81 commit 6b7cb74
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions R/LFMCMC.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
#'
#' ## Run LFMCMC simulation
#' # Set initial parameters
#' par0 <- as.double(c(0.1, 0.5))
#' par0 <- c(0.1, 0.5)
#' n_samp <- 2000
#' epsil <- as.double(1.0)
#' epsil <- 1.0
#'
#' # Run the LFMCMC simulation
#' run_lfmcmc(
Expand Down Expand Up @@ -92,9 +92,9 @@ LFMCMC <- function(model = NULL) {

#' @rdname LFMCMC
#' @param lfmcmc LFMCMC model
#' @param params_init_ Initial model parameters
#' @param n_samples_ Number of samples
#' @param epsilon_ Epsilon parameter
#' @param params_init_ Initial model parameters, treated as double
#' @param n_samples_ Number of samples, treated as integer
#' @param epsilon_ Epsilon parameter, treated as double
#' @param seed Random engine seed
#' @returns The simulated model of class [epiworld_lfmcmc].
#' @export
Expand Down Expand Up @@ -128,7 +128,7 @@ run_lfmcmc.epiworld_lfmcmc <- function(

#' @rdname LFMCMC
#' @param lfmcmc LFMCMC model
#' @param observed_data_ Observed data
#' @param observed_data_ Observed data, treated as double
#' @returns The lfmcmc model with the observed data added
#' @export
set_observed_data <- function(
Expand Down
4 changes: 2 additions & 2 deletions inst/tinytest/test-lfmcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ expect_silent(set_kernel_fun(lfmcmc_model, kernelfun))

# Run LFMCMC simulation --------------------------------------------------------
# Initial parameters
par0 <- as.double(c(0.1, 0.5))
par0 <- c(0.1, 0.5)
n_samp <- 2000
epsil <- as.double(1.0)
epsil <- 1.0

expect_silent(run_lfmcmc(
lfmcmc = lfmcmc_model,
Expand Down
12 changes: 6 additions & 6 deletions man/LFMCMC.Rd

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

4 changes: 2 additions & 2 deletions vignettes/likelihood-free-mcmc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ lfmcmc_model <- LFMCMC(model_sir) |>
## Run LFMCMC simulation
```{r lfmcmc-run}
# Set initial parameters
par0 <- as.double(c(0.1, 0.5))
par0 <- c(0.1, 0.5)
n_samp <- 2000
epsil <- as.double(1.0)
epsil <- 1.0
# Run the LFMCMC simulation
run_lfmcmc(
Expand Down

0 comments on commit 6b7cb74

Please sign in to comment.