Skip to contents

This function allows us to quickly define an alpha parameter for a Dirichlet distribution with a single (presumably high) peak*scale value at component i and all other components a uniform (presumably low) value (1-peak)/(k-1)*scale.

Usage

peak_alpha(k, i, peak = 0.8, scale = 1)

Arguments

k

Number of components

i

Index for the component that takes value peak

peak

Value for the single peak component

scale

Scaling factor applied to all concentration parameters

Value

Vector of length k

See also

Other generators: draw_corpus(), journal_specific(), rdirichlet()

Examples

peak_alpha(5, 2)
#> [1] 0.05 0.80 0.05 0.05 0.05
peak_alpha(5, 2, peak = 0.9, scale = 10)
#> [1] 0.25 9.00 0.25 0.25 0.25