Shift-Predictor for Crosscorrelograms
Shift-predictor is defined for a series of trials - you take the spikes of one neuron in trial 1 and correlate them with the spikes of another neuron in trial 2, etc.
These “trials” are represented in NeuroExplorer as time intervals, i.e. pairs of numbers:
start of interval 1, end of interval 1
start of interval 2, end of interval 2, etc.
To use the shift-predictor, you need to create those “trials” first.
You need an external event that is fired at the beginning of each trial. Suppose Event03 is the event that happens at the beginning of each trial and each trial lasts 20 seconds.
To create the trial intervals:
select Edit | Operations on Variables menu command
in the operations list, select MakeIntervals
in the First Operand, select the external event Event03
set Shift Min to 0. and Shift Max to 20.0
in the New Var Name, type: Trials
press Run the Operation button
close the dialog.
Now, select Crosscorrelograms analysis, go to Data Selection and Shift-Predictor tab, select Trials as an interval filter and specify other shift-predictor parameters.
Classic Shift-Predictor Algorithm
Suppose we have n trial intervals:
[trial_1_start, trial_1_end], [trial_2_start, trial_2_end], ..., [trial_n_start, trial_n_end]
and we have 2 spike trains:
reference spike train with N timestamps r1, r2, ... , rN
;
and target spike train with M timestamps s1, s2, ... , sM
.
Shift-predictor for shift = 1 is calculated like this:
Step 1: find all the timestamps ri
that are inside the first trial interval [trial_1_start, trial_1_end]
Step 2: find all the timestamps sj
that are inside the second trial interval [trial_2_start, trial_2_end]
Step 3: shift all the timestamps ri
so that they align with the second trial:
calculate new timestamps pi = ri + (trial_2_start - trial_1_start)
Step 4: calculate a crosscorrelogram between pi
and sj
Repeat Steps 1 through 4 with interval [trial_2_start, trial_2_end]
in Step 1 and interval [trial_3_start, trial_3_end]
in Step 2.
…
Repeat Steps 1 through 4 with interval [trial_n_start, trial_n_end]
in Step 1 and interval [trial_1_start, trial_1_end]
in Step 2.
Note that we wrap around the trials: the last trial is correlated with the first one.
Then, calculate shift-predictors for shift = 2:
Repeat Steps 1 through 4 with interval [trial_1_start, trial_1_end]
in Step 1 and interval [trial_3_start, trial_3_end]
in Step 2.
That is, shift trials by 2.
…
And, finally, calculate shift-predictors for shift = Number_of_shifts
specified in the shift-predictor options.
Shift-Predictor With Random Shuffle
When using random shuffle, for each shift, we shuffle the trial numbers.
That is, we take trial numbers array tn = [1, 2, 3, ..., n]
and randomly shuffle this array.
If randomly shuffled array is tn_shuffled
, we correlate trial i
with the trial tn_shuffled[i]
.
More on Time Intervals
These time intervals can be used in other analyses in NeuroExplorer to analyze spikes only from those intervals.
For example, you may have a pre-drug period in the experiment (say, from 0 to 600 seconds) and want to analyze the spikes from this pre-drug time period.
To do this, you create a new interval variable (let’s call it PreDrug
)
that contains only one interval [0., 600.].
To create a new interval variable, select Edit | Add Interval Variable… menu command.
Then you can calculate, for example, the autocorrelograms for the spikes
in the pre-drug period by specifying PreDrug
as an interval filter
in the Data Selection page of the Autocorrelogram parameters dialog.