This function samples the latent v parameter within the Gibbs sampler. Calls on the CumSumInv function written in C++. Not for calling directly by users.

sample.v(z.agg, gamma1, ntsegm, ndata.types, nmaxclust)

## Arguments

z.agg A list of latent cluster estimates provided by sample.z. numeric. Hyperparameter for the truncated stick-breaking prior. numeric. The total number of time segments from all animal IDs. numeric. The number of data streams being analyzed. numeric. A single number indicating the maximum number of clusters to test.

## Value

A matrix with estimates for v for each of the number of time segments and possible states.