dmixture | R Documentation |
Computes probability density function (pdf) of the mixture model. The general form for the pdf of the mixture model is given by
f(x,{Θ}) = ∑_{j=1}^{K}ω_j f_j(x,θ_j),
where Θ=(θ_1,…,θ_K)^T, is the whole parameter vector, θ_j for j=1,…,K is the parameter space of the j-th component, i.e. θ_j=(α_j,β_j)^{T}, f_j(.,θ_j) is the pdf of the j-th component, and known constant K is the number of components. The vector of mixing parameters is given by ω=(ω_1,…,ω_K)^T where ω_js sum to one, i.e., ∑_{j=1}^{K}ω_j=1. Parameters α_j and β_j are the shape and scale parameters of the j-th component or both are the shape parameters. In the latter case, the parameters α and β are called the first and second shape parameters, respectively. We note that the constants ω_js sum to one, i.e. ∑_{j=1}^{K}ω_j=1. The families considered for each component include Birnbaum-Saunders, Burr type XII, Chen, F, Frechet, Gamma, Gompertz, Log-normal, Log-logistic, Lomax, skew-normal, and Weibull with pdf given by the following.
Birnbaum-Saunders
f(x,θ)=\frac{√{\frac{x}{β}}+√{\frac{β}{x}}}{2α x}φ \Biggl( \frac{√{\frac{x}{β}}-√{\frac{β}{x}}}{α}\Biggr),
Burr XII
f(x,θ)=α β x^{α-1} \Bigl(1+x^{α}\Bigr)^{-β-1},
Chen
f(x,θ)=α β x^{α}\exp\bigl(x^α\bigr) \exp\Bigl\{-β \exp\bigl(x^α\bigr)+β\Bigr\},
F
f(x,θ)=\frac{Γ\Bigl(\frac{α+β}{2}\Bigl)}{Γ\bigl(\frac{α}{2}\bigl) Γ\bigl(\frac{β}{2}\bigl)}\Bigl( \frac{α}{β}\Bigl)^{\frac{α}{2}} x^{\frac{α}{2}-1}\Big(1+\frac{α}{β}x\Big)^{-\frac{α+β}{2}},
Frechet
f(x,θ)=\frac{α}{ β} \Bigl( \frac {x}{β}\Bigr) ^{-α-1}\exp\Bigl\{ -\Bigl( \frac {x}{β}\Bigr)^{-α} \Bigr\},
gamma
f(x,θ)=\bigl[ β^α Γ(α)\bigr]^{-1} x^{α-1} \exp\Bigl( -\frac {x}{β}\Bigr),
Gompertz
f(x,θ)=β\exp\bigl(α x\bigr) \exp\Biggl\{\frac{β \exp\bigl(α x\bigr)-1}{α} \Biggr\},
log-logistic
f(x,θ)=\frac{ α}{ β^{α}} x^{α-1} ≤ft[ \Bigl( \frac {x}{β}\Bigr)^α +1\right]^{-2},
log-normal
f(x,θ)=\bigl(√{2π} β x \bigr)^{-1}\exp\biggl\{ -\frac {1}{2}≤ft( \frac {\log x-α}{β}\right) ^2\biggr\},
Lomax
f(x,θ)=\frac{α β}{(1+α x)^{β+1}},
skew-normal
f(x,θ)=2φ\Bigl(\frac{x-α}{β}\Bigr)Φ\Bigl(λ\frac{x-α}{β}\Bigr),
Weibull
f(x,θ)=\frac {α}{β} \Bigl( \frac {x}{β} \Bigr)^{α - 1}\exp\Bigl\{ -\Bigl( \frac {x}{β}\Bigr)^α \Bigr\},
where θ=(α,β). In the skew-normal case, φ(.) and Φ(.) are the density and distribution functions of the standard normal distribution, respectively.
dmixture(data, g, K, param)
data |
Vector of observations. |
g |
Name of the family including " |
K |
Number of components. |
param |
Vector of the ω, α, β, and λ. |
For the skew-normal case, α, β, and λ are the location, scale, and skewness parameters, respectively.
A vector of the same length as data
, giving the pdf of the mixture model of families computed at data
.
Mahdi Teimouri
data<-seq(0,20,0.1) K<-2 weight<-c(0.6,0.4) alpha<-c(1,2) beta<-c(2,1) param<-c(weight,alpha,beta) dmixture(data, "weibull", K, param)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.