Internal function. sample from the mixture distribution *q_{α}*

1 2 | ```
do.mixture.sample(seed, b, n, J, mixture.param, alpha, fname, rpname, rqname,
dpname, dqname)
``` |

`seed` |
seed for sampling |

`b` |
batch index for the samples |

`n` |
total number of samples |

`J` |
number of mixture components, including the defensive one |

`mixture.param` |
mixture.param = list(p, J, ...), where |

`alpha` |
vector of mixture proportions |

`fname` |
name of user defined function |

`rpname` |
name of user definded function |

`rqname` |
name of user defined function |

`dpname` |
name of user defined function |

`dqname` |
name of user defined function |

a list of

- x
the matrix(size

*n \times p*) of samples from the mixture distribution*q_{α}*- fx
the vector of

*fname*evaluated at sample matrix*x*- qx
the matrix of densities under each mixture component, i.e.

*qx[,j]*is the density under*q_j*. The defensive component is the*J^{th}*column- px
the vector of densities under proposal distribution

*pname*- alpha
the rounded

*alpha*used for sampling, i.e.*alpha2N(n, alpha)/n*

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.