dnorm_mix: Density of a mixture Gaussian

View source: R/mixG_sampler.R

dnorm_mixR Documentation

Density of a mixture Gaussian

Description

Returns the value of a mixture Gaussian at given point x

Usage

dnorm_mix(x, n_comp, weights, means, sds)

Arguments

x

real value

n_comp

integer number of components of mixture Gaussian

weights

vector: weights of mixture Gaussian

means

vector: means of mixture Gassuan

sds

vector: st.devs of mixture Gaussian

Value

value: value of a mixture Gaussian at given point x

Examples

weights <- c(0.4, 0.6)
means <- c(-3, 6)
sds <- c(1 ,2)
curve(dnorm_mix(x,
                n_comp = n_comp,
                weights = weights,
                means = means,
                sds = sds),
      -10, 15,
      ylim = c(0, 0.2), ylab = 'pdf')


rchan26/hierarchicalFusion documentation built on Sept. 11, 2022, 10:30 p.m.