fixed exercise 01 of point processes

This commit is contained in:
2017-11-27 22:25:07 +01:00
parent 4e17882dd5
commit 53c2f92629
12 changed files with 275 additions and 162 deletions

View File

@@ -26,7 +26,7 @@ function isicorr = isiserialcorr(isivec, maxlag)
% plot:
plot(lags, isicorr, '-b');
hold on;
scatter(lags, isicorr, 100.0, 'b', 'filled');
scatter(lags, isicorr, 10.0, 'b', 'filled');
hold off;
xlabel('Lag k')
ylabel('\rho_k')

View File

@@ -1,7 +1,7 @@
function plotISIHist(isis, binwidth)
function plotisihist(isis, binwidth)
% Plot and annotate histogram of interspike intervals.
%
% plotISIHist(isis, binwidth)
% plotisihist(isis, binwidth)
%
% Arguments:
% isis: vector of interspike intervals in seconds
@@ -9,9 +9,9 @@ function plotISIHist(isis, binwidth)
% compute normalized histogram:
if nargin < 2
[pdf, centers] = isiHist(isis);
[pdf, centers] = isihist(isis);
else
[pdf, centers] = isiHist(isis, binwidth);
[pdf, centers] = isihist(isis, binwidth);
end
% plot:
@@ -21,14 +21,11 @@ function plotISIHist(isis, binwidth)
% annotation:
misi = mean(isis);
sdisi = std(isis);
disi = sdisi^2.0/2.0/misi^3;
text(0.95, 0.8, sprintf('mean=%.1f ms', 1000.0*misi), ...
'Units', 'normalized', 'HorizontalAlignment', 'right')
text(0.95, 0.7, sprintf('std=%.1f ms', 1000.0*sdisi), ...
'Units', 'normalized', 'HorizontalAlignment', 'right')
text(0.95, 0.6, sprintf('CV=%.2f', sdisi/misi), ...
'Units', 'normalized', 'HorizontalAlignment', 'right')
%text(0.95, 0.5, sprintf('D=%.1f Hz', disi), ...
% 'Units', 'normalized', 'HorizontalAlignment', 'right')
end

View File

@@ -1,19 +1,19 @@
maxisi = 300.0;
subplot(1, 3, 1);
poissonisis = isis(poissonspikes);
isihist(poissonisis, 0.001);
plotisihist(poissonisis, 0.001);
xlim([0, maxisi])
title('Poisson');
subplot(1, 3, 2);
pifouisis = isis(pifouspikes);
isihist(pifouisis, 0.001);
plotisihist(pifouisis, 0.001);
xlim([0, maxisi])
title('PIF OU');
subplot(1, 3, 3);
lifadaptisis = isis(lifadaptspikes);
isihist(lifadaptisis, 0.001);
plotisihist(lifadaptisis, 0.001);
xlim([0, maxisi])
title('LIF adapt');
savefigpdf(gcf, 'isihist.pdf', 20, 7);
savefigpdf(gcf, 'isihist.pdf', 20, 7);