Construct parameters for use with pmcmc(). This creates a utility object that is used internally to work with parameters. Most users only need to construct this object, but see the examples for how it can be used.

## Methods

### Method new()

Create the pmcmc_parameters object

pmcmc_parameters$new(parameters, proposal, transform = NULL) #### Arguments parameters A list of pmcmc_parameter objects, each of which describe a single parameter in your model. If parameters is named, then these names must match the $name element of each parameter is used (this is verified).

proposal

A square proposal distribution corresponding to the variance-covariance matrix of a multivariate gaussian distribution used to generate new parameters. It must have the same number of rows and columns as there are elements in parameters, and if named the names must correspond exactly to the names in parameters. Because it corresponds to a variance-covariance matrix it must be symmetric and positive definite.

transform

An optional transformation function to apply to your parameter vector immediately before passing it to the model function. If not given, then as.list is used, as dust models require this. However, if t you need to generate derived parameters from those being actively sampled you can do arbitrary transformations here.

### Method initial()

Return the initial parameter values as a named numeric vector

### Method summary()

Return a data.frame with information about parameters (name, min, max, and discrete).

#### Arguments

theta

#### Arguments

theta

#### Arguments

theta

#### Arguments

fixed

a named vector of parameters to fix

## Examples

# Construct an object with two parameters:
pars <- mcstate::pmcmc_parameters$new( list(mcstate::pmcmc_parameter("a", 0.1, min = 0, max = 1, prior = function(a) log(a)), mcstate::pmcmc_parameter("b", 0, prior = dnorm)), matrix(c(1, 0.5, 0.5, 2), 2, 2)) # Initial parameters p <- pars$initial()
p
#>   a   b
#> 0.1 0.0

# Propose a new parameter point
pars$propose(p) #> a b #> 0.02891308 -0.96602612 # Information about parameters: pars$names()
#> [1] "a" "b"
pars$summary() #> name min max discrete #> 1 a 0 1 FALSE #> 2 b -Inf Inf FALSE # Compute prior pars$prior(p)
#> [1] -1.903643

# Transform data for your model
pars$model(p) #>$a
#> [1] 0.1
#>
#> \$b
#> [1] 0
#>