chronux tutorial: part ii locfit keith purpura weill cornell medical college bijan pesaran center...

22
Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific Corporation

Upload: mildred-barton

Post on 17-Dec-2015

244 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Chronux Tutorial: Part IILOCFIT

Keith PurpuraWeill Cornell Medical College

Bijan PesaranCenter for Neural Science, NYU

Hemant BokilBoston Scientific Corporation

Page 2: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Spectra, Coherences etc

Local regression and likelihood

Fourier transforms using multiple tapers: mtfftc.m

Spectrum: mtspectrumc.m

Spectrogram: mtspecgramc.mCoherogram:mtcohgramc.m

Coherency:mtcoherencyc.m

Regression and likelihood: locfit.m

Plotting the fit: lfplot.mPlotting local confidence bands: lfband.m

Plotting global confidence bands: scb.m

Page 3: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Chronux data format Continuous/binned point process data

matrices with dimension time x channels/trials

e.g. 1000 x 10 dimensional matrix

interpreted as 1000 samples

10 channels/trials

Spikes times

struct array with dimension = number of channels/trials

e.g. data(1).times=[0.3 0.35 0.42 0.6]

data(2).times=[0.2 0.22 0.35]

2 spike trains with 4 and 3 spikes

Page 4: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Important parameter in mulitple Chronux functions

params: structure with multiple fields

Fs: sampling frequency (slightly different interpretation for spike times

tapers: controls the number of tapers

pad: controls the padding

fpass: frequency range of interest

err: controls error computation

trialave: controls whether or not to average over trials

Page 5: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Example II: Spike rates, spectra and coherence (from earlier lecture)

• Simultaneous two-cell recording from Macaque area LIP – dataset DynNeuroLIP.mat

Reach and

Saccade Task

DelayCueReach andSaccade

Pesaran et al (2008)

DelayCue

Page 6: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Example II

3 local field potentials (LFP) and 2 single units, LFP sampled at 1 kHz

Trial: 3 seconds of data for 9 trials to one of the directions: 1 s (Baseline), 2 s (Delay + post movement)

Baseline: 1 second of data for 74 trials (pooled across all directions)

Page 7: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

TasksCompute the following for the Memory trials

Spike rates

LFP and spike spectra

Spike-field coherence

Spike-Spike coherence

Compare spike-spike coherence during the memory period and the baseline period.

Page 8: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

The main script for this tutorial

lip_master_script2.m

Calls other scripts to run through the various analyses

Page 9: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 10: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 11: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 12: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 13: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 14: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

>> fit=locfit(data,'family','rate');>> lfplot(fit); >> lfband(fit);

Spike rate: 1 trial

Basic locfit usage (rate estimate)

Regression

>> fit=locfit(x,y);

Density estimate:replace 'rate‘ by ‘dens’

Page 15: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 16: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 17: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

>> fit=locfit(data,'family','rate‘,’nn’,0.3);>> lfplot(fit); >> lfband(fit);

Setting the bandwidth –fixed (h), nearest neighbor (nn)

h: fixed/absolutebandwidth e.g. h=1is interpreted as 1 s if data is in seconds

nn: fixed fraction of the total number of points e.g. nn=0.3 takes the 30% closest points to a given point

Default: nn=0.7, h=0

Page 18: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 19: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Multiple trials

pool the spikes and compute fitrescale fits and confidence intervals

Page 20: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific
Page 21: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Electrophysiology Analysis Protocol

Page 22: Chronux Tutorial: Part II LOCFIT Keith Purpura Weill Cornell Medical College Bijan Pesaran Center for Neural Science, NYU Hemant Bokil Boston Scientific

Electrophysiolgy: Data Conditioning