Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mixdist

Creates an Object Representing Mixture Distribution


Description

mixdist creates an object which represents the mixture distribution.

Usage

mixdist(..., weights)

## S3 method for class 'dist'
mixdist(..., weights)

## Default S3 method:
mixdist(dist, params, weights, ...)

Arguments

...

distribution objects.

weights

vector of weights for the components.

dist

vector of distribution names.

params

list of parameters for each component.

Details

A CDF of a mixture distribution function is

F(A)=∑ w_{i}F_{i}(A)

, where w_{i} is the weight of the i-th component and F_{i}() is the CDF of the i-th component.

The objects can be specified in two ways, either the user may enter distribution objects or a vector of names and list of parameters. See the examples below.

Value

Object of class mixdist.

See Also

Examples

# using the objects
M <- mixdist(normdist(1, 3), expdist(4), weights = c(0.7, 0.3))
M

# using the names and parameters
M2 <- mixdist(c("norm", "exp"), list(c(mean = 1, sd = 3), c(rate = 4)),
              weights = c(0.7, 0.3))
M2

mistr

Mixture and Composite Distributions

v0.0.4
GPL-3
Authors
Lukas Sablica [aut, cre] (<https://orcid.org/0000-0001-9166-4563>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.