dmixinvgamma: The mixture of inverse gamma distributions

View source: R/dmixinvgamma.R

dmixinvgammaR Documentation

The mixture of inverse gamma distributions

Description

Density of a mixture of invserse gamma distributions

Usage

dmixinvgamma(x, w, shape, rate)

Arguments

x

vector of quantiles

w

weights which sum up to one

shape

shape parameter

rate

rate parameter

Examples

n <- c(8000, 4000)
x <- c(rgamma(n[1], shape = 3, rate = 2), rgamma(n[2], shape = 5, rate = 4))
hist(1/x, breaks = 1000, freq = FALSE, xlim = c(0, 4))
x_plot <- seq(0.001, 10, length.out = 1000)
y_plot <- dmixinvgamma(x_plot, w = n/sum(n), shape = c(3, 5), rate = c(2,4))
points(x_plot, y_plot, type = "l")

tobiasmuetze/varmap documentation built on Dec. 8, 2022, 2:16 p.m.