Get current priors from JAGS model code
get.prior.Rd
Identical to get.prior()
in MBNMAdose.
This function takes JAGS model presented as a string and identifies what
prior values have been used for calculation.
Value
A character vector, each element of which is a line of JAGS code corresponding to a prior in the JAGS code.
Details
Even if an MBNMA model that has not initialised successfully and
results have not been calculated, the JAGS model for it is saved in
MBNMA$model.arg$jagscode
and therefore priors can still be obtained.
This allows for priors to be changed even in failing models, which may help
solve issues with initialisation.
Examples
# \donttest{
# Create mb.network object using an MBNMAtime dataset
network <- mb.network(osteopain)
#> Reference treatment is `Pl_0`
#> Studies reporting change from baseline automatically identified from the data
# Create mb.network object using an MBNMAdose dataset
# Run linear MBNMA
result <- mb.run(network, fun=tpoly(degree=1,
pool.1="rel", method.1="random"))
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 417
#> Unobserved stochastic nodes: 163
#> Total graph size: 7701
#>
#> Initializing model
#>
# Obtain model prior values
get.prior(result$model.arg$jagscode)
#> $mu.1
#> [1] "dnorm(0,0.0001)"
#>
#> $alpha
#> [1] "dnorm(0,0.0001)"
#>
#> $d.1
#> [1] "dnorm(0,0.001)"
#>
#> $sd.beta.1
#> [1] "dnorm(0,0.05) T(0,)"
#>
# ...also equivalent to
print(result$model.arg$priors)
#> $mu.1
#> [1] "dnorm(0,0.0001)"
#>
#> $alpha
#> [1] "dnorm(0,0.0001)"
#>
#> $d.1
#> [1] "dnorm(0,0.001)"
#>
#> $sd.beta.1
#> [1] "dnorm(0,0.05) T(0,)"
#>
# }