ForestFit (version 0.4)

pmixture: Computing cumulative distribution function of the well-known mixture models

Description

Computes cumulative distribution function (cdf) of the mixture model. The general form for the cdf of the mixture model is given by $$F(x,{\Theta}) = \sum_{j=1}^{K}\omega_j F(x,\theta_j),$$ where \(\Theta=(\theta_1,\dots,\theta_K)^T\), is the whole parameter vector, \(\theta_j\) for \(j=1,\dots,K\) is the parameter space of the \(j\)-th component, i.e. \(\theta_j=(\alpha_j,\beta_j)^{T}\), \(F_j(.,\theta_j)\) is the cdf of the \(j\)-th component, and known constant \(K\) is the number of components. The vector of mixing parameters is given by \(\omega=(\omega_1,\dots,\omega_K)^T\) where \(\omega_j\)s sum to one, i.e., \(\sum_{j=1}^{K}\omega_j=1\). Parameters \(\alpha\) and \(\beta\) are the shape and scale parameters or both are the shape parameters. In the latter case, the parameters \(\alpha\) and \(\beta\) are called the first and second shape parameters, respectively. 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.

Usage

pmixture(x, g, K, param)

Arguments

x

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 \(\omega\), \(\alpha\), \(\beta\), and \(\lambda\).

Value

A vector of the same length as x, giving the cdf of the mixture model computed at x.

Details

For the skew-normal case, \(\alpha\), \(\beta\), and \(\lambda\) are the location, scale, and skewness parameters, respectively.

Examples

Run this code
# NOT RUN {
x<-seq(0,20,0.1)
weight<-c(0.6,0.4)
alpha<-c(1,2)
beta<-c(2,1)
param<-c(weight,alpha,beta)
pmixture(x, "weibull", 2, param)
# }

Run the code above in your browser using DataCamp Workspace