get.prior: Get current priors from JAGS model code

View source: R/write.jags.R

get.priorR Documentation

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)

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.

Value

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

Examples


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



MBNMAtime documentation built on Oct. 14, 2023, 5:08 p.m.