Wednesday, October 18, 2006

Other parameters of distribution

Unlike normal distribution, variance and mean are not the only parameters of all distribution. And as you know K-S is a non-parametric test and works with all distributions. So, if there is a skewness factor in a distribution, it can make difference in a two sample set which they have same mean and variance. look at the below example. two series y1 and y2 are almost same in Variance and Mean (with a little bit more trial and error you can get even better results). the distribution type of these two sample is the same too. t-test can not catch the difference, but ks shows a very significant difference:

clc
x = linspace(-3,6,1000);
y1 = gevpdf(x,-.5,1.2,0);
y2 = gevpdf(x,0,1,0);
meanY1=mean(y1)
meanY2=mean(y2)
varY1=var(y1)
varY2=var(y2)
[h p]=ttest(y1,y2)
[hKs pKs]=kstest2(y1,y2)
plot(x,y1,'-', x,y2,'-');

Sunday, October 08, 2006

Kolmogorov-Smirnov test

I was going to talk about this issue in 3rd session under title of "significant response". But as a brief answer to dear Ali I can say:
Kolmogorov-Smirnov test is a non-parametric test of distribution. If you use a one sample KS test you can find out that is there any significant difference between the data and a specific distribution (eg normal). Two sample KS test can catch the significant distribution difference of two data sets.
It is obvious that any kind of t-test can not catch the significant distribution difference in one or two set of data even though one of its preliminary conditions is the normal distribution of two data sets.
t-test if is used as a test for finding the significant response can only show you the mean firing rate of two window of spike trains are the same or not. And you should be careful. not all form of spike trains can satisfy the preliminary conditions of t-test which is normal distribution of data sets.
So, In terms of significant neural responses, KS test can be used in two ways: one sample KS test can find the significance level of a spike train. It can be used for finding the onset or offset latency, or such a significance crossing thresholds.
Two sample KS test can be used as a measure for comparing a window of response to another one in response or spontaneous activity.
Notice that because KS test examines the distribution is more stringent test and senses the small differences better. the other side of story is that even if the mean and variance of two distribution is the same, it dose not mean that you can nessesarilly get the non-significance difference.
You can use KS test in matlab by kstest for one sample and kstest2 for two sample.
We will work practically on both of these tests.

Significant Reponse

Everybody!
Salaam.
Does anyone have any idea about different response significancy estimation methods. Specifically I want to know how K-S test is done on the neural response data and what are the benefits of K-S compared with t-Test in this case.
Dear all
As I predicted, my question has a simple answer. Ali told me the answer.
I should wrote "reversedFirstTrial(:,:)=spikes1(1,500:-1:1);"
In addition, I should tell Koorosh that I use m.file just to keep my command. I will take your advice.
Yours

a question

Dear All
As Koorosh wanted us to share all the problems we faced, even unimportant problem, I wanna ask you a funny question.
In part 4 of our assignment, we were asked to reverse the results of first trial from 500 to 1 and put them in another array. I did it by using a loop , but I guessed that we could do it without loop. I tried different commands, but all of them were wrong. for example:
reversedFirstTrial(:,:)=spikes1(1,500:1);
Does any one know what's the problem? when I replace the red written part with "1:500" , there is no problem.
Yours

Wednesday, October 04, 2006

Next session readings

We are going to talk about rate estimation in next session. Basic concepts are very simple but you can explore it more deeply. Those who want to have some basic theoretical backgrounds for next session, can read these topics from references mentioned or any where else you can find them easier:

1- Basic concepts of Probability, probability distribution function and Probability Density Function (PDF) from "John E. Freund's Mathematical Statistics" or any statistics reference.

2- Meaning of Delta Dirac function and impulse function from "Signals and systems by Alan V. Oppenheim" or simply look at http://en.wikipedia.org/wiki/Dirac_delta and http://en.wikipedia.org/wiki/Impulse_response_function .

2- Theoretical neuroscience chapter one, from beginning up to tuning curve title.

3- Meaning of convolution in engineering mathematics or http://en.wikipedia.org/wiki/Convolution.

Matlab warm up

I'll send you a file. Please download it. It is a .mat file consisted one variables named spikes1 which is a matrix of 5X500 zeros and ones. It is response of an IT cortex neuron to an image. The image is presented five time for 500 ms. So, the data you have in your hand consisted of 5 trials (rows) and 500 bins of one millisecond (columns). Ones in matrix means existence of one spike, zero means there is not any spike in that time bin.
So, download the files and have fun with exercises. Remember! It is not enough to know how to do the exercises. you should be able to do these in front of your friends in next session. If you have read the chapter 5 of mastering matlab book, these would be a piece of cake for you.


1- Show the first 100 ms of the first trial.
2- Show the last 100 ms of the first trial.
3- Show the window between 100 ms and 200 ms of the third trial.
4- Reverse the order of first trail from 500 to 1 ms and put it in another array.
5- Show the content of bins: 1, 4, 100, 400, 300, 2, 75, 500 in trial one.
6- How many spikes exist in the bins above (use Sum command)?
7- What is the probability of spiking in above bins?
8- Show the contents of even times (2,4,6, ...) in first trial.
9- Show all the spikes fired during the 130 ms bin across all trials.
10- How many spikes exist in 130 ms bin across all trials?
10- what is the probability of spiking during 130 ms bin across all trials?
11- How many spikes exists in a 100 ms window from 120 ms to 220 ms across all trials?
12- What is the probability of spiking in that window?
13- Show the time bins that there was a spike in them in second trial (e.g. [10,20,35,40 ...]).

