partition_time_bins {Claddis} | R Documentation |
Generates all possible contiguous partitions of N time bins.
partition_time_bins(n_time_bins, partition_sizes_to_include = "all")
n_time_bins |
The number of time bins. |
partition_sizes_to_include |
Either "all" (the default) or a vector of requested partition sizes. |
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.
Returns a list of lists of vectors ready for use in test_rates.
Graeme T. Lloyd graemetlloyd@gmail.com
# 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)