ncind: Sample components from a discrete mixture of normals

View source: R/helper_functions.R

ncindR Documentation

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)

Arguments

y

vector of data

mu

vector of component means

sig

vector of component standard deviations

q

vector of component weights

Value

Sample from {1,...,k}


dsp documentation built on Aug. 21, 2025, 5:29 p.m.