spiketools.stats.trials.compare_trial_frs

spiketools.stats.trials.compare_trial_frs(trials1, trials2)[source]

Compare binned firing rates between two sets of trials with independent samples t-tests.

Parameters:
trials1, trials22d array

Precomputed firing rates across bins for two different sets of trials. Arrays should be organized as [n_trials, n_bins].

Returns:
statslist of Ttest_indResult

The statistical results (t-value & p-value) for the t-test, at each bin. Output will have the length of n_bins.

Examples

Compare firing rates between two set of trials with binned firing rates:

>>> trials1 = np.array([[1.2, 1.4, 1.6, 1.0], [1.5, 1.9, 0.3, 1.7], [2.1, 1.5, 2.4, 2.2]])
>>> trials2 = np.array([[4.3, 4.1, 3.9, 4.2], [3.7, 3.4, 3.5, 3.2], [3.9, 4.1, 4.5, 4.7]])
>>> results = compare_trial_frs(trials1, trials2)