Learn R Programming

bda (version 1.1.1-7)

pmixnorm: The mixed normal distribution

Description

Density, distribution function, quantile function and random generation for the normal mixture distribution with means equal to 'mu' and standard deviations equal to 's'.

Usage

dmixnorm(x,p,mu,s,na.rm=TRUE,pobj=NULL)
	pmixnorm(x,p,mu,s,na.rm=TRUE,pobj=NULL)
	qmixnorm(x,p,mu,s,na.rm=TRUE,pobj=NULL)
	rmixnorm(n,p,mu,s,pobj=NULL)

Arguments

x
vector of quantiles in dmixnorm and pmixnorm. In qmixnorm, 'x' is a vector of probabilities.
p
proportions of the mixture components.
n
number of observations. If 'length(n) > 1', the length is taken to be the number required.
mu
vector of means
s
vector of standard deviations
na.rm
Default "TRUE". Automatically remove missing values. Otherwise, stop and warn.
pobj
The parameters can also be passed to the function through an R objective 'pobj', which can be generated from some other algorithms.

See Also

bfmm.

Examples

Run this code
p = c(.4,.6)
mu = c(1,4)
s=c(2,3)
dmixnorm(c(0,1,2,20),p,mu,s)
pmixnorm(c(0,1,2,20),p,mu,s)
qmixnorm(c(0,1,.2,.20),p,mu,s)
rmixnorm(3,p,mu,s)

Run the code above in your browser using DataLab