fitDirichlet | R Documentation |
Takes elicited beta distributions for a set of proportions as inputs, and fits a Dirichlet distribution. The beta parameters are adjusted so that the expectations sum to 1, and then the sum of the Dirichlet parameters is chosen based on the sums of the beta parameters for each elicited marginal
fitDirichlet(
...,
categories = NULL,
n.fitted = "opt",
plotBeta = TRUE,
xlab = "x",
ylab = expression(f[X](x)),
fs = 12,
silent = FALSE
)
... |
Multiple arguments, each an objects of class |
categories |
A vector of strings labelling the marginal proportions. |
n.fitted |
The method used to determine the sum of the Dirichlet parameters.
Use |
plotBeta |
logical. Plot the original elicited marginals and the fitted marginals from the Dirichlet fit. |
xlab |
x-axis label on the marginal distribution plot. |
ylab |
y-axis label on the marginal distribution plot. |
fs |
The font size used in the plot. |
silent |
Set to |
The parameters of the fitted Dirichlet distribution.
Jeremy Oakley <j.oakley@sheffield.ac.uk>
Zapata-Vazquez, R., O'Hagan, A. and Bastos, L. S. (2014). Eliciting expert judgements about a set of proportions. Journal of Applied Statistics 41, 1919-1933.
## Not run:
p1 <- c(0.25, 0.5, 0.75)
v1 <- c(0.5, 0.55, 0.6)
v2 <- c(0.22, 0.3, 0.35)
v3 <- c(0.11, 0.15, 0.2)
myfit1 <- fitdist(v1, p1, 0, 1)
myfit2 <- fitdist(v2, p1, 0, 1)
myfit3 <- fitdist(v3, p1, 0, 1)
d <- fitDirichlet(myfit1, myfit2, myfit3,
categories = c("A","B","C"),
n.fitted = "opt")
# Note that this will also work:
d <- fitDirichlet(list(myfit1, myfit2, myfit3),
categories = c("A","B","C"),
n.fitted = "opt")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.