Learn R Programming

runjags (version 1.2.1-0)

load.runjagsmodule: Load the internal JAGS module provided by runjags

Description

The runjags package contains a JAGS extension module that provides several additional distributions for use within JAGS (see details below). This function is a simple wrapper to load this module. The version of the module supplied within the runjags package can only be used with the rjags package, or with the rjags or rjparallel methods within runjags. For a standalone JAGS module for use with any JAGS method (or independent JAGS runs) please see:

http://sourceforge.net/projects/runjags/

Usage

load.runjagsmodule()

Arguments

Value

  • Invisibly returns TRUE if able to load the module, or FALSE otherwise

Details

This module provides the following distributions for JAGS:

PARETO TYPE I: dpar1(alpha, sigma) $$p(x) = \alpha \sigma^{\alpha} x^{-\left(\alpha+1 \right)}$$

$$\alpha > 0, \sigma > 0, x > \sigma$$

PARETO TYPE II: dpar2(alpha, sigma, mu)

$$p(x) = \frac{\alpha}{\sigma} \left( \frac{\alpha + x - \mu}{\sigma}\right)^{-\left(\alpha+1\right)}$$

$$\alpha > 0, \sigma > 0, x > \mu$$

PARETO TYPE III: dpar3(sigma, mu, gamma)

$$p(x) = \frac{\frac{x-\mu}{\sigma}^{\frac{1}{\gamma}-1} \left(\frac{x-\mu}{\sigma}^{\frac{1}{\gamma}} +1\right)^{-2}}{\gamma \sigma}$$

$$\sigma > 0, \gamma > 0, x > \mu$$

PARETO TYPE IV: dpar4(alpha, sigma, mu, gamma)

$$p(x) = \frac{\alpha \frac{x-\mu}{\sigma}^{\frac{1}{\gamma}-1} \left(\frac{x-\mu}{\sigma}^{\frac{1}{\gamma}} +1\right)^{-\left(\alpha+1\right)}}{\gamma \sigma}$$

$$\alpha > 0, \sigma > 0, \gamma > 0, x > \mu$$

LOMAX: dlomax(alpha, sigma)

$$p(x) = \frac{\alpha}{\sigma} \left(1 + \frac{x}{\sigma}\right)^{-\left(\alpha+1\right)}$$

$$\alpha > 0, \sigma > 0, x > 0$$

DUMOUCHEL: dmouch(sigma)

$$p(x) = \frac{\sigma}{\left(x+\sigma\right)^2}$$

$$\sigma > 0, x > 0$$

GENERALISED PARETO: dgenpar(sigma, mu, xi)

$$p(x) = \frac{1}{\sigma} \left(1 + \xi \left(\frac{x-\mu}{\sigma}\right)\right)^{-\left(\frac{1}{\xi}+1\right)}$$

For $\xi=0$:

$$p(x) = \frac{1}{\sigma} e^{\frac{-\left(x-\mu\right)}{\sigma}}$$

$$\sigma > 0, x > \mu$$

For an easier to read version of these PDF equations, either see the PDF version of the help files or the 'module_distributions.pdf' file included in the doc folder of this package.

References

M. J. Denwood, "runjags: An R Package Providing Interface Utilities, Distributed Computing Methods and Additional Distributions For MCMC Models in JAGS," Journal of Statistical Software, [Under review].

See Also

runjags-class

Examples

Run this code
# A simple model to sample from a Lomax distribution.	
	# (Requires the rjags or rjparallel methods)
	if(require("rjags")){
		m <- "model{
			L ~ dlomax(1,1)
		}"	
		results <- run.jags(m, monitor="L", method="rjags", 
		modules="runjags")
	
		# Load the module for use with any rjags model:
		load.runjagsmodule()
	}

Run the code above in your browser using DataLab