partition_time_bins {Claddis}R Documentation

Time bin partitioner

Description

Generates all possible contiguous partitions of N time bins.

Usage

partition_time_bins(n_time_bins, partition_sizes_to_include = "all")

Arguments

n_time_bins

The number of time bins.

partition_sizes_to_include

Either "all" (the default) or a vector of requested partition sizes.

Details

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.

Value

Returns a list of lists of vectors ready for use in test_rates.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples


# 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)

[Package Claddis version 0.6.3 Index]