[pointprocesses] cleaned up m and pdf files

This commit is contained in:
2021-01-19 13:28:51 +01:00
parent 73c6d35536
commit 77b6666347
25 changed files with 105 additions and 729 deletions

View File

@@ -1,5 +0,0 @@
function y = inversegauss( x, m, d )
% returns the inverse Gauss density with mean isi m and diffusion
% coefficent d
y = exp(-(x-m).^2./(4.0*d.*x.*m.^2.0))./sqrt(4.0*pi*d.*x.^3.0);
end

View File

@@ -1,28 +0,0 @@
f = figure;
subplot( 1, 2, 1 );
dx=0.0001;
x = dx:dx:0.5;
hold all
m = 0.02;
for d = [ 0.1 1 10 50 200 ]
plot( 1000.0*x, inversegauss( x, m, d ), 'LineWidth', 3, 'DisplayName', sprintf( 'D=%.1f', d ) );
end
title( sprintf( 'm=%g ms', 1000.0*m ) )
xlim( [ 0 50 ] );
xlabel( 'ISI [ms]' );
ylabel( 'p(ISI)' );
legend( '-DynamicLegend' );
hold off;
subplot( 1, 2, 2 );
hold all;
d = 5.0;
for m = [ 0.005 0.01 0.02 0.05 ]
plot( 1000.0*x, inversegauss( x, m, d ), 'LineWidth', 3, 'DisplayName', sprintf( 'm=%g ms', 1000.0*m ) );
end
title( sprintf( 'D=%g Hz', d ) )
xlim( [ 0 50 ] )
xlabel( 'ISI [ms]' );
ylabel( 'p(ISI)' );
legend( '-DynamicLegend' )
hold off

View File

@@ -1,36 +0,0 @@
% lif:
noises = [ 1e-5 1e-4 1e-3 1e-2 1e-1 ];
inputs = 0:0.1:20;
duration = 50.0;
% pif:
% noises = [ 1e-1 1 1e1 1e2 1e3 ];
% inputs = -5:0.1:10;
% duration = 100.0;
f = figure;
hold all;
for noise = noises
fprintf( 'noise=%.0e\n', noise );
rates = [];
for input = inputs
spikes = lifspikes( 10, input, duration, noise );
% spikes = pifspikes( 50, input, duration, noise );
nspikes = 0;
for k = 1:length( spikes )
nspikes = nspikes + length( spikes{k} );
end
rate = nspikes/duration/length( spikes );
%fprintf( 'I=%g N=%d rate=%g\n', input, length( spikes ), rate )
rates = [ rates rate ];
end
plot( inputs, rates, 'LineWidth', 2, 'DisplayName', sprintf( 'D=%.0e', noise ) );
end
xlabel( 'Input' );
xlim( [ inputs(1) inputs(end) ] )
ylabel( 'Firing rate [Hz]' );
%title( 'Leaky integrate-and-fire' )
title( 'Perfect integrate-and-fire' )
legend( '-DynamicLegend', 'Location', 'NorthWest' )
hold off

View File

@@ -1,35 +0,0 @@
%input = 65.0; % lifadapt 100Hz
%input = 8.0; % lifadapt 10Hz
input = 15.7; % lif 100Hz
%input = 8.3; % lif 10Hz
trials = 10;
tmax = 100.0;
noise = 1e-1;
adapttau = 0.1;
adaptincr = 5.0;
% generate spikes:
spikes = lifspikes( trials, input, tmax, noise );
%spikes = lifadaptspikes( trials, input, tmax, noise, adapttau, adaptincr );
% interspike intervals:
isivec = isis( spikes );
% histogram
f = figure( 1 );
isihist( isivec, 10e-4 );
hold on
% theoretical density:
misi = mean( isivec );
disi = var( isivec )/2.0/misi^3;
xmax = 3.0*misi;
x = 0:0.0001:xmax;
plot( 1000.0*x, inversegauss( x, misi, disi ), 'r', 'LineWidth', 3 );
% plot details:
title( sprintf( 'LIF, input=%g, nisi=%d', input, length( isivec ) ) )
xlim( [ 0.0 1000.0*xmax ] )
legend( 'data', 'inverse Gaussian' )
hold off
% serial correlations:
f = figure( 2 );
isiserialcorr( isivec, 10 );

View File

@@ -1,63 +0,0 @@
inputs = 0:0.1:20; % lif
inputs = 0:0.1:10; % pif
avisi = [];
sdisi = [];
cvisi = [];
dcisi = [];
for input = inputs
input
% spikes = lifspikes( 100, input, 100.0, 1e-2 );
spikes = pifspikes( 100, input, 100.0, 1e-1 );
isivec = isis( spikes );
if length( isivec ) <= 1
av = Inf;
sd = NaN;
cv = NaN;
dc = NaN;
else
av = mean( isivec );
sd = std( isivec );
if av > 0.0
cv = sd/av;
dc = sd^2.0/2.0/av^3;
else
cv = NaN;
dc = NaN;
end
end
avisi = [ avisi av ];
sdisi = [ sdisi sd ];
cvisi = [ cvisi cv ];
dcisi = [ dcisi dc ];
end
f = figure;
subplot( 2, 2, 1 );
plot( inputs, 1.0./avisi, '-b', 'LineWidth', 3 );
xlabel( 'Input' );
xlim( [ inputs(1) inputs(end) ] )
title( 'Mean rate [Hz]' );
subplot( 2, 2, 2 );
plot( inputs, 1000.0*avisi, '-b', 'LineWidth', 3 );
hold on;
plot( inputs, 1000.0*sdisi, '-c', 'LineWidth', 3 );
hold off;
xlabel( 'Input' );
xlim( [ inputs(1) inputs(end) ] )
ylim( [ 0 1000 ] )
title( 'ISI [ms]' );
legend( 's.d. ISI', 'mean ISI' );
subplot( 2, 2, 3 );
plot( inputs, cvisi, '-b', 'LineWidth', 3 );
xlabel( 'Input' );
xlim( [ inputs(1) inputs(end) ] )
title( 'CV' );
subplot( 2, 2, 4 );
plot( inputs, dcisi, '-b', 'LineWidth', 3 );
xlabel( 'Input' );
xlim( [ inputs(1) inputs(end) ] )
title( 'D [Hz]' );