Perievent Histograms
Perievent Histogram shows the conditional probability of a spike at time t0+t
on the condition
that there is a reference event at time t0
. For continuous variables, this analysis calculates event-triggered averages.
Parameters
Parameter |
Description |
---|---|
Reference Type |
Specifies if the analysis will use a single or multiple reference events. |
Reference |
Specifies a reference neuron or event (or a group of reference neurons or events). |
XMin |
Histogram time axis minimum in seconds. |
XMax |
Histogram time axis maximum in seconds |
Bin |
Bin size in seconds. |
Normalization |
Histogram units (Counts/Bin, Probability, Spikes/Second or Z-score). See Algorithm below. |
No Selfcount |
An option not to count reference events if the target event is the same as the reference event (prevents a histogram to have a huge peak at zero when calculating Perievent Histogram versus itself). |
Ignore Ref. with Missing Data |
An option not to use reference events |
Select Data |
If Select Data is From Time Range, only the data from the specified (by Select Data From and Select Data To parameters) time range will be used in analysis. See also Data Selection Options . |
Select Data From |
Start of the time range in seconds. |
Select Data To |
End of the time range in seconds. |
Int. filter type |
Specifies if the analysis will use a single or multiple interval filters. |
Interval filter |
Specifies the interval filter(s) that will be used to preselect data before analysis. See also Data Selection Options. |
Create filter on-the-fly |
Specifies if a temporary interval filter needs to be created (and used to preselect data). |
Create filter around |
Specifies an event that will be used to create a temporary filter. |
Start offset |
Offset (in seconds, relative to the event specified in Create filter around parameter) for the start of interval for the temporary filter. |
End offset |
Offset (in seconds, relative to the event specified in Create filter around parameter) for the end of interval for the temporary filter. |
Fix overlaps |
An option to automatically merge the overlapping intervals in the temporary filter. |
Overlay Graphs |
An option to draw several histograms in each graph. This option requires that Int. filter type specifies that multiple interval filters will be used (either Table (row) or Table (col)). |
Overlay Options |
Specifies line colors and line styles for overlaid graphs. |
Smooth |
Option to smooth the histogram after the calculation. See Post-Processing Options for details. |
Smooth Filter Width |
The width of the smooth filter. See Post-Processing Options for details. |
Draw confidence limits |
An option to draw the confidence limits. |
Confidence (%) |
Confidence level (percent). See Confidence Limits for details. |
Conf. mean calculation |
An option that specifies how the mean firing rate
(that is used in the derivation of the confidence limits) is calculated.
There are 3 options: Use data selection, Use all file and Use pre-ref data.
See Confidence Limits for details.
Note that Use pre-ref data option can only be used for a stimulation type data,
i.e. when the distance between any two consecutive reference events is larger than |
Conf. display |
An option to draw confidence limits either as horizontal lines or as a colored background. |
Conf. line style |
Line style for drawing confidence limits (used when Conf. display is Lines). |
Conf. background color |
Background color for drawing confidence limits (used when Conf. display is Colored Background). |
Draw mean freq. |
An option to draw a horizontal line representing the expected histogram value for a Poisson spike train. See Confidence Limits for details. |
Mean line style |
Line style for drawing mean frequency. |
Draw Cusum |
An option to draw a cumulative sum graph above the histogram. See Cumulative Sum Graphs for details. |
Add to Results / Bin left |
An option to add an additional vector (containing a left edge of each bin) to the matrix of numerical results. |
Add to Results / Bin middle |
An option to add an additional vector (containing a middle point of each bin) to the matrix of numerical results. |
Add to Results / Bin right |
An option to add an additional vector (containing a right edge of each bin) to the matrix of numerical results. |
Background |
An option on how to calculate the histogram background for the peak and through analysis. See Peak and Trough Statistics below. |
Peak width |
Peak width (the number of bins in peak) in the peak and through analysis. See Peak and Trough Statistics below. |
Left shoulder |
Specifies the left shoulder value (in seconds) in the peak and through analysis. See Peak and Trough Statistics below. |
Right shoulder |
Specifies the right shoulder value (in seconds) in the peak and through analysis. See Peak and Trough Statistics below. |
Send to Matlab |
An option to send the matrix of numerical results to Matlab. See also Matlab Options . |
Matrix Name |
Specifies the name of the results matrix in Matlab workspace. |
Matlab command |
Specifies a Matlab command that is executed after the numerical results are sent to Matlab. |
Send to Excel |
An option to send numerical results or summary of numerical results to Excel. See also Excel Options . |
Sheet Name |
The name of the worksheet in Excel where to copy the numerical results. |
TopLeft |
Specifies the Excel cell where the results are copied. Should be in the form CR where C is Excel column name, R is the row number. For example, A1 is the top-left cell in the worksheet. |
Summary of Numerical Results
The following information is available in the Summary of Numerical Results
Column |
Description |
---|---|
Variable |
Variable name. |
Reference |
Reference variable name. |
NumRefEvents |
The number of reference events used in calculation. |
YMin |
Histogram minimum. |
YMax |
Histogram maximum. |
Spikes |
The number of spikes used in calculation. |
Filter Length |
The length of all the intervals of the interval filter (if a filter was used) or the length or the recording session (in seconds). |
Mean Freq. |
Mean firing rate (Spikes/Filter_Length). |
Mean Hist. |
The mean of the histogram bin values. |
St. Dev. Hist. |
The standard deviation of the histogram bin values. |
St. Err. Mean. Hist. |
The standard error of mean of the histogram bin values. |
Conf. Low |
Lower confidence level. |
Conf. High |
Upper confidence level. |
Mean |
Expected mean value of the histogram. If Z-score normalization is specified, this value is zero and the expected mean value of the histogram with Counts/Bin normalization is shown in Z-score Mean. |
Norm. Factor |
Normalization factor. Bin counts are divided by this value. See Normalization in Algorithm below. |
Z-score mean |
Expected mean value of the histogram before Z-score normalization (in other words, confidence mean). See Confidence Limits for details . |
Mean Before Ref. |
Mean of the histogram before the reference event (i.e. for all the bins before zero on time axis). |
Bins Before Ref. |
The number of bins before the bin that contains zero on time axis. |
Zero Bin |
The index of the bin that contains zero on time axis. |
Background Mean |
The mean of the histogram background for the peak and trough analysis. See Peak and Through Statistics below. |
Background Stdev |
The standard deviation of the histogram background for the peak and trough analysis. See Peak and Trough Statistics below. |
Peak Z-score |
Peak Z-score. See Peak and Trough Statistics below. |
Peak/Mean |
Histogram peak value divided by the background mean value. |
Peak Position |
Peak position (in seconds). |
Peak Half Height |
The Y value of the half height of the peak, i.e. |
Peak Width at Half Height |
Peak width at the peak half height level (in seconds). |
Trough Z-score |
Trough Z-score. See Peak and Trough Statistics below. |
Trough/Mean |
Histogram trough value divided by the background mean value. |
Trough Position |
Trough position (in seconds). |
Trough Half Height |
The Y value of the half height of the trough, i.e. |
Trough Width at Half Height |
Trough width at the trough half height level (in seconds). |
Algorithm
Neurons and Events
Perievent Histogram shows the conditional probability of a spike at time t0+t
on the condition that there is a reference event at time t0
.
The time axis is divided into bins. The first bin is [XMin, XMin+Bin)
. The second bin is [XMin+Bin, XMin+Bin*2)
, etc.
The left end is included in each bin, the right end is excluded from the bin.
Let ref[i]
be the array of timestamps of the reference event, ts[i]
be the spike train (each ts is the timestamp).
For each timestamp ref[k]
:
calculate the distances from this event (or spike) to all the spikes in the spike train:
d[i] = ts[i] - ref[k]
for each
i
:
if d[i]
is inside the first bin, increment the bin counter for the first bin:
if d[i] >= XMin and d[i] < XMin + Bin
then bincount[1] = bincount[1] +1
if d[i]
is inside the second bin, increment the bin counter for the second bin:
if d[i] >= XMin+Bin and d[i] < XMin + Bin*2
then bincount[2] = bincount[2] +1
and so on… .
If Normalization is Counts/Bin, no further calculations are performed.
If Normalization is Probability, bin counts are divided by the number of reference events.
Note that the Probability normalization makes sense only for small values of Bin.
For Probability normalization to be valid (so that the values of probability are between 0 and 1),
there should be no more than one spike in each bin.
For example, if the Bin value is large and for each ref[k]
above there are many d[i]
values such
that d[i] >= XMin and d[i] < XMin + Bin
, the bin count for the first bin can exceed
the number of reference events. Then, the probability value (bincount[1]/number_of_reference_events)
could be larger than 1.
If Normalization is Spikes/Sec, bin counts are divided by NumRefEvents*Bin
, where NumRefEvents is the number of reference events.
If Normalization is Z-score, bin_value = (bin_count - Confidence_mean)/sqrt(Confidence_mean)
,
where Confidence_mean
is the expected mean bin count calculated according to Conf. mean calculation parameter.
Please note that bin counts are assumed to have Poisson distribution.
Therefore, the standard deviation is equal to square root of expected mean and Z-score
can be considered to have Normal distribution only for large values (more than 10) of the Confidence_mean
.
Continuous Variables
For a continuous variable, the mean of the variable values is calculated for each bin around reference event. These mean values are then averaged across all the timestamps of the reference event.
Peak and Trough Statistics
NeuroExplorer calculates histogram peak statistics the following way:
Maximum of the histogram is found
If the histogram contains several maxima with the same value, peak statistics are not calculated
Otherwise, the center of the bin, where the histogram reaches maximum, is shown as Peak Position in the Summary of Numerical results
The mean
M
and standard deviationS
of the bin values of the histogram background are calculated:If Background parameter is set as Bins outside peak/trough, bins outside peak and trough (i.e., bins that are more than PeakWidth/2 away from the bin with the histogram maximum and the bin with the histogram minimum) are used to calculate
M
andS
If Background parameter is set as Shoulders, bins that are to the left of the Left Shoulder or to the right of Right Shoulder parameters are used to calculate
M
andS
The value
M
(mean of the background bin values) is shown as Background Mean in the Summary of Numerical resultsThe value
S
(standard deviation of the background bin values) is shown as Background Stdev in the Summary of Numerical resultsThe value
(HistogramMaximum - M)/S
is shown as Peak Z-scoreThe value
(HistogramMaximum + M)/2
is shown as Peak Half HeightHistogram intersects a horizontal line drawn at Peak Half Height at time points
TLeft
andTRight
.(TRight - TLeft)
is shown as Peak Width
Histogram trough statistics are calculated in a similar way. The only difference is that histogram minimum instead of histogram maximum is analyzed.