gd {hyperdirichlet} | R Documentation |
Specify a Dirichlet or generalized Dirichlet distribution as a special case of the hyperdirichlet distribution
dirichlet(params, powers, pnames) is.dirichlet(x) dirichlet_params(x) dirichlet_params(x) <- value gd(a, b, b0 = 0, pnames = NULL)
params,powers |
Numeric vectors (supply exactly one) specifying the parameters or the powers respectively of the Dirichlet distribution |
x |
Object of class hyperdirichlet |
value |
Numeric vector |
a,b |
Numeric vectors of the same length specifying the parameters of the generalized Dirichlet distribution |
b0 |
Arbitrary constant for the generalized Dirichlet distribution |
pnames |
Character vector for name of the hyperdirichlet object |
Function dirichlet()
returns the hyperdirichlet distribution
corresponding to the classical Dirichlet distribution. If the vector
params|powers
is a named vector, then the hyperdirichlet object
inherits the names (but the names are ignored if argument
pnames
is supplied).
Function is.dirichlet(x)
returns TRUE
or FALSE
according to whether the hyperdirichlet object x
is a Dirichlet
distribution.
Function dirichlet_params()
returns the Dirichlet parameters of
a hyperdirichlet object.
Function gd()
returns the hyperdicichlet distribution
corresponding to the generalized Dirichlet distribution of Connor and
Mosimann.
For convenience, the generalized Dirchlet distribution described here. Connor and Mosimann 1969 give the PDF as
ommitted...see a LaTeXed file
where p_1+...+p_k=1 and b_0 is arbitrary. If b_{i-1}=a_i+b_i for i=2,...,k-1 then the PDF reduces to a standard Dirichlet distribution with alpha_i=a_i for i=1,...,k-1 and alpha_k=b_{k-1}.
Wong 1998 gives the algebraically equivalent form
ommitted...see a LaTeXed file
for x_1+...+x_k <= 1 and x_j >= 0 for j=1,2,...,k and gamma_j=beta_j-beta_{j+1} for j=1,2,...,k-1 and gamma_k=beta_{k-1}.
Here, B(x,y)=G(x)G(y)/G(x+y) is the beta function.
Functions dirichlet()
and gd()
return a hyperdirichlet
object; function is.dirichlet()
returns a logical; and function
dirichlet_params()
returns a numeric vector.
These functions have cheaply evaluated analytic expressions for the normalizing constant.
If a hyperdirichlet object corresponds to a Dirichlet distribution,
this is relatively easy to detect [using is.dirichlet()
].
However, the corresponding case for the generalized Dirichlet
distribution is not yet coded up, owing to the non-neutrality of the
GD.
Robin K. S. Hankin
a <- dirichlet(1:4 , pnames=letters[1:4]) is.dirichlet(a) # should be TRUE dirichlet(dirichlet_params(a)) # should be 'a' gd(1:5,5:1)