Skip to contents

Simulate a variable from a Gaussian mixture.

Usage

rnormStateValueMembership(n, stateVal, statePrec, stateProb)

Arguments

n

An integer scalar containing the number of variables to simulate (NIMBLE currently only allows n = 1)

stateVal

A numeric vector containing the mean values of mixture components

statePrec

A numeric vector containing the precision (reciprocal of the variance) of the mixture components

stateProb

A numeric vector containing the probabilities of belonging to each mixture component (internally normalised to one)

Value

A scalar containing the simulated response variable

Author

Joseph D. Chipperfield, joechip90@googlemail.com