JAGS modules contain factory objects for samplers, monitors, and random number generators for a JAGS model. These functions allow fine-grained control over which factories are active.

list.factories(type)
set.factory(name, type, state)

Arguments

name

name of the factory to set

type

type of factory to query or set. Possible values are "sampler", "monitor", or "rng"

state

a logical. If TRUE then the factory will be active, otherwise the factory will become inactive.

Value

list.factories returns a data frame with two columns, the first column shows the names of the factory objects in the currently loaded modules, and the second column is a logical vector indicating whether the corresponding factory is active or not.

set.factory is called to change the future behaviour of factory objects. If a factory is set to inactive then it will be skipped.

Note

When a module is loaded, all of its factory objects are active. This is also true if a module is unloaded and then reloaded.

Author

Martyn Plummer

Examples

list.factories("sampler")
#>             factory status
#> 1  bugs::BinomSlice   TRUE
#> 2         bugs::RW1   TRUE
#> 3    bugs::Censored   TRUE
#> 4         bugs::Sum   TRUE
#> 5        bugs::DSum   TRUE
#> 6   bugs::Conjugate   TRUE
#> 7   bugs::Dirichlet   TRUE
#> 8     bugs::MNormal   TRUE
#> 9      base::Finite   TRUE
#> 10      base::Slice   TRUE
list.factories("monitor")
#>          factory status
#> 1 base::Variance   TRUE
#> 2     base::Mean   TRUE
#> 3    base::Trace   TRUE
list.factories("rng")
#>         factory status
#> 1 base::BaseRNG   TRUE
set.factory("base::Slice", "sampler", FALSE)
#> NULL
list.factories("sampler")
#>             factory status
#> 1  bugs::BinomSlice   TRUE
#> 2         bugs::RW1   TRUE
#> 3    bugs::Censored   TRUE
#> 4         bugs::Sum   TRUE
#> 5        bugs::DSum   TRUE
#> 6   bugs::Conjugate   TRUE
#> 7   bugs::Dirichlet   TRUE
#> 8     bugs::MNormal   TRUE
#> 9      base::Finite   TRUE
#> 10      base::Slice  FALSE
set.factory("base::Slice", "sampler", TRUE)
#> NULL