This function is designed for use with the test_rates function and generates all possible contiguous partitions of N time bins. This allows use of an information criterion like AIC to pick a "best" partition, weighing fit and partition number simultaneously.
You can also ask for only partitions of a specific number using the partition_sizes_to_include option. For example, partition_sizes_to_include = c(1, 2, 3) will only return partitions of 1, 2, or 3 sets of elements.
# Get all partitions for four time bins:partition_time_bins(n_time_bins = 4)
# Get all partitions for five time bins of size 2:partition_time_bins(n_time_bins = 5, partition_sizes_to_include = 2)