Tuesday, August 22, 2006
SIE estimation using the CTW algorithm
Mickey London
For more info about SIE and the CTW algorithm see:
This package contains a bunch of Java programs to compute entropies and mutual information between spike trains. The easiest way to start is using matlab, however one can use the code directly via a shell interface. As the package is written in Java it is platform independent and can ran on Mac OS X (tested), Windows XP (tested) and probably on any machine that has Java installed (not tested).
Quick start (matlab):
-
2.Settin matlab to recognize the java code and the matlab functions.
Matlab has a virtually transparent interface with Java classes. This makes it possible to use the Java code as if it is a native matlab code. There is however one necessary step. Matlab should know where the classes are. For that one should edit the file: classpath.txt that is located:
For Mac:
/Applications/MATLAB72/toolbox/local/classpath.txt
Windows (probably)
C:\Program Files\matlab\toolbox\local\classpath.txt
You should add three lines at the bottom of the file (replacing the prefix: /Users/mickey/matlab/CTW/Java with the true location on your system):
/Users/mickey/CTW/Java/mpjava/src
/Users/mickey/CTW/Java
/Users/mickey/CTW/Java/Helpers
3.Restart matlab (This is unfortunately necessary for matlab to reread the classpath.txt file)
4.Add the folder
/Users/mickey/CTW/matlab
to your matlab path (use from matlab desktop File->Set path).
5.Test it: in matlab write:
>> s = [5 23 28 41 50 63 73 77 82 85 88 89 99 103 118 127 130 142 149 155];
>> entropy_ctw(s,0,160,2,10)
ans = 423.6299
Check out the the other functions using:
>>help mutual_information_ctw
and
>> help conditional_entropy_ctw
Non matlab use:
The java classes can be used directly from the shell or from shell script. For that the $CLASSPATH system environment variable should be set to include the three folders mentioned above (the Java folder of the package, the mpjava/src and the Helpers). Note that mac, and unix are using different syntax to define CLASSPATH than windows.
Check out the file
running_from_shell_example.csh
for an example and more details.