Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer free functions to methods #108

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: monty
Title: Monte Carlo Models
Version: 0.2.39
Version: 0.2.40
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "rich.fitzjohn@gmail.com"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion R/packer.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##' unstructured vector of numbers (the vector being updated by an
##' MCMC for example) and a structured list of named values, which is
##' easier to program against. This is useful for the bridge between
##' model parameters and a models's implementation, but it is also
##' model parameters and a model's implementation, but it is also
##' useful for the state vector in a state-space model. We refer to
##' the process of taking a named list of scalars, vectors and arrays
##' and converting into a single vector "packing" and the inverse
Expand Down
2 changes: 1 addition & 1 deletion R/rng.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ monty_rng <- R6::R6Class(
##'
##' @param size The number of trials (zero or more, length 1 or n)
##'
##' @param prob The mean probability of sucess on each trial
##' @param prob The mean probability of success on each trial
##' (between 0 and 1, length 1 or n)
##'
##' @param rho The dispersion parameter (between 0 and 1, length 1 or n)
Expand Down
2 changes: 1 addition & 1 deletion R/runner-callr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##' this is the same as "worker" processes. Unless your chains take a
##' few seconds to run, this will be slower than running with the
##' default serial runner ([monty_runner_serial]), however for long
##' running chains, the speedup will typically scale with workers
##' running chains, the speed-up will typically scale with workers
##' added, so long as your chains divide neatly over workers.
##'
##' @title Run MCMC chains in parallel with `callr`
Expand Down
2 changes: 1 addition & 1 deletion R/runner.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ monty_runner_serial <- function(progress = NULL) {
##' Run MCMC chains in parallel (at the same time). This runner uses
##' the `parallel` package to distribute your chains over a number of
##' worker processes on the same machine. Compared with
##' [monty_runner_callr] (Whch is similar to the "worker" support in
##' [monty_runner_callr] (Which is similar to the "worker" support in
##' `mcstate` version 1), this is very simple. In particular we do
##' not report back any information about progress while a chain is
##' running on a worker or even across chains. There's also no
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# monty

<!-- badges: start -->
[![Project Status: ConceptMinimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)
[![Project Status: WIPInitial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![R-CMD-check](https://github.com/mrc-ide/monty/actions/workflows/R-CMD-check.yaml/badge.svg?branch=main)](https://github.com/mrc-ide/monty/actions/workflows/R-CMD-check.yaml)
[![codecov.io](https://codecov.io/github/mrc-ide/monty/coverage.svg?branch=main)](https://codecov.io/github/mrc-ide/monty?branch=main)
<!-- badges: end -->
Expand All @@ -10,8 +10,6 @@

See the [package vignette](https://mrc-ide.github.io/monty/articles/monty.html) for a basic introduction.

The package is in an early, though rapid, stage of development and we cannot guarantee that interfaces will not change (in fact, we can guarantee that they **will** really). However the core concepts have now solidified.

The core of the package is built around some basic ideas:

* you have some [statistical model](https://mrc-ide.github.io/monty/reference/monty_model.html) from which you would like to draw samples using MCMC ([`monty::monty_sample`](https://mrc-ide.github.io/monty/reference/monty_sample.html))
Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Poisson
R's
SEF
VCV
WIP
burnin
cli's
codecov
composable
Expand Down
2 changes: 1 addition & 1 deletion man/monty_packer.Rd

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

2 changes: 1 addition & 1 deletion man/monty_rng.Rd

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

2 changes: 1 addition & 1 deletion man/monty_runner_callr.Rd

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

2 changes: 1 addition & 1 deletion man/monty_runner_parallel.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/dsl.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ We can draw samples from the model if we provide a `monty_rng` object

```{r}
rng <- monty_rng$new()
theta <- prior$direct_sample(rng)
theta <- monty_model_direct_sample(prior, rng)
theta
```

We can compute the (log) density at a point in parameter space

```{r}
prior$density(theta)
monty_model_density(prior, theta)
```

The computed properties for the model are:
Expand Down
Loading