Cumulative distribution function of normal mixture

pnormix(x, lambda, mu, sigma, lower.tail = TRUE, log.p = FALSE)

Arguments

x

`numeric` Vector of values at which to evaluate the (log, complementary) cdf.

lambda

`numeric` - Vector of mixing proportions of each normal component

mu

`numeric` - Vector of means of each normal component

sigma

`numeric` - Vector of standard deviations of each normal component

lower.tail

`logical` - if TRUE (default), probabilities are `P[X ≤ x]` otherwise, `P[X > x]`.

log.p

`logical`; if TRUE, probabilities p are given as `log(p)`.

Value

`numeric` Vector of (log) probabilities.

Examples

pnormix(-5:5, c(0.7, 0.3), c(0, 3), c(1, 1))
#>  [1] 2.006561e-07 2.216987e-05 9.449289e-04 1.592518e-02 1.110682e-01
#>  [6] 3.504050e-01 5.957664e-01 7.316715e-01 8.490551e-01 9.523813e-01
#> [11] 9.931748e-01