This function serves as a wrapper for samp_move by running this sampler for each iteration of the MCMC chain. It is called by segment_behavior to run the RJMCMC on all animal IDs simultaneously.

behav_gibbs_sampler(dat, ngibbs, nbins, alpha, breakpt, p)



A data frame that only contains columns for the animal IDs and for each of the discretized movement variables.


numeric. The total number of iterations of the MCMC chain.


numeric. A vector of the number of bins used to discretize each movement variable. These must be in the same order as the columns within dat.


numeric. A single value used to specify the hyperparameter for the prior distribution. A standard value for alpha is typically 1, which corresponds with a vague prior on the Dirichlet distribution.


numeric. A vector of breakpoints if pre-specifying where they may occur, otherwise NULL.


An object storing information from progressr::progessor to produce a progress bar.


A list of the breakpoints, the number of breakpoints, and the log marginal likelihood at each MCMC iteration, as well as the time it took the model to finish running. This is only provided for the data of a single animal ID.