Draw samples from a mixture of beta distributions
Source:R/draw_beta_mixture_nsamples.R
draw_beta_mixture_nsamples.Rd
Draws samples from a mixture of beta distributions, representing pooled weights on the informative component of a robust MAP prior, as elicited from experts via the roulette method.
Arguments
- n
Numeric value, the number of samples to be drawn.
- chips_mult
Numeric matrix, containing expert weighting (distributions of chips). Rows should represent experts, columns should represent bins / weight intervals.
- expert_weight
An optional numeric vector, containing the weight assigned to each expert (defaults to equal weights).
Examples
rweights <- draw_beta_mixture_nsamples(
n = 50,
chips_mult = rbind(
c(0, 0, 0, 0, 2, 3, 3, 2, 0, 0),
c(0, 0, 0, 1, 2, 4, 2, 1, 0, 0),
c(0, 0, 0, 2, 2, 2, 2, 2, 0, 0)
),
expert_weight = rep(1/3, 3)
)
print(rweights)
#> [1] 0.4243928 0.5498048 0.4918916 0.7744934 0.7137185 0.5836281 0.4913563
#> [8] 0.7506148 0.5293990 0.6127620 0.5815233 0.7160604 0.5979464 0.7921829
#> [15] 0.6348309 0.6635602 0.3876065 0.7903163 0.6762363 0.4973310 0.5831477
#> [22] 0.5655109 0.5595717 0.5873689 0.6363246 0.6729343 0.2568384 0.4936960
#> [29] 0.7320045 0.5169612 0.3450098 0.3682687 0.6989731 0.5949805 0.3443787
#> [36] 0.6452364 0.4769270 0.6778592 0.6861949 0.7491482 0.4966892 0.5797463
#> [43] 0.6877419 0.5587470 0.8221712 0.4835888 0.6993229 0.5278978 0.3578456
#> [50] 0.4323872
if (FALSE) {
hist(rweights)
}