This is RJMCMC algorithm that drives the proposal and selection of breakpoints for the data based on the difference in log marginal likelihood. This function is called within behav_gibbs_sampler.

samp_move(breakpt, max.time, dat, alpha, nbins, ndata.types)

Arguments

breakpt

numeric. A vector of breakpoints.

max.time

numeric. The number of of the last observation of dat.

dat

A matrix that only contains columns storing discretized data for each of the movement variables used within get_summary_stats.

alpha

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.

nbins

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.

ndata.types

numeric. The length of nbins.

Value

The breakpoints and log marginal likelihood are retained from the selected model from the Gibbs sampler and returned as elements of a list. This is performed for each iteration of the MCMC algorithm.