dmixture: Computing probability density function of the well-known...

Description Usage Arguments Details Value Author(s) Examples

View source: R/ForestFit.R

Description

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.

where θ=(α,β). In the skew-normal case, φ(.) and Φ(.) are the density and distribution functions of the standard normal distribution, respectively.

Usage

1
dmixture(data, g, K, param)

Arguments

data

Vector of observations.

g

Name of the family including "birnbaum-saunders", "burrxii", "chen", "f", "Frechet", "gamma", "gompetrz", "log-normal", "log-logistic", "lomax", "skew-normal", and "weibull".

K

Number of components.

param

Vector of the ω, α, β, and λ.

Details

For the skew-normal case, α, β, and λ are the location, scale, and skewness parameters, respectively.

Value

A vector of the same length as data, giving the pdf of the mixture model of families computed at data.

Author(s)

Mahdi Teimouri

Examples

1
2
3
4
5
6
7
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)

ForestFit documentation built on Feb. 6, 2021, 5:05 p.m.