e
can be expressions, those by s
must be scalar-valued nodes in the graph and those represented by v
must be vector-valued nodes in a graph. Some function arguments must be stochastic nodes. Functionals are described using a similar notation to functions, the special notation F(x)
is used to describe the function on which the functional acts. See example Functionals for details.D(x[1:n], t)
notation. See example ode for details. abs(e)
absolute value of e, |e|arccos(e)
inverse cosine of earccosh(e)
inverse hyperbolic cosine of earcsin(e)
inverse sine of earcsinh(e)
inverse hyperbolic sine of earctan(e)
inverse tangent of earctanh(e)
inverse hyperbolic tangent of ecloglog(e)
complementary log log of e, ln(-ln(1 - e))cos(e)
cosine of ecosh(e)
hyperbolic cosine of ecut(e)
cuts edges in the graph - see Tip and tricks page for details.equals(e1, e2)
1 if value of e1 equals value of e2; 0 otherwiseexp(e)
exp(e)gammap(s1, s2)
partial (incomplete) gamma function, value of standard gamma density with parameter s1 integrated up to s2ilogit(e)
exp(e) / (1 + exp(e))icloglog(e)
1 - exp( - exp(e))integral(F(s), s1, s2, s3)
definite integral of function F(s) between s = s1 and s = s2 to accuracy s3log(e)
natural logarithm of elogfact(e)
ln(e!)loggam(e)
logarithm of gamma function of elogit(e)
ln(e / (1 - e))max(e1, e2)
e1 if e1 > e2; e2 otherwisemin(e1, e2)
e1 if e1 < e2; e2 otherwisephi(e)
standard normal cdfpost.p.value(s)
s must be a stochastic node, returns one if a sample from the prior is less than the value of spow(e1, e2)
e1e2 prior.p.value(s)
s must be a stochastic node, returns one if a sample from the prior after resampling its stochastic parents is less than value of s.probit(e)
inverse of phi(e)
replicate.post(s)
replicate from distribution of s, s must be stochastic nodereplicate.prior.(s)
replicate from distribution of s after replicating from it parents if they are stochastic, s must be stochastic noderound(e)
nearest integer to esin(e)
sine of esinh(e)
hyperbolic sine of esolution(F(s), s1, s2, s3)
a solution of equation F(s) = 0 lying between s = s1 and s = s2 to accuracy s3, s1 and s2 must bracket a solutionsqrt(e)
e1/2 step(e)
1 if e >= 0; 0 otherwisetan(e)
tangent of etanh(e)
hyperbolic tangent of etrunc(e)
greatest integer less than or equal to einprod(v1, v2)
inner product Σi v1i v2i of v1 and v2 interp.lin(e, v1, v2)
Given function values in the vector v2 evaluated at the points in v1, this estimates the function value at a new point e by simple linear interpolation using the closest bounding pair of points. For example, given the population in 1991,2001 and 2011, we might want to estimate the population in 2004. Specifically, v2p + (v2p + 1 - v2p) * (e - v1p) / (v1p + 1 - v1p), where p is such that v1p < e < v1p + 1 and the elements of v1 are in ascending orderinverse(v)
inverse of symmetric positive-definite matrix vlogdet(v)
log of determinant of v for symmetric positive-definite vmean(v)
Σi vi / n, where n = dim(v)eigen.vals(v)
eigenvalues of matrix vode(v1,
v2, D(v3, s1), s2, s3)
solution of system of ordinary differential equations at grid of points v2 given initial values v1 at time s2 solved to accuracy s3. v3 is a vector of components of the system of ode and s1 is the time variable. See the PDF files in the Diff/Docu directory of the BUGS installation for further details.prod(v)
Πi vi p.valueM(v)
v must be a multivariate stochastic node, returns a vector of ones and zeros depending on if a sample from the prior is less than value of the corresponding component of vrank(v, s)
number of components of vless than or equal to sranked(v, s)
the sthsmallest component of vreplicate.postM(v)
replicate from multivariate distribution of v, v must be stochastic and multivariatesd(v)
standard deviation of components of v (n - 1 in denominator)sort(v)
vector v sorted in ascending ordersum(v)
Σi vicdf.dist
, pdf.dist
and dev.dist
family of functions, where dist
corresponds to one of the distributions listed above. The first argument of each function is the value at which to evaluate the function. The other arguments are the parameters of the distribution itself. For example, for the normal distribution:cdf.norm(s, mu, tau)
cumulative distribution function at the value of s
for a normal distribution with parameters mu
and tau
pdf.norm(s, mu, tau)
probability density of distribution at value of s for a normal distribution with parameters mu
and tau
dev.norm(s, mu tau)
deviance of distribution at value of s for a normal distribution with parameters mu
and tau
cdf.bern
, cdf.beta
, cdf.bin
, cdf.cat
, cdf.chisqr
, cdf.dexp
, cdf.exp
, cdf.f
, cdf.gamma
, cdf.ggamma
, cdf.geom0
, cdf.geom1
, cdf.hyper
, cdf.lnorm
, cdf.logis
, cdf.negbin
, cdf.norm
, cdf.par
, cdf.pois
, cdf.polygene
, cdf.t
, cdf.trap
, cdf.triang
, cdf.unif
, cdf.weib
, cdf.weib3
, cdf.gev
, cdf.gpar.
No cumulative distribution function is available for flat (dflat
), generic (dloglik
), stable (dstable
) or Zipf (dzipf
) distributions. pdf.bern
, pdf.beta
, pdf.bin
, pdf.cat
, pdf.chisqr
, pdf.dexp
, pdf.exp
, pdf.f
, pdf.flat
, pdf.gamma
, pdf.ggamma
, pdf.geom0
, pdf.geom1
, pdf.hyper
, pdf.lnorm
, pdf.logis
, pdf.negbin
, pdf.norm
, pdf.par
, pdf.pois
, pdf.polygene
, pdf.t
, pdf.trap
, pdf.triang
, pdf.unif
, pdf.weib
, pdf.weib3
, pdf.gev
, pdf.gpar
, pdf.zipf.
No probability distribution function is available for generic (dloglik
) or stable (dstable
) distributions. pdf.dirich
, pdf.multi
, pdf.mnorm
, pdf.mt
, pdf.wish
dev.bern
, dev.beta
, dev.bin
, dev.cat
, dev.chisqr
, dev.dexp
, dev.exp
, dev.f
, dev.flat
, dev.gamma
, dev.ggamma
, dev.geom0
, dev.geom1
, dev.hyper
, dev.lnorm
, dev.logis
, dev.negbin
, dev.norm
, dev.par
, dev.pois
, dev.polygene
, dev.t
, dev.trap
, dev.triang
, dev.unif
, dev.weib
, dev.weib3
, dev.gev
, dev.gpar
, dev.zipf.
No deviance function is available for generic (dloglik
) or stable (dstable
) distributions.dev.dirich
, dev.multi
, dev.mnorm
, dev.mt
, dev.wish