From ca1b79c3cb755c230624496f1b479ee232c6762e Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Tue, 21 Jan 2020 18:01:16 +0100 Subject: [PATCH 1/5] [projects] example code for mutual information --- projects/README | 10 ++- projects/project_mutualinfo/code/mi.m | 8 ++ projects/project_mutualinfo/code/mutualinfo.m | 90 +++++++++++++++++++ projects/project_mutualinfo/mutualinfo.tex | 24 +++-- 4 files changed, 122 insertions(+), 10 deletions(-) create mode 100644 projects/project_mutualinfo/code/mi.m create mode 100644 projects/project_mutualinfo/code/mutualinfo.m diff --git a/projects/README b/projects/README index 16e9758..2f60f99 100644 --- a/projects/README +++ b/projects/README @@ -7,12 +7,18 @@ Put your solution into the `code/` subfolder. Don't forget to add the project files to git (`git add FILENAMES`). +Upload projects to Ilias +------------------------ + +Simply upload ALL zip files into one folder or Uebungseinheit. +Provide an additional file that links project names to students. + + Projects -------- 1) project_activation_curve medium -Write questions 2) project_adaptation_fit OK, medium @@ -34,7 +40,6 @@ OK, medium-difficult 7) project_ficurves OK, medium -Maybe add correlation test or fit statistics 8) project_lif OK, difficult @@ -42,7 +47,6 @@ no statistics 9) project_mutualinfo OK, medium -Example code is missing 10) project_noiseficurves OK, simple-medium diff --git a/projects/project_mutualinfo/code/mi.m b/projects/project_mutualinfo/code/mi.m new file mode 100644 index 0000000..dc69d7f --- /dev/null +++ b/projects/project_mutualinfo/code/mi.m @@ -0,0 +1,8 @@ +function I = mi(nxy) + pxy = nxy / sum(nxy(:)); + px = sum(nxy, 2) / sum(nxy(:)); + py = sum(nxy, 1) / sum(nxy(:)); + pi = pxy .* log2(pxy./(px*py)); + pi(nxy == 0) = 0.0; + I = sum(pi(:)); +end diff --git a/projects/project_mutualinfo/code/mutualinfo.m b/projects/project_mutualinfo/code/mutualinfo.m new file mode 100644 index 0000000..0e7a95e --- /dev/null +++ b/projects/project_mutualinfo/code/mutualinfo.m @@ -0,0 +1,90 @@ +%% load data: +x = load('../data/decisions.mat'); +presented = x.presented; +reported = x.reported; + +%% plot data: +figure() +plot(presented, 'ob', 'markersize', 10, 'markerfacecolor', 'b'); +hold on; +plot(reported, 'or', 'markersize', 5, 'markerfacecolor', 'r'); +hold off +ylim([0.5, 2.5]) + +p1 = sum(presented == 1); +p2 = sum(presented == 2); +r1 = sum(reported == 1); +r2 = sum(reported == 2); +figure() +bar([p1, p2, r1, r2]); +set(gca, 'XTickLabel', {'p1', 'p2', 'r1', 'r2'}); + +%% histogram: +nxy = zeros(2, 2); +for x = [1, 2] + for y = [1, 2] + nxy(x, y) = sum((presented == x) & (reported == y)); + end +end +figure() +bar3(nxy) +set(gca, 'XTickLabel', {'p1', 'p2'}); +set(gca, 'YTickLabel', {'r1', 'r2'}); + +%% normalized histogram: +pxy = nxy / sum(nxy(:)); +figure() +imagesc(pxy) + +px = sum(nxy, 2) / sum(nxy(:)); +py = sum(nxy, 1) / sum(nxy(:)); + +%% mutual information: +miv = mi(nxy); + +%% permutation: +np = 10000; +mis = zeros(np, 1); +for k = 1:np + ppre = presented(randperm(length(presented))); + prep = reported(randperm(length(reported))); + pnxy = zeros(2, 2); + for x = [1, 2] + for y = [1, 2] + pnxy(x, y) = sum((ppre == x) & (prep == y)); + end + end + mis(k) = mi(pnxy); +end +alpha = sum(mis>miv)/length(mis); +fprintf('signifikance: %g\n', alpha); +bins = [0.0:0.025:0.4]; +hist(mis, bins) +hold on; +plot([miv, miv], [0, np/10], '-r') +hold off; +xlabel('MI') +ylabel('Count') + +%% maximum MI: +n = 100000; +pxs = [0:0.01:1.0]; +mis = zeros(length(pxs), 1); +for k = 1:length(pxs) + p = rand(n, 1); + nxy = zeros(2, 2); + nxy(1, 1) = sum(p Date: Tue, 21 Jan 2020 18:08:28 +0100 Subject: [PATCH 2/5] [projects] solutions go into solutions/ --- projects/README | 14 +++++++++----- .../project_mutualinfo/{code => solution}/mi.m | 0 .../{code => solution}/mutualinfo.m | 0 3 files changed, 9 insertions(+), 5 deletions(-) rename projects/project_mutualinfo/{code => solution}/mi.m (100%) rename projects/project_mutualinfo/{code => solution}/mutualinfo.m (100%) diff --git a/projects/README b/projects/README index 2f60f99..665350c 100644 --- a/projects/README +++ b/projects/README @@ -1,10 +1,14 @@ How to make a new project ------------------------- -Copy `project_template/` to your `project_NAME/` and adapt according to your needs. -Rename `template.tex` to `NAME.tex` and write questions. -Put data that are needed for the project into the `data/` subfolder. -Put your solution into the `code/` subfolder. -Don't forget to add the project files to git (`git add FILENAMES`). + +- Copy `project_template/` to your `project_NAME/` and adapt according to your needs. +- Rename `template.tex` to `NAME.tex` and write questions. +- Put code needed for the project into the project's root directory. +- Put data that are needed for the project into the `data/` subfolder. +- Put your solution into the `solution/` subfolder. +- Put code that is needed to generate some data for the project, + but which is not part of the project, into the `code/` subfolder. +- Don't forget to add the project files to git (`git add FILENAMES`). Upload projects to Ilias diff --git a/projects/project_mutualinfo/code/mi.m b/projects/project_mutualinfo/solution/mi.m similarity index 100% rename from projects/project_mutualinfo/code/mi.m rename to projects/project_mutualinfo/solution/mi.m diff --git a/projects/project_mutualinfo/code/mutualinfo.m b/projects/project_mutualinfo/solution/mutualinfo.m similarity index 100% rename from projects/project_mutualinfo/code/mutualinfo.m rename to projects/project_mutualinfo/solution/mutualinfo.m From 1362b39fd640a83d16805d98e67ce000a155edfb Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Tue, 21 Jan 2020 19:07:36 +0100 Subject: [PATCH 3/5] [projects] solution for activation curve --- projects/README | 1 + .../solution/ivcurve.m | 16 ++++++ .../project_activation_curve/solution/main.m | 50 +++++++++++++++++++ .../solution/plotcurrents.m | 13 +++++ .../solution/reversalpotential.m | 4 ++ 5 files changed, 84 insertions(+) create mode 100644 projects/project_activation_curve/solution/ivcurve.m create mode 100644 projects/project_activation_curve/solution/main.m create mode 100644 projects/project_activation_curve/solution/plotcurrents.m create mode 100644 projects/project_activation_curve/solution/reversalpotential.m diff --git a/projects/README b/projects/README index 665350c..0f688a4 100644 --- a/projects/README +++ b/projects/README @@ -23,6 +23,7 @@ Projects 1) project_activation_curve medium +also normalize activation curve to maximum. 2) project_adaptation_fit OK, medium diff --git a/projects/project_activation_curve/solution/ivcurve.m b/projects/project_activation_curve/solution/ivcurve.m new file mode 100644 index 0000000..0431d4f --- /dev/null +++ b/projects/project_activation_curve/solution/ivcurve.m @@ -0,0 +1,16 @@ +function [vsteps, peakcurrents] = ivcurve(vsteps, time, currents, tmax) + +peakcurrents = zeros(1, length(vsteps)); +for k = 1:length(peakcurrents) + c = currents((time>0.0)&(time maxc + peakcurrents(k) = minc; + else + peakcurrents(k) = maxc; + end +end + +end + diff --git a/projects/project_activation_curve/solution/main.m b/projects/project_activation_curve/solution/main.m new file mode 100644 index 0000000..f2bd03f --- /dev/null +++ b/projects/project_activation_curve/solution/main.m @@ -0,0 +1,50 @@ +%% plot data: +x = load('../data/WT_01.mat'); +wtdata = x.data; +plotcurrents(wtdata.t, wtdata.I); + +x = load('../data/A1622D_01.mat'); +addata = x.data; +plotcurrents(addata.t, addata.I); + +%% I-V curve: +[wtsteps, wtpeaks] = ivcurve(wtdata.steps, wtdata.t, wtdata.I, 100.0); + +[adsteps, adpeaks] = ivcurve(addata.steps, addata.t, addata.I, 100.0); + +figure(); +plot(wtsteps, wtpeaks, '-b'); +hold on; +plot(adsteps, adpeaks, '-r'); +hold off; + +%% reversal potential: +wtE = reversalpotential(wtsteps, wtpeaks); +adE = reversalpotential(adsteps, adpeaks); + +%% activation curve: +wtg = wtpeaks./(wtsteps - wtE); +adg = adpeaks./(adsteps - adE); + +wtinfty = wtg(wtsteps<40.0)/mean(wtg((wtsteps>=20.0)&(wtsteps<=40.0))); +adinfty = adg(adsteps<40.0)/mean(adg((adsteps>=20.0)&(adsteps<=40.0))); +wtsteps = wtsteps(wtsteps<40.0); +adsteps = adsteps(adsteps<40.0); + +figure(); +plot(wtsteps, wtinfty, '-b'); +hold on; +plot(adsteps, adinfty, '-r'); + +%% boltzmann fit: +bf = @(p, v) 1.0./(1.0+exp(-p(1)*(v - p(2)))); +p = lsqcurvefit(bf, [1.0, -40.0], wtsteps, wtinfty); +wtfit = bf(p, wtsteps); +p = lsqcurvefit(bf, [1.0, -40.0], adsteps, adinfty); +adfit = bf(p, adsteps); + +plot(wtsteps, wtfit, '-b'); +plot(wtsteps, adfit, '-r'); +hold off; + + diff --git a/projects/project_activation_curve/solution/plotcurrents.m b/projects/project_activation_curve/solution/plotcurrents.m new file mode 100644 index 0000000..e2c510c --- /dev/null +++ b/projects/project_activation_curve/solution/plotcurrents.m @@ -0,0 +1,13 @@ +function plotcurrents(time, currents) + +figure(); +hold on; +for k = 1:size(currents, 2) + plot(time, currents(:, k)) +end +hold off; +xlabel('Time [ms]') +ylabel('Current') + +end + diff --git a/projects/project_activation_curve/solution/reversalpotential.m b/projects/project_activation_curve/solution/reversalpotential.m new file mode 100644 index 0000000..686b667 --- /dev/null +++ b/projects/project_activation_curve/solution/reversalpotential.m @@ -0,0 +1,4 @@ +function E = reversalpotential(vsteps, currents) + p = polyfit(vsteps((vsteps>=20.0)&(vsteps<50.0)), currents((vsteps>=20.0)&(vsteps<50.0)), 1); + E = -p(2)/p(1); +end \ No newline at end of file From a385cab9253b84c79dfbf6514f5c53a7cbe9d296 Mon Sep 17 00:00:00 2001 From: janscience Date: Wed, 22 Jan 2020 14:23:02 +0100 Subject: [PATCH 4/5] [projects] fixed poweranalysis title --- .../lecture/pointprocessscetchA.eps | 105 ++++--- .../lecture/pointprocessscetchA.pdf | Bin 2786 -> 2791 bytes .../lecture/pointprocessscetchB.eps | 260 ++++++++++++------ .../lecture/pointprocessscetchB.pdf | Bin 4694 -> 4724 bytes .../project_power_analysis/power_analysis.tex | 2 +- 5 files changed, 246 insertions(+), 121 deletions(-) diff --git a/pointprocesses/lecture/pointprocessscetchA.eps b/pointprocesses/lecture/pointprocessscetchA.eps index f2cc576..2c18dd1 100644 --- a/pointprocesses/lecture/pointprocessscetchA.eps +++ b/pointprocesses/lecture/pointprocessscetchA.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchA.tex -%%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Fri Dec 6 23:29:10 2019 +%%Creator: gnuplot 5.0 patchlevel 5 +%%CreationDate: Tue Jan 7 10:05:37 2020 %%DocumentFonts: %%BoundingBox: 50 50 373 135 %%EndComments @@ -18,6 +18,7 @@ gnudict begin /Dashlength 1 def /Landscape false def /Level1 false def +/Level3 false def /Rounded true def /ClipToBoundingBox false def /SuppressPDFMark false def @@ -29,11 +30,11 @@ gnudict begin % /vshift -73 def /dl1 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if } def /dl2 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul add } if } def /hpt_ 31.5 def @@ -47,7 +48,7 @@ gnudict begin } if } def % -% Gnuplot Prolog Version 4.6 (September 2012) +% Gnuplot Prolog Version 5.1 (Oct 2015) % %/SuppressPDFMark true def % @@ -64,11 +65,11 @@ gnudict begin /vpt2 vpt 2 mul def /hpt2 hpt 2 mul def /Lshow {currentpoint stroke M 0 vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Rshow {currentpoint stroke M dup stringwidth pop neg vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def /DL {Color {setrgbcolor Solid {pop []} if 0 setdash} @@ -82,7 +83,7 @@ gnudict begin /PL {stroke userlinewidth setlinewidth Rounded {1 setlinejoin 1 setlinecap} if} def 3.8 setmiterlimit -% Default Line colors +% Classic Line colors (version 5.0) /LCw {1 1 1} def /LCb {0 0 0} def /LCa {0 0 0} def @@ -95,19 +96,21 @@ gnudict begin /LC6 {0 0 0} def /LC7 {1 0.3 0} def /LC8 {0.5 0.5 0.5} def -% Default Line Types +% Default dash patterns (version 5.0) +/LTB {BL [] LCb DL} def /LTw {PL [] 1 setgray} def -/LTb {BL [] LCb DL} def +/LTb {PL [] LCb DL} def /LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def /LT0 {PL [] LC0 DL} def -/LT1 {PL [4 dl1 2 dl2] LC1 DL} def -/LT2 {PL [2 dl1 3 dl2] LC2 DL} def -/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def -/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def -/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def -/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def -/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def -/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def +/LT1 {PL [2 dl1 3 dl2] LC1 DL} def +/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def +/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def +/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def +/LT5 {PL [4 dl1 2 dl2] LC5 DL} def +/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def +/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def +/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def +/SL {[] 0 setdash} def /Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def /Dia {stroke [] 0 setdash 2 copy vpt add M hpt neg vpt neg V hpt vpt neg V @@ -329,9 +332,14 @@ gnudict begin % /languagelevel where {pop languagelevel} {1} ifelse - 2 lt - {/InterpretLevel1 true def} - {/InterpretLevel1 Level1 def} +dup 2 lt + {/InterpretLevel1 true def + /InterpretLevel3 false def} + {/InterpretLevel1 Level1 def + 2 gt + {/InterpretLevel3 Level3 def} + {/InterpretLevel3 false def} + ifelse } ifelse % % PostScript level 2 pattern fill definitions @@ -420,6 +428,7 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse /Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall currentdict end definefont pop +% Level1 SuppressPDFMark or {} { /SDict 10 dict def @@ -429,14 +438,42 @@ systemdict /pdfmark known not { SDict begin [ /Title (pointprocessscetchA.tex) /Subject (gnuplot plot) - /Creator (gnuplot 4.6 patchlevel 4) - /Author (jan) + /Creator (gnuplot 5.0 patchlevel 5) + /Author (benda) % /Producer (gnuplot) % /Keywords () - /CreationDate (Fri Dec 6 23:29:10 2019) + /CreationDate (Tue Jan 7 10:05:37 2020) /DOCINFO pdfmark end } ifelse +% +% Support for boxed text - Ethan A Merritt May 2005 +% +/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put + userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put + /Boxing true def } def +/ExtendTextBox { Boxing + { gsave dup false charpath pathbbox + dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse + dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse + dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse + dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse + grestore } if } def +/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M + TBx1 TBxmargin sub TBy2 TBymargin add L + TBx2 TBxmargin add TBy2 TBymargin add L + TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def +/DrawTextBox { PopTextBox stroke /Boxing false def} def +/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def +0 0 0 0 InitTextBox +/TBxmargin 20 def +/TBymargin 20 def +/Boxing false def +/textshow { ExtendTextBox Gshow } def +% +% redundant definitions for compatibility with prologue.ps older than 5.0.2 +/LTB {BL [] LCb DL} def +/LTb {PL [] LCb DL} def end %%EndProlog %%Page: 1 1 @@ -450,10 +487,9 @@ newpath 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -467,9 +503,11 @@ gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 573 M 0 503 V 1412 573 M @@ -488,11 +526,16 @@ LC0 setrgbcolor 0 503 V 5685 573 M 0 503 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C stroke grestore end diff --git a/pointprocesses/lecture/pointprocessscetchA.pdf b/pointprocesses/lecture/pointprocessscetchA.pdf index 3210a19c2531b5e726e9d45593e1ce8f360c5da6..0d2f26e462a4016a4e9921b47de8cd85e74860e4 100644 GIT binary patch delta 800 zcmaDP`dpMlHNeG9*HF)NB8Nl0H{T%x9+&TSt^NWz&o37+E%DOH=x=aQy`tB^dR@J9 ztA(8g6wQsl`(|sI zs!gd{c5O!g&h)I_qi?F0h0PTBJ~yqm@}-CAwC4(c`=U~fV;(RciU{YK_(7V{cry=U zH6xJfV6tUYF-tN@F-$cv*EO>=vD7s*Of%Ir00LbD^OO{0gCro4Vleq7vk#-eWH~lf z;*{63*a{i}jW7h75@KjzWngM$Y(Duci-tr10nBnGBMTkX{%Q+1-%@ja^Z=jH;zy)R)7#SH@qKg@r7?@AK$SKTdKKUu9x~K()ys5Fl zWJNAvQ9}$FGXsOko?JGuhK^3omPY2LhL%Q_7LLX)M&^bVW`?FFMn=XKmKLt&b~Xf6 f#B$l$aTS*&7L`;KrKWKinHXDesj9mAyKw;kKZEmL delta 823 zcmaDZ`bd;RHNeG9*HF)VB8Nl0BNvk)kL!0!SHFPUOHN)9=4j$RuFS!A;*3*lMeTB5 ziPvFXFaQ5n-Ot~nn7HQn{nt#p3lF?x)jj&0WlqwuIUM4X_k_<0Uuo%aI$eI@rjyg| zIeg%i;hLxLuyAjAzAXR$?UVk!iL78;Ri7%jWKs6vOIr$JXcQV;Bs+gvkm?S1ATI!k_Seob>8m5`*8UTT=foY<#aY|B(L8`gowV z;k3f^VHl?($ePJDoQAfh3ZQ^DP{>o@0y7MZfSS?83{0?y8JU|+e#NP7YmTAX)W{N3 z%-jG|%+hkQAD2z6n~STFi;Jnbg`10orK_o#o0Flrn}M;jxwDgjp_{3joee=1v0Qd` aT*W1cMI{wQscBqBCdS5Gs;aL3Zd?G===6I4 diff --git a/pointprocesses/lecture/pointprocessscetchB.eps b/pointprocesses/lecture/pointprocessscetchB.eps index 5dd2316..83c9cea 100644 --- a/pointprocesses/lecture/pointprocessscetchB.eps +++ b/pointprocesses/lecture/pointprocessscetchB.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchB.tex -%%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Fri Dec 6 23:29:10 2019 +%%Creator: gnuplot 5.0 patchlevel 5 +%%CreationDate: Tue Jan 7 10:05:38 2020 %%DocumentFonts: %%BoundingBox: 50 50 373 237 %%EndComments @@ -18,6 +18,7 @@ gnudict begin /Dashlength 1 def /Landscape false def /Level1 false def +/Level3 false def /Rounded true def /ClipToBoundingBox false def /SuppressPDFMark false def @@ -29,11 +30,11 @@ gnudict begin % /vshift -73 def /dl1 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if } def /dl2 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul add } if } def /hpt_ 31.5 def @@ -47,7 +48,7 @@ gnudict begin } if } def % -% Gnuplot Prolog Version 4.6 (September 2012) +% Gnuplot Prolog Version 5.1 (Oct 2015) % %/SuppressPDFMark true def % @@ -64,11 +65,11 @@ gnudict begin /vpt2 vpt 2 mul def /hpt2 hpt 2 mul def /Lshow {currentpoint stroke M 0 vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Rshow {currentpoint stroke M dup stringwidth pop neg vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def /DL {Color {setrgbcolor Solid {pop []} if 0 setdash} @@ -82,7 +83,7 @@ gnudict begin /PL {stroke userlinewidth setlinewidth Rounded {1 setlinejoin 1 setlinecap} if} def 3.8 setmiterlimit -% Default Line colors +% Classic Line colors (version 5.0) /LCw {1 1 1} def /LCb {0 0 0} def /LCa {0 0 0} def @@ -95,19 +96,21 @@ gnudict begin /LC6 {0 0 0} def /LC7 {1 0.3 0} def /LC8 {0.5 0.5 0.5} def -% Default Line Types +% Default dash patterns (version 5.0) +/LTB {BL [] LCb DL} def /LTw {PL [] 1 setgray} def -/LTb {BL [] LCb DL} def +/LTb {PL [] LCb DL} def /LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def /LT0 {PL [] LC0 DL} def -/LT1 {PL [4 dl1 2 dl2] LC1 DL} def -/LT2 {PL [2 dl1 3 dl2] LC2 DL} def -/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def -/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def -/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def -/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def -/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def -/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def +/LT1 {PL [2 dl1 3 dl2] LC1 DL} def +/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def +/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def +/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def +/LT5 {PL [4 dl1 2 dl2] LC5 DL} def +/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def +/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def +/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def +/SL {[] 0 setdash} def /Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def /Dia {stroke [] 0 setdash 2 copy vpt add M hpt neg vpt neg V hpt vpt neg V @@ -329,9 +332,14 @@ gnudict begin % /languagelevel where {pop languagelevel} {1} ifelse - 2 lt - {/InterpretLevel1 true def} - {/InterpretLevel1 Level1 def} +dup 2 lt + {/InterpretLevel1 true def + /InterpretLevel3 false def} + {/InterpretLevel1 Level1 def + 2 gt + {/InterpretLevel3 Level3 def} + {/InterpretLevel3 false def} + ifelse } ifelse % % PostScript level 2 pattern fill definitions @@ -420,6 +428,7 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse /Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall currentdict end definefont pop +% Level1 SuppressPDFMark or {} { /SDict 10 dict def @@ -429,14 +438,42 @@ systemdict /pdfmark known not { SDict begin [ /Title (pointprocessscetchB.tex) /Subject (gnuplot plot) - /Creator (gnuplot 4.6 patchlevel 4) - /Author (jan) + /Creator (gnuplot 5.0 patchlevel 5) + /Author (benda) % /Producer (gnuplot) % /Keywords () - /CreationDate (Fri Dec 6 23:29:10 2019) + /CreationDate (Tue Jan 7 10:05:38 2020) /DOCINFO pdfmark end } ifelse +% +% Support for boxed text - Ethan A Merritt May 2005 +% +/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put + userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put + /Boxing true def } def +/ExtendTextBox { Boxing + { gsave dup false charpath pathbbox + dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse + dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse + dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse + dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse + grestore } if } def +/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M + TBx1 TBxmargin sub TBy2 TBymargin add L + TBx2 TBxmargin add TBy2 TBymargin add L + TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def +/DrawTextBox { PopTextBox stroke /Boxing false def} def +/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def +0 0 0 0 InitTextBox +/TBxmargin 20 def +/TBymargin 20 def +/Boxing false def +/textshow { ExtendTextBox Gshow } def +% +% redundant definitions for compatibility with prologue.ps older than 5.0.2 +/LTB {BL [] LCb DL} def +/LTb {PL [] LCb DL} def end %%EndProlog %%Page: 1 1 @@ -450,10 +487,9 @@ newpath 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -467,9 +503,11 @@ gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 3029 M 0 272 V 502 -272 R @@ -488,18 +526,22 @@ LC0 setrgbcolor 0 272 V 5685 3029 M 0 272 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -510,76 +552,86 @@ gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill 0 -32 V -5680 0 R 5680 0 V +stroke 1291 1929 M 121 32 V -121 32 V --260 -64 R --121 32 V -121 32 V -910 1961 M +-260 0 R +910 1961 L +121 -32 V +-121 32 R 502 0 V -590 -32 R +stroke +2002 1929 M 121 32 V -121 32 V --469 -64 R --121 32 V -121 32 V --121 -32 R +-469 0 R +-121 -32 V +121 -32 V +-121 32 R 711 0 V -206 -22 R +stroke +2329 1939 M 84 22 V -84 22 V --122 -44 R --84 22 V -84 22 V --84 -22 R +-122 0 R +-84 -22 V +84 -22 V +-84 22 R 290 0 V -216 -23 R +stroke +2629 1938 M 88 23 V -88 23 V --128 -46 R --88 23 V -88 23 V --88 -23 R +-128 0 R +-88 -23 V +88 -23 V +-88 23 R 304 0 V -329 -32 R +stroke +3046 1929 M 121 32 V -121 32 V --208 -64 R --121 32 V -121 32 V --121 -32 R +-208 0 R +-121 -32 V +121 -32 V +-121 32 R 450 0 V -745 -32 R +stroke +3912 1929 M 121 32 V -121 32 V --624 -64 R --121 32 V -121 32 V --121 -32 R +-624 0 R +-121 -32 V +121 -32 V +-121 32 R 866 0 V -496 -32 R +stroke +4529 1929 M 121 32 V -121 32 V --375 -64 R --121 32 V -121 32 V --121 -32 R +-375 0 R +-121 -32 V +121 -32 V +-121 32 R 617 0 V -914 -32 R +stroke +5564 1929 M 121 32 V -121 32 V --793 -64 R --121 32 V -121 32 V --121 -32 R +-793 0 R +-121 -32 V +121 -32 V +-121 32 R 1035 0 V stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 1907 M 0 272 V 502 -272 R @@ -598,47 +650,60 @@ LC0 setrgbcolor 0 272 V 5685 1907 M 0 272 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 268 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 460 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 652 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 844 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1036 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1228 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1276 M 528 220 L 5801 0 R @@ -646,9 +711,7 @@ LCb setrgbcolor -5801 0 R 1.000 UP stroke -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -662,9 +725,11 @@ gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 3.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +3.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 268 M 382 0 V 0 96 R @@ -685,11 +750,15 @@ LC0 setrgbcolor 1035 0 V 0 96 R 533 0 V -1.500 UP stroke +LTw +% End plot #1 +% Begin plot #2 +1.500 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 268 CircleF 1412 364 CircleF 2123 460 CircleF @@ -699,10 +768,14 @@ LC0 setrgbcolor 4033 844 CircleF 4650 940 CircleF 5685 1036 CircleF +LTw +% End plot #2 +% Begin plot #3 1.000 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 1.00 1.00 1.00 C 910 268 CircleF 1412 364 CircleF 2123 460 CircleF @@ -712,10 +785,14 @@ LC0 setrgbcolor 4033 844 CircleF 4650 940 CircleF 5685 1036 CircleF +LTw +% End plot #3 +% Begin plot #4 1.500 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 364 CircleF 1412 460 CircleF 2123 556 CircleF @@ -725,10 +802,15 @@ LC0 setrgbcolor 4033 940 CircleF 4650 1036 CircleF 5685 1132 CircleF -1.000 UP +LTw +% End plot #4 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C stroke grestore end diff --git a/pointprocesses/lecture/pointprocessscetchB.pdf b/pointprocesses/lecture/pointprocessscetchB.pdf index cb77c74d5c91d6c68af4affd77e4099028a44987..c9d4fdc275aa3c4d1b9798e3f43881ce482548d7 100644 GIT binary patch delta 2801 zcmb7DdpOkV7M|H|g<(V`ktt0~On!5}xQ#F++Q=;tVJ3H@3FSJZHc7QzA|%7GCo~kh zkxDofMUisZV@9JImvYN>wxka2=lpZ}<8;1%zV*E8U2DDX`kt?E=lsrfa7Sw@614}H zxz38!01-7gKTt1Q$eWdwS3do=LQi8zKBM4Vo05-MV~gePs_0gB_l*qY8IJ0c4C(Z# zd$T5!tiP9+mdA~oUPx=cJ(!-g!^qvF zH)cn~!zZjPi@^>?I3?i$Rj4wpc0bCv5PDUp;?R{G+C);xi2a*pHo6Z3)+RURGG_OsXJ%$=5y{wXi^Aoz8uV(_>z9JS8`^ zCw5?AEc6q`GUA%&`C1DPsHo9A_t8#GApzU;2 z(VZE4h_;@*^wH>vnm3KH`NMxs5vO4DZtxbF^_TK0UlYyBPH@Q=dAlwe_6AKT1&MBy zHJoL~l#qFI@Cs>#^HnojFK(HIcN}W|W95qs0idUk~p&Lmd-(!3{gqyxopf56sqK?=+h<#R6pj{sV-eG?ki8Qh zj4XIj&79glyxwhUUp15_sC@?&+}rSc<7j}4g(qJ^B=bjP>z-5ynjJLwk5n=y6`vO)dJ^4ELEH6>cXnZmR^Bxf3H@&l|t_;Cu}q2?W3S5 zUo?}xj14{Y4seDiv5sv*IX+S8&yT`GOw#Yk=R~+ZR2P!i{2~Ssv`HF=b!?p}jr!M2 zN?dbT(%BwioJ!!G)V&zj&8d>QHc5b*z45TqP;sbvH$C zrX3g$A3i88T9}?8B`tNgWUgF4XnRnao(FfFys=zrGFafsB2IU;8nVmE0?sjN<3pz6 zKQx~Z&_5a=y|j-XWf(H=>Wik3iOQ73DOhd4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78m7vv*85@1cU;4+Dm@es-)nWe1aF9xmvL{WcHTIik`5Z8{TM@IQ zDPQIKA$3WJ*f|Y~yFuE*m>mGVSp5fo<-8_EP0)0fvo_c)Qi4-Rq&7DRWC8QJu3 z`I0OXx-Y+5JDm%_=NwewC+Q7}{X}WMq4hlV^=s7yA^Bcq6~)&Z?SccFUPiT(-K+Zd0-_?O zAea#Z28TdVC*TNUxREgoO2dn2$zVx=UxEb*KL&LOsBcXoc!vds1Y^9z z2wFQJ7=kYti~|1~5DbUHjDGr#hxq-nV2pPJ7#xa%Bj83q2XI5e_;<#S5(jtM(1bxy zGeZP;XZlcZFc|pj07b%J$p6&fi2tI&&e>zS9&CG!0FmF=W1ros@h(sV^ LKy`H+M=bE4Fv`Ts diff --git a/projects/project_power_analysis/power_analysis.tex b/projects/project_power_analysis/power_analysis.tex index 0957126..00dfcf8 100644 --- a/projects/project_power_analysis/power_analysis.tex +++ b/projects/project_power_analysis/power_analysis.tex @@ -1,6 +1,6 @@ \documentclass[a4paper,12pt,pdftex]{exam} -\newcommand{\ptitle}{EOD waveform} +\newcommand{\ptitle}{Power analysis} \input{../header.tex} \firstpagefooter{Supervisor: Peter Pilz}{phone: 29 74835}% {email: peter.pilz@uni-tuebingen.de} From 46830d54be746a765569512f5e66a59b4a5588f6 Mon Sep 17 00:00:00 2001 From: janscience Date: Wed, 22 Jan 2020 18:50:47 +0100 Subject: [PATCH 5/5] [projects] updated mutual information and noisy ficurves --- projects/project_mutualinfo/mutualinfo.tex | 105 +++++++++++---- .../project_noiseficurves/noiseficurves.tex | 121 +++++++++--------- 2 files changed, 141 insertions(+), 85 deletions(-) diff --git a/projects/project_mutualinfo/mutualinfo.tex b/projects/project_mutualinfo/mutualinfo.tex index 9b4773a..44e6f88 100644 --- a/projects/project_mutualinfo/mutualinfo.tex +++ b/projects/project_mutualinfo/mutualinfo.tex @@ -11,6 +11,49 @@ %%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% +The mutual information is a measure from information theory that is +used in neuroscience to quantify, for example, how much information a +spike train carries about a sensory stimulus. It quantifies the +dependence of an output $y$ (e.g. a spike train) on some input $x$ +(e.g. a sensory stimulus). + +The probability of each of $n$ input values $x = {x_1, x_2, ... x_n}$ +is given by the corresponding probabilty distribution $P(x)$. The entropy +\begin{equation} + \label{entropy} + H[x] = - \sum_{x} P(x) \log_2 P(x) +\end{equation} +is a measure for the surprise of getting a specific value of $x$. For +example, if from two possible values '1' and '2', the probability of +getting a '1' is close to one ($P(1) \approx 1$) then the probability +of getting a '2' is close to zero ($P(2) \approx 0$). For this case +the entropy, the surprise level, is almost zero, because both $0 \log +0 = 0$ and $1 \log 1 = 0$. It is not surprising at all that you almost +always get a '1'. The entropy is largest for equally likely outcomes +of $x$. If getting a '1' or a '2' is equally likely then you will be +most surprised by each new number you get, because you can not predict +them. + +Mutual information measures information transmitted between an input +and an output. It is computed from the probability distributions of +the input, $P(x)$, the output $P(y)$ and their joint distribution +$P(x,y)$: +\begin{equation} + \label{mi} + I[x:y] = \sum_{x}\sum_{y} P(x,y) \log_2\frac{P(x,y)}{P(x)P(y)} +\end{equation} +where the sums go over all possible values of $x$ and $y$. The mutual +information can be also expressed in terms of entropies. Mutual +information is the entropy of the outputs $y$ reduced by the entropy +of the outputs given the input: +\begin{equation} + \label{mientropy} + I[x:y] = E[y] - E[x|y] +\end{equation} + +The following project is meant to explore the concept of mutual +information with the help of a simple example. + \begin{questions} \question A subject was presented two possible objects for a very brief time ($50$\,ms). The task of the subject was to report which of @@ -19,50 +62,56 @@ object was reported by the subject. \begin{parts} - \part Plot the data appropriately. + \part Plot the raw data (no sums or probabilities) appropriately. + + \part Compute and plot the probability distributions of presented + and reported objects. \part Compute a 2-d histogram that shows how often different combinations of reported and presented came up. \part Normalize the histogram such that it sums to one (i.e. make it a probability distribution $P(x,y)$ where $x$ is the presented - object and $y$ is the reported object). Compute the probability - distributions $P(x)$ and $P(y)$ in the same way. - - \part Use that probability distribution to compute the mutual - information - - \[ I[x:y] = \sum_{x\in\{1,2\}}\sum_{y\in\{1,2\}} P(x,y) - \log_2\frac{P(x,y)}{P(x)P(y)}\] - that the answers provide about the actually presented object. - - The mutual information is a measure from information theory that is - used in neuroscience to quantify, for example, how much information - a spike train carries about a sensory stimulus. - - \part What is the maximally achievable mutual information? - - Show this numerically by generating your own datasets which - naturally should yield maximal information. Consider different - distributions of $P(x)$. - - Here you may encounter a problem when computing the mutual - information whenever $P(x,y)$ equals zero. For treating this - special case think about (plot it) what the limit of $x \log x$ is - for $x$ approaching zero. Use this information to fix the - computation of the mutual information. + object and $y$ is the reported object). + + \part Use the computed probability distributions to compute the mutual + information \eqref{mi} that the answers provide about the + actually presented object. \part Use a permutation test to compute the $95\%$ confidence interval for the mutual information estimate in the dataset from {\tt decisions.mat}. Does the measured mutual information indicate signifikant information transmission? - + \end{parts} + + \question What is the maximally achievable mutual information? + + \begin{parts} + \part Show this numerically by generating your own datasets which + naturally should yield maximal information. Consider different + distributions of $P(x)$. -\end{questions} + \part Compare the maximal mutual information with the corresponding + entropy \eqref{entropy}. + \end{parts} + \question What is the minimum possible mutual information? + This is the mutual information between an output is independent of the + input. + How is the joint distribution $P(x,y)$ related to the marginls + $P(x)$ and $P(y)$ if $x$ and $y$ are independent? What is the value + of the logarithm in eqn.~\eqref{mi} in this case? So what is the + resulting value for the mutual information? + +\end{questions} +Hint: You may encounter a problem when computing the mutual +information whenever $P(x,y)$ equals zero. For treating this special +case think about (plot it) what the limit of $x \log x$ is for $x$ +approaching zero. Use this information to fix the computation of the +mutual information. \end{document} diff --git a/projects/project_noiseficurves/noiseficurves.tex b/projects/project_noiseficurves/noiseficurves.tex index 3baa199..a2df3df 100644 --- a/projects/project_noiseficurves/noiseficurves.tex +++ b/projects/project_noiseficurves/noiseficurves.tex @@ -9,49 +9,50 @@ \input{../instructions.tex} -\begin{questions} - \question You are recording the activity of a neuron in response to - constant stimuli of intensity $I$ (think of that, for example, - as a current $I$ injected via a patch-electrode into the neuron). - - Measure the tuning curve (also called the intensity-response curve) of the - neuron. That is, what is the mean firing rate of the neuron's response - as a function of the constant input current $I$? - - How does the intensity-response curve of a neuron depend on the - level of the intrinsic noise of the neuron? - - How can intrinsic noise be usefull for encoding stimuli? - - The neuron is implemented in the file \texttt{lifspikes.m}. Call it - with the following parameters:\\[-7ex] - \begin{lstlisting} -trials = 10; -tmax = 50.0; -current = 10.0; % the constant input current I -Dnoise = 1.0; % noise strength -spikes = lifspikes(trials, current, tmax, Dnoise); - \end{lstlisting} - The returned \texttt{spikes} is a cell array with \texttt{trials} - elements, each being a vector of spike times (in seconds) computed - for a duration of \texttt{tmax} seconds. The input current is set - via the \texttt{current} variable, the strength of the intrinsic - noise via \texttt{Dnoise}. If \texttt{current} is a single number, - then an input current of that intensity is simulated for - \texttt{tmax} seconds. Alternatively, \texttt{current} can be a - vector containing an input current that changes in time. In this - case, \texttt{tmax} is ignored, and you have to provide a value - for the input current for every 0.0001\,seconds. - - Think of calling the \texttt{lifspikes()} function as a simple way - of doing an electrophysiological experiment. You are presenting a - stimulus with a constant intensity $I$ that you set. The neuron - responds to this stimulus, and you record this response. After - detecting the timepoints of the spikes in your recordings you get - what the \texttt{lifspikes()} function returns. In addition you - can record from different neurons with different noise properties - by setting the \texttt{Dnoise} parameter to different values. +You are recording the activity of neurons that differ in the strength +of their intrinsic noise in response to constant stimuli of intensity +$I$ (think of that, for example, as a current $I$ injected via a +patch-electrode into the neuron). + +We first characterize the neurons by their tuning curves (also called +intensity-response curve). That is, what is the mean firing rate of +the neuron's response as a function of the constant input current $I$? + +In the second part we demonstrate how intrinsic noise can be useful +for encoding stimuli on the example of the so called ``subthreshold +stochastic resonance''. + +The neuron is implemented in the file \texttt{lifspikes.m}. Call it +with the following parameters:\\[-7ex] +\begin{lstlisting} + trials = 10; + tmax = 50.0; + current = 10.0; % the constant input current I + Dnoise = 1.0; % noise strength + spikes = lifspikes(trials, current, tmax, Dnoise); +\end{lstlisting} +The returned \texttt{spikes} is a cell array with \texttt{trials} +elements, each being a vector of spike times (in seconds) computed for +a duration of \texttt{tmax} seconds. The input current is set via the +\texttt{current} variable, the strength of the intrinsic noise via +\texttt{Dnoise}. If \texttt{current} is a single number, then an input +current of that intensity is simulated for \texttt{tmax} +seconds. Alternatively, \texttt{current} can be a vector containing an +input current that changes in time. In this case, \texttt{tmax} is +ignored, and you have to provide a value for the input current for +every 0.0001\,seconds. + +Think of calling the \texttt{lifspikes()} function as a simple way of +doing an electrophysiological experiment. You are presenting a +stimulus with a constant intensity $I$ that you set. The neuron +responds to this stimulus, and you record this response. After +detecting the timepoints of the spikes in your recordings you get what +the \texttt{lifspikes()} function returns. In addition you can record +from different neurons with different noise properties by setting the +\texttt{Dnoise} parameter to different values. +\begin{questions} + \question Tuning curves \begin{parts} \part First set the noise \texttt{Dnoise=0} (no noise). Compute and plot the neuron's $f$-$I$ curve, i.e. the mean firing rate @@ -64,37 +65,43 @@ spikes = lifspikes(trials, current, tmax, Dnoise); \part Compute the $f$-$I$ curves of neurons with various noise strengths \texttt{Dnoise}. Use for example $D_{noise} = 10^{-3}$, - $10^{-2}$, and $10^{-1}$. + $10^{-2}$, and $10^{-1}$. Depending on the resulting curves you + might want to try additional noise levels. - How does the intrinsic noise influence the response curve? + How does the intrinsic noise level influence the tuning curves? What are possible sources of this intrinsic noise? \part Show spike raster plots and interspike interval histograms of the responses for some interesting values of the input and the noise strength. For example, you might want to compare the - responses of the four different neurons to the same input, or by - the same resulting mean firing rate. + responses of the different neurons to the same input, or by the + same resulting mean firing rate. How do the responses differ? + \end{parts} + + \question Subthreshold stochastic resonance + + Let's now use as an input to the neuron a 1\,s long sine wave $I(t) + = I_0 + A \sin(2\pi f t)$ with offset current $I_0$, amplitude $A$, + and frequency $f$. Set $I_0=5$, $A=4$, and $f=5$\,Hz. - \part Let's now use as an input to the neuron a 1\,s long sine - wave $I(t) = I_0 + A \sin(2\pi f t)$ with offset current $I_0$, - amplitude $A$, and frequency $f$. Set $I_0=5$, $A=4$, and - $f=5$\,Hz. - - Do you get a response of the noiseless ($D_{noise}=0$) neuron? + \begin{parts} + \part Do you get a response of the noiseless ($D_{noise}=0$) neuron? - What happens if you increase the noise strength? + \part What happens if you increase the noise strength? - What happens at really large noise strengths? + \part What happens at really large noise strengths? - Generate some example plots that illustrate your findings. + \part Generate some example plots that illustrate your findings. - Explain the encoding of the sine wave based on your findings + \part Explain the encoding of the sine wave based on your findings regarding the $f$-$I$ curves. - \end{parts} + \part Why is this phenomenon called ``subthreshold stochastic resonance''? + + \end{parts} \end{questions}