[pointprocesses] finished solution of first exercise
This commit is contained in:
parent
2589acd4f5
commit
73c6d35536
@ -1,9 +1,9 @@
|
||||
spikes{1} = poissonspikes;
|
||||
spikes{2} = pifouspikes;
|
||||
spikes{3} = lifadaptspikes;
|
||||
idents = {'poisson', 'pifou', 'lifadapt'};
|
||||
titles = {'poisson', 'pifou', 'lifadapt'};
|
||||
for k = 1:3
|
||||
figure(k)
|
||||
fanoplot(spikes{k}, titles{k});
|
||||
savefigpdf(gcf, sprintf('fanoplots%s.pdf', idents{k}), 20, 7);
|
||||
savefigpdf(gcf, sprintf('fanoplots%s.pdf', titles{k}), 20, 7);
|
||||
end
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,19 +1,20 @@
|
||||
maxisi = 300.0;
|
||||
subplot(1, 3, 1);
|
||||
dt = 0.005; % bin width for ISIH in seconds
|
||||
poissonisis = isis(poissonspikes);
|
||||
plotisihist(poissonisis, 0.001);
|
||||
plotisihist(poissonisis, dt);
|
||||
xlim([0, maxisi])
|
||||
title('Poisson');
|
||||
|
||||
subplot(1, 3, 2);
|
||||
pifouisis = isis(pifouspikes);
|
||||
plotisihist(pifouisis, 0.001);
|
||||
plotisihist(pifouisis, dt);
|
||||
xlim([0, maxisi])
|
||||
title('PIF OU');
|
||||
|
||||
subplot(1, 3, 3);
|
||||
lifadaptisis = isis(lifadaptspikes);
|
||||
plotisihist(lifadaptisis, 0.001);
|
||||
plotisihist(lifadaptisis, dt);
|
||||
xlim([0, maxisi])
|
||||
title('LIF adapt');
|
||||
savefigpdf(gcf, 'isihist.pdf', 20, 7);
|
||||
|
@ -1,12 +1,13 @@
|
||||
maxisi = 300.0;
|
||||
dt = 0.005;
|
||||
poissonisis = isis(poissonspikes);
|
||||
rate = 1.0/mean(poissonisis);
|
||||
plotisihist(poissonisis, 0.001);
|
||||
plotisihist(poissonisis, dt);
|
||||
tt = linspace(0.0, 0.001*maxisi, 200);
|
||||
pexp = rate*exp(-tt*rate);
|
||||
hold on;
|
||||
plot(1000.0*tt, pexp, 'r')
|
||||
plot(1000.0*tt, pexp, 'r', 'linewidth', 4)
|
||||
hold off;
|
||||
xlim([0, maxisi])
|
||||
title('Poisson');
|
||||
savefigpdf(gcf, 'poissonisihist.pdf', 10, 7);
|
||||
savefigpdf(gcf, 'poissonisihist.pdf', 10, 6);
|
||||
|
@ -1,3 +1,11 @@
|
||||
x = load('poisson.mat');
|
||||
poissonspikes = x.spikes;
|
||||
x = load('pifou.mat');
|
||||
pifouspikes = x.spikes;
|
||||
x = load('lifadapt.mat');
|
||||
lifadaptspikes = x.spikes;
|
||||
clear x;
|
||||
|
||||
subplot(1, 3, 1);
|
||||
rasterplot(poissonspikes, 1.0);
|
||||
title('Poisson');
|
||||
|
@ -35,8 +35,8 @@
|
||||
How do you access single spike times?
|
||||
\begin{solution}
|
||||
\begin{lstlisting}
|
||||
clear all
|
||||
% not so good:
|
||||
clear all
|
||||
load poisson.mat
|
||||
whos
|
||||
poissonspikes = spikes;
|
||||
@ -55,6 +55,15 @@
|
||||
lifadaptspikes = x.spikes;
|
||||
clear x;
|
||||
\end{lstlisting}
|
||||
The files contain cell arrays with 20 trials of spike
|
||||
trains. Each spike train is a vector containing the times of
|
||||
spikes.
|
||||
\begin{lstlisting}
|
||||
% access first trial:
|
||||
trial = poissonspikes{1};
|
||||
% access second spike of first trial:
|
||||
trial(2);
|
||||
\end{lstlisting}
|
||||
\end{solution}
|
||||
|
||||
\newsolutionpage
|
||||
@ -112,11 +121,11 @@
|
||||
of the mean interspike interval.
|
||||
\begin{solution}
|
||||
\lstinputlisting{plotpoissonisih.m}
|
||||
%\mbox{}\\[-3ex]
|
||||
%\colorbox{white}{\includegraphics[width=1\textwidth]{poissonisihist}}
|
||||
\mbox{}\\[-3ex]
|
||||
\colorbox{white}{\includegraphics{poissonisihist}}
|
||||
\end{solution}
|
||||
|
||||
\continuepage
|
||||
|
||||
\continue
|
||||
% XXX Add return map!!! XXX
|
||||
\part Write a function that computes the serial correlations of
|
||||
interspike intervals for lags up to \code{maxlag}. The serial
|
||||
|
@ -6,7 +6,7 @@ function rasterplot(spikes, tmax)
|
||||
% Arguments:
|
||||
% spikes: a cell array of vectors of spike times in seconds
|
||||
% tmax: plot spike raster up to tmax seconds
|
||||
in_msecs = tmax < 1.5
|
||||
in_msecs = tmax < 1.5;
|
||||
spiketimes = [];
|
||||
trials = [];
|
||||
ntrials = length(spikes);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user