get.prior: Get current priors from JAGS model code

Description Usage Arguments Details Value Examples

View source: R/write.functions.R

Description

Identical to get.prior() in MBNMAtime package. This function takes JAGS model presented as a string and identifies what prior values have been used for calculation.

Usage

1
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 compiling or updating.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Using the triptans data
network <- mbnma.network(HF2PPITT)

# Run an Emax dose-response MBNMA
result <- mbnma.emax(network, emax="rel", ed50="rel", method="random")

# Obtain model prior values
print(result$model.arg$priors)

# Priors when using mbnma.run with an exponential function
result <- mbnma.run(network, fun="exponential", beta.1="rel", method="random")
print(result$model.arg$priors)

MBNMAdose documentation built on Sept. 13, 2020, 5:08 p.m.