dist.Laplace.Mixture: Mixture of Laplace Distributions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions provide the density, cumulative, and random generation for the mixture of univariate Laplace distributions with probability p, location mu and scale sigma.

Usage

1
2
3
dlaplacem(x, p, location, scale, log=FALSE)
plaplacem(q, p, location, scale)
rlaplacem(n, p, location, scale)

Arguments

x,q

This is vector of values at which the density will be evaluated.

p

This is a vector of length M of probabilities for M components. The sum of the vector must be one.

n

This is the number of observations, which must be a positive integer that has length 1.

location

This is a vector of length M that is the location parameter mu.

scale

This is a vector of length M that is the scale parameter sigma, which must be positive.

log

Logical. If TRUE, then the logarithm of the density is returned.

Details

A mixture distribution is a probability distribution that is a combination of other probability distributions, and each distribution is called a mixture component, or component. A probability (or weight) exists for each component, and these probabilities sum to one. A mixture distribution (though not these functions here in particular) may contain mixture components in which each component is a different probability distribution. Mixture distributions are very flexible, and are often used to represent a complex distribution with an unknown form. When the number of mixture components is unknown, Bayesian inference is the only sensible approach to estimation.

A Laplace mixture distribution is a combination of Laplace probability distributions.

One of many applications of Laplace mixture distributions is the Laplace Mixture Model (LMM).

Value

dlaplacem gives the density, plaplacem returns the CDF, and rlaplacem generates random deviates.

Author(s)

Statisticat, LLC. software@bayesian-inference.com

See Also

ddirichlet and dlaplace.

Examples

1
2
3
4
5
6
7
8
library(LaplacesDemon)
p <- c(0.3,0.3,0.4)
mu <- c(-5, 1, 5)
sigma <- c(1,2,1)
x <- seq(from=-10, to=10, by=0.1)
plot(x, dlaplacem(x, p, mu, sigma, log=FALSE), type="l") #Density
plot(x, plaplacem(x, p, mu, sigma), type="l") #CDF
plot(density(rlaplacem(10000, p, mu, sigma))) #Random Deviates

Example output



LaplacesDemon documentation built on July 9, 2021, 5:07 p.m.