Learn R Programming

MBNMAtime (version 0.2.6)

get.prior: Get current priors from JAGS model code

Description

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.

Usage

get.prior(model)

Value

A character vector, each element of which is a line of JAGS code corresponding to a prior in the JAGS code.

Arguments

model

A character object of JAGS MBNMA model 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

Run this code
# \donttest{
# Create mb.network object using an MBNMAtime dataset
network <- mb.network(osteopain)

# 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"))

# Obtain model prior values
get.prior(result$model.arg$jagscode)

# ...also equivalent to
print(result$model.arg$priors)
# }

Run the code above in your browser using DataLab