Learn R Programming

dsp (version 1.2.0)

ncind: Sample components from a discrete mixture of normals

Description

Sample Z from 1,2,...,k, with P(Z=i) proportional to q_iN(mu_i,sig2_i).

Usage

ncind(y, mu, sig, q)

Value

Sample from {1,...,k}

Arguments

y

vector of data

mu

vector of component means

sig

vector of component standard deviations

q

vector of component weights