# correlospinmatrix_detector – Device for measuring the covariance matrix from several inputs¶

## Description¶

The `correlospinmatrix_detector`

is a device that receives input from several
binary neuron sources and calculates the raw auto and cross correlation binned
to bins of duration delta_tau, which defaults to the simulation resolution.

The result can be obtained from the node’s status dictionary under the key
`count_covariance`

in the format of a tensor of rank 3 of size
`N_channels`

x `N_channels`

, with each entry \(C_{ij}\) being a vector
of size \(2\cdot\tau_{max}/\delta_{\tau} + 1\) containing the histogram for
the different time lags.

The bins are centered around the time difference they represent, and are left-closed and right-open in the lower triangular part of the matrix. On the diagonal and in the upper triangular part the intervals are left-open and right-closed. This ensures proper counting of events at the border of bins.

The `correlospinmatrix_detector`

has a variable number of inputs which can be
set via SetStatus under the key N_channels. All incoming connections to a
specified receptor will be pooled.

Setting either N_channels, Tstart, Tstop, tau_max or delta_tau clears count_covariance.

Correlospinmatrix detectors ignore any connection delays.

See Correlospinmatrix detector example for a script reproducing a setting studied in Fig 1 of Grinzburg & Sompolinsky (1994) PRE 50(4) p. 3171.

## Parameters¶

Tstart |
real |
Time when to start counting events. This time should be set to at least start + tau_max in order to avoid edge effects of the correlation counts. |

Tstop |
real |
Time when to stop counting events. This time should be set to at most Tsim - tau_max, where Tsim is the duration of simulation, in order to avoid edge effects of the correlation counts. |

delta_tau |
ms |
Bin width. This has to be an odd multiple of the resolution, to allow the symmetry between positive and negative time-lags. Defaults to the simulation resolution. |

tau_max |
ms |
One-sided width. In the lower triagnular part events with differences in [0, tau_max+delta_tau/2) are counted. On the diagonal and in the upper triangular part events with differences in (0, tau_max+delta_tau/2]. Defaults to 10 times the value of delta_tau. |

N_channels |
integer |
The number of pools. This defines the range of receptor_type. Default is 1. Setting N_channels clears count_covariance, covariance and n_events. |

covariance |
3D matrix of integers |
matrix of read-only -raw, weighted, auto/cross correlation |

count_covariance |
3D matrix of integers |
matrix of read-only -raw, auto/cross correlation counts |

## Receives¶

SpikeEvent

## See also¶

Device, Detector