And ... improvise some exercises until you can do these kind of thing with your spinal cord reflexes!

Thursday, September 28, 2006

Learn more statistics

Hi every body,
I just came up with a web site (http://www2.chass.ncsu.edu/garson/pa765/statnote.htm) that contains a bunch of tutorials on statistics.
I think as the statistics course with Dr. Kazemnejad will start soon and specially as we need much and much statistics in the spike train analysis workshop, it could be a good resource.

Tuesday, September 26, 2006

Dear Koorosh
I became one of your blog members. Ali helped me to solve the problem. This note is just to test my account.
Thanks

Monday, September 25, 2006

New topics

Population coding is not included as a discrete subject, but it will be discussed along the course. Some part of it will be challenged in neural decoding and some part in spike train statistics. But the specific techniques can not be bring forward unless we accomplish all the topics. Temporal coding will be defined in 3rd session of Spike train statistics. Tools which are used in analysing temporal codes are wide range of techniques. some of them like PCA will be challenged here. Some are eventually easy to implement just by looking at related papers, like using information theory to find out temporal patterns.
Both suggestions are great. I think we will add a session or change some topics to these ones to wrap up all we heard about Population coding and Temporal coding during the course.
Ali's suggestion made me think about another part for our course which is article review. It could be a separate session or included within the existing sessions. we can discuss and contribute about how researchers used simple tools and techniques to prove their hypotheses.
Let's start it and then we talk about it.

We need more


استاد
من می خواستم خواهش کنم چند مبحث دیگر رو هم اضافه کنید.
یکی مباحث مربوط به کد جمعی! منظورم همان Population code است.
دویم مباحث مربوط به کد زمانی. منظورم همان Temporal code and spike patterns است.
با سپاس

Sunday, September 24, 2006

Neural structure

تقریبا می توان گفت که ساختارهای استاندارد علمی برای دیتای نورونی وجود ندارد. اکثر ساختارهایی که موجود هستند توسط شرکتهای تجاری ابداع شده اند، مثل نورولینکس یا پلکسون. بعضی از دانشگاهها در حال درست کردن فرمتهای استاندارد دانشگاهی برای نورال دیتا هستند. مثال و تلاش این گروه را در لینک زیر ببین
یک پروژه جدید به نام کارمن هم در حال اتفاق افتادن هست که قراره نه تنها دیتای نورونی، بلکه آنالیز دیتا را نیز به صورتی استاندارد کند که آزمایشگاههای مختلف بتوانند از راه دور دیتای خود را به اشتراک بگذارند. تمرکز این گروه بر روی نرم افزار"متلب" و ابزارهای مربوطه است لینک و کمی توضیحات درباره این پروژه را اینجا پیدا کنید
ولی من به فرمت استاندارد عملی که در حال حاضر بتوان آن را به عنوان یک الگو برای ذخیره و استفاده دیتا استفاده کرد برخورد نکرده ام.

Neural data structure

من می خواستم بدونم ایا یک ساختار پذیرفته شده برای داده های نورنی وجود دارد.
منظورم این است که ایا استانداردی برای متغییر ها یا object هایی که spike data را ذخیره می کنند وجود دارد.
به طور مشخص تر در یک زبان شی گرا ایا کسی استانداردی برای spike data تعریف کرده است؟

Welcome and curriculum

This weblog belongs to "An introduction to Statistical Spike Train Analysis Workshop" which is organized by IPM. Koorosh Mirpour will teach the course and administer this weblog. All announcements, assignment and handouts will be available here. A privilege for writing posts in this weblog will be issued for all members of the class. you are welcome to post your comments, points, ideas or even essays about the class or just spike train analysis here.


This is the curriculum of the course:


An introduction to Statistical Spike train analysis

1- Introduction and terminology
A- Computational neuroscience
Spike train analysis and its trends
Statistical spike train analysis
Modeling neural data
Descriptive approaches
Choosing tools: pros and cons of
SPSS
Modeling tools: neuron, genesis …
Programming languages: C++, C#
Matlab and its toolboxes
B- Encoding and decoding and related terminology
C- Neurophysiological data
D- General scheme and goals of spike train analysis workshop
Practical session: introduction to Matlab

2- Spike statistics (1)
Firing rate estimation
Spike count
Spike average and visualization with PSTH
Linear filter and kernel
Half wave Rectification
Practical session: PSTH and Kernel convolution

3- Spike statistics (2)
A- Tuning curve
Estimation
Calculation of parametric change
B- Estimation of response modulation
Significant response
Calculation of onset response
Poisson neuron
C- Normalization
Practical session: finding the significant response

4- Spike statistics (3)
A- Distributions and Poisson process
B- Temporal coding Vs Rate coding
Practical session: distribution estimation and generating a Poisson spike train

5- Correlation and reverse correlation
A- algebra fundamentals of linear regression and fitting
B- correlation and independency of spike trains
C- cross-correlogram and auto-correlogram
D- spike triggered average and receptive field estimation
Practical session: cross and auto correlogram

6- Neural Decoding
A- Introduction to probability and Bayes theorem
B- Neural discrimination
d-prime

7- Information theory (1)
Introduction and basic concepts

8- Information theory (2)
Calculation of information and bias correction
Practical session: mutual information calculation

9- Representational techniques
Principal component analysis
Multi dimensional scaling (MDS)
Clustering
k-mean clustering
Hierarchical clustering
Practical session: clustering neural responses

10- Mixing all together and examples
Practical session:
Comparing neural responses (t-test, ANOVA, MANOVA)
Finding stimulus selectivity profiles
Neural distance (response similarity measurement)