Describe a single parameter for use within the pmcmc. Note that the name is not set here, but will end up being naturally defined when used with pmcmc_parameters, which collects these together for use with pmcmc().

pmcmc_parameter(
  name,
  initial,
  min = -Inf,
  max = Inf,
  discrete = FALSE,
  prior = NULL
)

Arguments

name

Name for the parameter (a string)

initial

Initial value for the parameter

min

Optional minimum value for the parameter (otherwise -Inf). If given, then initial must be at least this value.

max

Optional max value for the parameter (otherwise Inf). If given, then initial must be at most this value.

discrete

Logical, indicating if this parameter is discrete. If TRUE then the parameter will be rounded after a new parameter is proposed.

prior

A prior function (if not given an improper flat prior is used - be careful!). It must be a function that takes a single argument, being the value of this parameter. If given, then prior(initial) must evaluate to a finite value.

Examples

pmcmc_parameter("a", 0.1)
#> $name
#> [1] "a"
#> 
#> $initial
#> [1] 0.1
#> 
#> $min
#> [1] -Inf
#> 
#> $max
#> [1] Inf
#> 
#> $discrete
#> [1] FALSE
#> 
#> $prior
#> function (p) 
#> 0
#> <bytecode: 0x7fac30a87890>
#> <environment: 0x7fac2fc2d160>
#> 
#> attr(,"class")
#> [1] "pmcmc_parameter"