# Cumulant Based Inference of higher-order Correlation (CuBIC)¶

CuBIC is a statistical method for the detection of higher order of correlations in parallel spike trains based on the analysis of the cumulants of the population count.

 `cubic`(histogram[, max_iterations, alpha]) Performs the CuBIC analysis [cubic1] on a population histogram, calculated from a population of spiking neurons.

## Examples¶

Homogeneous Poisson random spike trains population count histogram third cumulant is explained by the first correlation order (xi=1).

Given a list of spike trains, the analysis comprises the following steps:

1. compute the population histogram (PSTH) with the desired bin size
```>>> import numpy as np
>>> import quantities as pq
>>> from elephant import statistics
>>> from elephant.cubic import cubic
>>> from elephant.spike_train_generation import homogeneous_poisson_process
```
```>>> np.random.seed(10)
>>> spiketrains = [homogeneous_poisson_process(rate=10*pq.Hz,
...                t_stop=10 * pq.s) for _ in range(20)]
>>> pop_count = statistics.time_histogram(spiketrains, bin_size=0.1 * pq.s)
```
1. apply CuBIC to the population count
```>>> xi, p_val, kappa, test_aborted = cubic(pop_count, alpha=0.05)
>>> xi
1
>>> p_val
[0.43014065113883904]
>>> kappa
[20.1, 22.656565656565657, 27.674706246134818]
```

## References¶

 [cubic1] Benjamin Staude, Stefan Rotter, and Sonja Grün. Cubic: cumulant based inference of higher-order correlations in massively parallel spike trains. Journal of computational neuroscience, 29(1-2):327–350, 2010.