Learn R Programming

NPflow (version 0.10.1)

sampleClassC: C++ implementation of the multinomial sampling from a matrix of column vectors, each containing the sampling probabilities for their respective draw

Description

C++ implementation of the multinomial sampling from a matrix of column vectors, each containing the sampling probabilities for their respective draw

Usage

sampleClassC(probMat)

Arguments

probMat
a numeric matrix of dim k x n of containing column vectors of sampling probabilities for each class k.

Value

a vector of integer of length n containing the multinomial draws for each observation, i.e. the class allocation.