JuliaBUGS.BUGSPrimitives.dnorm
— Functiondnorm(μ, τ)
Returns an instance of Normal with mean $μ$ and standard deviation $\frac{1}{√τ}$.
\[p(x|μ,τ) = \sqrt{\frac{τ}{2π}} e^{-τ \frac{(x-μ)^2}{2}}\]
JuliaBUGS.BUGSPrimitives.dlogis
— Functiondlogis(μ, τ)
Return an instance of Logistic with location parameter $μ$ and scale parameter $\frac{1}{√τ}$.
\[p(x|μ,τ) = \frac{\sqrt{τ} e^{-\sqrt{τ}(x-μ)}}{(1+e^{-\sqrt{τ}(x-μ)})^2}\]
JuliaBUGS.BUGSPrimitives.dt
— Functiondt(μ, τ, ν)
If $μ = 0$ and $σ = 1$, the function returns an instance of TDist with $ν$ degrees of freedom, location $μ$, and scale $σ = \frac{1}{\sqrt{τ}}$. Otherwise, it returns an instance of TDistShiftedScaled
.
\[p(x|ν,μ,σ) = \frac{Γ((ν+1)/2)}{Γ(ν/2) \sqrt{νπσ}} \left(1+\frac{1}{ν}\left(\frac{x-μ}{σ}\right)^2\right)^{-\frac{ν+1}{2}}\]
JuliaBUGS.BUGSPrimitives.TDistShiftedScaled
— TypeTDistShiftedScaled(ν, μ, σ)
Student's t-distribution with $ν$ degrees of freedom, location $μ$, and scale $σ$.
This struct allows for a shift (determined by $μ$) and a scale (determined by $σ$) of the standard Student's t-distribution provided by the Distributions.jl package.
Only pdf
and logpdf
are implemented for this distribution.
See Also
JuliaBUGS.BUGSPrimitives.ddexp
— Functionddexp(μ, τ)
Return an instance of Laplace (Double Exponential) with location $μ$ and scale $\frac{1}{\sqrt{τ}}$.
\[p(x|μ,τ) = \frac{\sqrt{τ}}{2} e^{-\sqrt{τ} |x-μ|}\]
JuliaBUGS.BUGSPrimitives.dflat
— Functiondflat()
Returns an instance of Flat
or TruncatedFlat
if truncated.
Flat
represents a flat (uniform) prior over the real line, which is an improper distribution. And TruncatedFlat
represents a truncated version of the Flat
distribution.
Only pdf
, logpdf
, minimum
, and maximum
are implemented for these Distributions.
When use in a model, the parameters always need to be initialized.
JuliaBUGS.BUGSPrimitives.Flat
— TypeFlat
The flat distribution mimicking the behavior of the dflat
distribution in the BUGS family of softwares.
JuliaBUGS.BUGSPrimitives.TruncatedFlat
— TypeTruncatedFlat
Truncated version of the Flat
distribution.
JuliaBUGS.BUGSPrimitives.dexp
— FunctionJuliaBUGS.BUGSPrimitives.dchisqr
— Functiondchisqr(k)
Returns an instance of Chi-squared with $k$ degrees of freedom.
\[p(x|k) = \frac{1}{2^{k/2} Γ(k/2)} x^{k/2 - 1} e^{-x/2}\]
JuliaBUGS.BUGSPrimitives.dweib
— Functiondweib(a, b)
Returns an instance of Weibull distribution object with shape parameter $a$ and scale parameter $\frac{1}{b}$.
The Weibull distribution is a common model for event times. The hazard or instantaneous risk of the event is $abx^{a-1}$. For $a < 1$ the hazard decreases with $x$; for $a > 1$ it increases. $a = 1$ results in the exponential distribution with constant hazard.
\[p(x|a,b) = abx^{a-1}e^{-b x^a}\]
JuliaBUGS.BUGSPrimitives.dlnorm
— Functiondlnorm(μ, τ)
Returns an instance of LogNormal with location $μ$ and scale $\frac{1}{\sqrt{τ}}$.
\[p(x|μ,τ) = \frac{\sqrt{τ}}{x\sqrt{2π}} e^{-τ/2 (\log(x) - μ)^2}\]
JuliaBUGS.BUGSPrimitives.dgamma
— Functiondgamma(a, b)
Returns an instance of Gamma with shape $a$ and scale $\frac{1}{b}$.
\[p(x|a,b) = \frac{b^a}{Γ(a)} x^{a-1} e^{-bx}\]
JuliaBUGS.BUGSPrimitives.dpar
— Functiondpar(a, b)
Returns an instance of Pareto with scale parameter $b$ and shape parameter $a$.
\[p(x|a,b) = \frac{a b^a}{x^{a+1}}\]
JuliaBUGS.BUGSPrimitives.dgev
— Functiondgev(μ, σ, η)
Returns an instance of GeneralizedExtremeValue with location $μ$, scale $σ$, and shape $η$.
\[p(x|μ,σ,η) = \frac{1}{σ} \left(1 + η \frac{x - μ}{σ}\right)^{-\frac{1}{η} - 1} e^{-\left(1 + η \frac{x - μ}{σ}\right)^{-\frac{1}{η}}}\]
where $\frac{η(x - μ)}{σ} > -1$.
JuliaBUGS.BUGSPrimitives.dgpar
— Functiondgpar(μ, σ, η)
Returns an instance of GeneralizedPareto with location $μ$, scale $σ$, and shape $η$.
\[p(x|μ,σ,η) = \frac{1}{σ} (1 + η ((x - μ)/σ))^{-1/η - 1}\]
JuliaBUGS.BUGSPrimitives.df
— Functiondf(n, m, μ=0, τ=1)
Returns an instance of F-distribution object with $n$ and $m$ degrees of freedom, location $μ$, and scale $τ$. This function is only valid when $μ = 0$ and $τ = 1$,
\[p(x|n, m, μ, τ) = \frac{\Gamma\left(\frac{n+m}{2}\right)}{\Gamma\left(\frac{n}{2}\right) \Gamma\left(\frac{m}{2}\right)} \left(\frac{n}{m}\right)^{\frac{n}{2}} \sqrt{τ} \left(\sqrt{τ}(x - μ)\right)^{\frac{n}{2}-1} \left(1 + \frac{n \sqrt{τ}(x-μ)}{m}\right)^{-\frac{n+m}{2}}\]
where $\frac{n \sqrt{τ} (x - μ)}{m} > -1$.
JuliaBUGS.BUGSPrimitives.dunif
— Functiondunif(a, b)
Returns an instance of Uniform with lower bound $a$ and upper bound $b$.
\[p(x|a,b) = \frac{1}{b - a}\]
JuliaBUGS.BUGSPrimitives.dbeta
— Functiondbeta(a, b)
Returns an instance of Beta with shape parameters $a$ and $b$.
\[p(x|a,b) = \frac{\Gamma(a + b)}{\Gamma(a)\Gamma(b)} x^{a-1} (1 - x)^{b-1}\]
JuliaBUGS.BUGSPrimitives.dmnorm
— Functiondmnorm(μ::AbstractVector, T::AbstractMatrix)
Returns an instance of Multivariate Normal with mean vector μ
and covariance matrix $T^{-1}$.
\[p(x|μ,T) = (2π)^{-k/2} |T|^{1/2} e^{-1/2 (x-μ)' T (x-μ)}\]
where $k$ is the dimension of x
.
JuliaBUGS.BUGSPrimitives.dmt
— Functiondmt(μ::AbstractVector, T::AbstractMatrix, k)
Returns an instance of Multivariate T with mean vector $μ$, scale matrix $T^{-1}$, and $k$ degrees of freedom.
\[p(x|k,μ,Σ) = \frac{\Gamma((k+d)/2)}{\Gamma(k/2) (k\pi)^{p/2} |Σ|^{1/2}} \left(1 + \frac{1}{k} (x-μ)^T Σ^{-1} (x-μ)\right)^{-\frac{k+p}{2}}\]
where $p$ is the dimension of $x$.
JuliaBUGS.BUGSPrimitives.dwish
— Functiondwish(R::AbstractMatrix, k)
Returns an instance of Wishart with $k$ degrees of freedom and the scale matrix $T^{-1}$.
\[p(X|R,k) = |R|^{k/2} |X|^{(k-p-1)/2} e^{-(1/2) tr(RX)} / (2^{kp/2} Γ_p(k/2))\]
where $p$ is the dimension of $X$, and it should be less than or equal to $k$.
JuliaBUGS.BUGSPrimitives.ddirich
— Functionddirich(θ::AbstractVector)
Return an instance of Dirichlet with parameters $θ_i$.
\[p(x|θ) = \frac{Γ(\sum θ)}{∏ Γ(θ)} ∏ x_i^{θ_i - 1}\]
where $\theta_i > 0, x_i \in [0, 1], \sum_i x_i = 1$
JuliaBUGS.BUGSPrimitives.dbern
— FunctionJuliaBUGS.BUGSPrimitives.dbin
— Functiondbin(p, n)
Returns an instance of Binomial with number of trials n
and success probability p
.
\[p(x|n,p) = \binom{n}{x} p^x (1 - p)^{n-x}\]
end
where $\theta \in [0, 1], n \in \mathbb{Z}^+,$ and $x = 0, \ldots, n$.
JuliaBUGS.BUGSPrimitives.dcat
— FunctionJuliaBUGS.BUGSPrimitives.dpois
— FunctionJuliaBUGS.BUGSPrimitives.dgeom
— FunctionJuliaBUGS.BUGSPrimitives.dnegbin
— Functiondnegbin(p, r)
Returns an instance of Negative Binomial with number of failures r
and success probability p
.
\[P(x|r,p) = \binom{x + r - 1}{x} (1 - p)^x p^r\]
where $x \in \mathbb{Z}^+$.
JuliaBUGS.BUGSPrimitives.dbetabin
— Functiondbetabin(a, b, n)
Returns an instance of Beta Binomial with number of trials n
and shape parameters a
and b
.
\[P(x|a, b, n) = \frac{\binom{n}{x} \binom{a + b - 1}{a + x - 1}}{\binom{a + b + n - 1}{n}}\]
JuliaBUGS.BUGSPrimitives.dhyper
— Functiondhyper(n₁, n₂, m₁, ψ=1)
Returns an instance of Hypergeometric. This distribution is used when sampling without replacement from a population consisting of $n₁$ successes and $n₂$ failures, with $m₁$ being the number of trials or the sample size. The function currently only allows for $ψ = 1$.
\[p(x | n₁, n₂, m₁, \psi) = \frac{\binom{n₁}{x} \binom{n₂}{m₁ - x} \psi^x}{\sum_{i=u_0}^{u_1} \binom{n1}{i} \binom{n2}{m₁ - i} \psi^i}\]
where $u_0 = \max(0, m₁-n₂), u_1 = \min(n₁,m₁),$ and $u_0 \leq x \leq u_1$
JuliaBUGS.BUGSPrimitives.dmulti
— Functiondmulti(θ::AbstractVector, n)
Returns an instance Multinomial with number of trials n
and success probabilities θ
.
\[P(x|n,θ) = \frac{n!}{∏_{r} x_{r}!} ∏_{r} θ_{r}^{x_{r}}\]