├── .gitignore
├── LICENSE
├── README.md
└── code
├── MATLAB
├── PoissonProcessesTutorial.m
├── SignalAndNoiseTutorial.m
└── SignalAndNoiseTutorial[Conflict].m
└── Python
├── PoissonProcessesTutorial.ipynb
├── ProbabilityDistributionsTutorial.ipynb
└── ReceptiveFields.ipynb
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | # Byte-compiled / optimized / DLL files
4 | __pycache__/
5 | *.py[cod]
6 | *$py.class
7 |
8 | # C extensions
9 | *.so
10 |
11 | # Distribution / packaging
12 | .Python
13 | build/
14 | develop-eggs/
15 | dist/
16 | downloads/
17 | eggs/
18 | .eggs/
19 | lib/
20 | lib64/
21 | parts/
22 | sdist/
23 | var/
24 | wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | .hypothesis/
50 | .pytest_cache/
51 |
52 | # Translations
53 | *.mo
54 | *.pot
55 |
56 | # Django stuff:
57 | *.log
58 | local_settings.py
59 | db.sqlite3
60 |
61 | # Flask stuff:
62 | instance/
63 | .webassets-cache
64 |
65 | # Scrapy stuff:
66 | .scrapy
67 |
68 | # Sphinx documentation
69 | docs/_build/
70 |
71 | # PyBuilder
72 | target/
73 |
74 | # Jupyter Notebook
75 | .ipynb_checkpoints
76 |
77 | # pyenv
78 | .python-version
79 |
80 | # celery beat schedule file
81 | celerybeat-schedule
82 |
83 | # SageMath parsed files
84 | *.sage.py
85 |
86 | # Environments
87 | .env
88 | .venv
89 | env/
90 | venv/
91 | ENV/
92 | env.bak/
93 | venv.bak/
94 |
95 | # Spyder project settings
96 | .spyderproject
97 | .spyproject
98 |
99 | # Rope project settings
100 | .ropeproject
101 |
102 | # mkdocs documentation
103 | /site
104 |
105 | # mypy
106 | .mypy_cache/
107 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NeuroscienceTeachingCode
2 | This is a repository containing MATLAB and Python code used in teaching graduate students in neuroscience.
3 |
4 | The directory structure is organized according to language in the ./code subdirectories. Python code is contained within Jupyter notebooks, which were originally written to run on Google's Collaboratory framework.
--------------------------------------------------------------------------------
/code/MATLAB/PoissonProcessesTutorial.m:
--------------------------------------------------------------------------------
1 | % PoissonProcessesTutorial.m
2 | % by Mike Manookin 11/2019
3 |
4 |
5 | % Before we get into Poisson distributions and the processes they describe,
6 | % we need to first introduce Gaussian distributions. The reason is that
7 | % Poisson distributions are just a special type of Gaussian distribution.
8 | % This is the equation for a Gaussian distribution:
9 |
10 | % f(x) = 1/sqrt(2*pi*sigma^2) * exp(-(x - mu).^2/(2*sigma^2))
11 | % mu is the mean of the distribution
12 |
13 | % sigma is the standard deviation of the distribution
14 |
15 | % It's alright if equations aren't your thing. The thing to remember is
16 | % that you have some distribution of your data and that there is a
17 | % mean/average (mu) and another parameter describing how spread out the
18 | % distribution is---the standard deviation (sigma). The following code
19 | % allows us to play with those two parameters and see how it affects the
20 | % Gaussian distribution. Go ahead and change 'mu' and 'sigma' and then run
21 | % the code to see how the distribution changes.
22 |
23 | % A Poisson distribution is a special type of Gaussian distribution in which the
24 | % mean and variance are equal. Many physical and biological phenomena are well-
25 | % described by Poisson distributions.
26 |
27 | % Let's make our own Gaussian function. We can define the function as a
28 | % separate piece of code or define an 'anonymous function' in the current
29 | % code. I'll do the latter to show you how it works. (It can come in really
30 | % handy.)
31 | gaussfun = @(p,x)(1/sqrt(2*pi*p(2)^2) * exp(-(x - p(1)).^2/(2*p(2)^2)));
32 |
33 | % We can now pass x-axis values (x) and parameters for the Gaussian (p) to
34 | % the anonymous function and get our output.
35 | % Note:
36 | % p(1) = mean
37 | % p(2) = standard deviation
38 |
39 | % First, let's try to unpack the Poisson distribution a bit by making a generic
40 | % Gaussian distribution with a mean (mu) and standard deviation (sigma). Choose
41 | % whatever numbers you like.
42 | mu = 2.0;
43 | sigma = 2.6;
44 |
45 | % Define the x-axis.
46 | x = -10:0.1:10;
47 |
48 | % Pass the parameters to our anonymous function:
49 | y = gaussfun([mu,sigma],x);
50 |
51 | figure(100); clf;
52 | hold on
53 | plot(x,y);
54 | hold off;
55 | xlabel('Gaussian distribution');
56 |
57 | %%
58 | % Instead of using a function, we can also generate a bunch of random
59 | % numbers that have a Gaussian distribution using MATLAB's built-in 'randn'
60 | % function. If you want more information about any function type 'help
61 | % functionName' or 'doc functionName' into the command window (e.g.,
62 | % >> doc randn
63 |
64 | % Generate 10^5 random numbers.
65 | y2 = sigma * randn(1,1e5) + mu;
66 |
67 | % Let's plot the histogram of the numbers we generated and then plot the
68 | % function as well.
69 |
70 | figure(100); clf;
71 | hold on
72 | histogram(y2, 50, 'Normalization', 'probability'); axis tight;
73 | plot(x, y/max(y)*max(ylim), 'b', 'LineWidth', 2); % Need to scale to the same maximum value as the histogram
74 | hold off;
75 | xlabel('Gaussian distribution'); ylabel('probability');
76 |
77 | %%
78 | % Go ahead and play around with the parameters for the Gaussian distribution.
79 | % What you'll notice as you change the parameters, is that the values along
80 | % the x-axis change, but the general, bell-curve, shape stays the same.
81 |
82 | % A Poisson distribution is just a special case in which the mean and
83 | % variance are equal. The standard deviation ( sigma ) is the square root
84 | % of the variance and, since the mean and variance are equal, it is also
85 | % the square root of the mean ( mu ).
86 |
87 | % Define the mean/variance.
88 | mu = 3.0;
89 |
90 | % The standard deviation (sigma) is just the square root of this value.
91 | sigma = sqrt(mu);
92 |
93 | % Let's do the same thing now for our Poisson distribution.
94 | y = gaussfun([mu,sigma],x);
95 | y2 = sigma * randn(1,1e5) + mu;
96 |
97 | % Let's plot the histogram of the numbers we generated and then plot the
98 | % function as well.
99 |
100 | figure(100); clf;
101 | hold on
102 | histogram(y2, 50, 'Normalization', 'probability'); axis tight;
103 | plot(x, y/max(y)*max(ylim), 'b', 'LineWidth', 2); % Need to scale to the same maximum value as the histogram
104 | hold off;
105 | xlabel('Gaussian distribution'); ylabel('probability');
106 |
107 | %
108 | % All that's happened is that we've constrained the Gaussian distribution
109 | % to have only one free parameter instead of two. Wasn't that easy?!
110 |
111 | % So, why did I make you learn this then? Well, it turns out that there are
112 | % many physical processes that are well described with Poisson statistics.
113 | % Here are a few examples that are relevant to you and me:
114 | %
115 | % 1) In physics, the frequency of photon arrivals.
116 | % 2) Neural spike counts (not exactly due to the refractory period)...
117 | % 3) Frequency of vesicle release at synapses
118 |
119 | % Let's look at concrete example. Photon arrivals at a detector obey
120 | % Poisson statistics so let's simulate a distribution of photon counts
121 | % based on a mean values. Now, if we're talking about photon counts in,
122 | % say, a 100 ms window, we aren't going to observe any counts that are less
123 | % than zero, so we can clip the negative values out.
124 |
125 | mu = 5.0;
126 | sigma = sqrt(mu);
127 |
128 | y2 = sigma * randn(1,1e5) + mu;
129 |
130 | % Photon counts are discrete (integers), so let's round.
131 | y2 = round(y2);
132 |
133 | % We can't have negative photon counts, so set them to zero.
134 | y2(y2 < 0) = 0;
135 |
136 | % Let's get the underlying function too.
137 | x = min(y2) : 0.1 : max(y2);
138 | y = gaussfun([mu,sigma],x);
139 |
140 | figure(100); clf;
141 | hold on
142 | histogram(y2, max(y2)+1, 'Normalization', 'probability'); axis tight;
143 | plot(x(x>=0), y(x>=0)/max(y)*max(ylim), 'b', 'LineWidth', 2); % Need to scale to the same maximum value as the histogram
144 | hold off;
145 | xlabel('Gaussian distribution'); ylabel('probability');
146 |
147 | % That's all there is to it. We can see the probability (y-axis) that we
148 | % observe x number of photons (x-axis). This type of visualization can be
149 | % very helpful as we try to understand neural systems, etc. There are many
150 | % examples of this, but for the time being I would like you to become
151 | % comfortable with this concept. So, please play around with the code to
152 | % familiarize yourself with how things change as we shift the parameters
153 | % around.
154 |
155 | % Gaussian functions will keep coming up, not just in understanding
156 | % neuroscience concepts, but also in your data analysis. For example, many
157 | % of the tools that simplify statistical calculations (such as t-tests)
158 | % assume that your data conforms to a Gaussian distribution. If you're not
159 | % certain that this is the case, then you need to use other methods.
160 |
161 | %% Cumulative distribution functions
162 | % So far in this tutorial, we have explored Gaussian/Poisson probability
163 | % density functions (PDF). Now, we want to turn our attention to the
164 | % cumulative distribution functions (CDF) for these distributions.
165 |
166 | % So what is a cumulative distribution function?
167 | %
168 | % To answer that question, let's back up and give an example of a Gaussian
169 | % distribution. The classic example, of course, is the distribution of
170 | % IQ's. The mean IQ is, by definition, 100 and the standard deviation is
171 | % 15. Let's make a little IQ PDF/distribution.
172 | mu = 100;
173 | sigma = 15;
174 |
175 | x = 0:200;
176 | y = gaussfun([mu,sigma],x);
177 | y = y/sum(y); % Area under the curve must equal 1.
178 |
179 | figure(100); clf;
180 | hold on
181 | plot(x, y, 'b', 'LineWidth', 2); % Need to scale to the same maximum value as the histogram
182 | hold off;
183 | xlabel('distribution of IQ scores'); ylabel('probability');
184 |
185 | %%
186 | % Alright, let's now look at the probability of a person having an IQ of
187 | % exactly 120.
188 | p120 = y(x == 120)
189 |
190 | % For our example, that turns out to be about 1%... It turns out that the
191 | % 120 threshold is pretty important... In Malcolm Gladwell's book
192 | % 'Outliers' he cites studies indicating that up to 120, IQ is a reliable
193 | % predictor of a person's success, but above that threshold, it no longer
194 | % correlates with success. The argument is that the IQ test captures
195 | % something about intelligence, but there are aspects of intellect that it
196 | % does not assess adequately. I digress, but it's a fun read.
197 |
198 | % OK, so what if we wanted to know what percentage of the population have
199 | % an IQ less than 120? How would we calculate that? Well, knowing the value
200 | % at 120, isn't particularly informative... This is where the cumulative
201 | % distribution function becomes useful.
202 |
203 | % To find the probability of someone having an IQ less than 120, we need to
204 | % take the definite integral from [0,119]. This calculates the area under
205 | % the distribution (i.e., cumulative distribution function) from 0 to 119.
206 | cumPr120 = sum(y(x <= 120))
207 |
208 | % That gives us a value of 0.90, meaning that 90% of the population has an
209 | % IQ less than 120. We could do the same thing and get the probability that
210 | % a random person on the street has an IQ less than or equal to any value.
211 | % One way to calculate this would be in a 'for' loop:
212 |
213 | cumPr = zeros(size(x)); % Good practice to pre-allocate memory...
214 | for k = 1 : length(x) % This is looping through each value in x...
215 | cumPr(k) = sum(y(x <= x(k)));
216 | end
217 |
218 | % Let's look at the result.
219 | figure(100); clf;
220 | hold on
221 | plot(x, cumPr, 'b', 'LineWidth', 2);
222 |
223 | % Let's highlight the value at 120 for fun.
224 | plot(120, cumPr(x == 120), 'ko');
225 | plot(120*ones(1,2), [0 cumPr(x == 120)],'k--');
226 | plot([0 120], cumPr(x == 120)*ones(1,2),'k--');
227 |
228 | hold off;
229 | xlabel('IQ score'); ylabel('cumulative probability');
230 |
231 | % I've highlighted the value at 120 to illustrate what we discussed above.
232 | % This is the cumulative distribution function (CDF) for the Gaussian
233 | % distribution that we looked at earlier. That's all there is to it!!
234 |
235 | %%
236 | % It turns out that there are several ways to calculate the CDF. The for
237 | % loop example above is one way, and I would like to show you two other
238 | % ways of doing the calculation. Both ways are easier than the for loop
239 | % example:
240 |
241 | % 1) 'cumsum': Matlab has a built-in function called 'cumsum' that does
242 | % exactly what we did in the for loop, but using this function just means
243 | % fewer lines of code that we have to write. Let's do it!
244 | cumPrCumSum = cumsum(y);
245 |
246 | % Let's plot the output from our for loop above and the new way to make
247 | % sure they align.
248 |
249 | figure(100); clf;
250 | hold on
251 | plot(x, cumPr, 'b', 'LineWidth', 2);
252 | plot(x, cumPrCumSum, 'r', 'LineWidth', 2);
253 | hold off;
254 | xlabel('IQ score'); ylabel('cumulative probability');
255 |
256 | % Yep. We only see one curve, because the two curves are identical. Here's
257 | % the second way.
258 |
259 | % 2) 'normcdf': This function generates a Gaussian (also called 'Normal')
260 | % cumulative distribution function based on mean and standard deviation.
261 | % Check it out.
262 | cumPrFun = normcdf(x, mu, sigma);
263 |
264 | % Let's check this as well.
265 | figure(100); clf;
266 | hold on
267 | plot(x, cumPr, 'b', 'LineWidth', 2);
268 | plot(x, cumPrFun, 'r', 'LineWidth', 2);
269 | hold off;
270 | xlabel('IQ score'); ylabel('cumulative probability');
271 |
272 | % No big deal, right?! You're just taking the integral under the
273 | % distribution. Note: if you're dealing with a Poisson distribution, the
274 | % function is 'poisscdf'.
275 |
276 | %% Fitting a cumulative distribution function
277 |
278 | % One thing you'll be doing a lot of in your research is trying to model
279 | % your data. Imagine that you have some data that you want to present. The
280 | % first thing to do is show the data. Let's make some pretend data of some
281 | % IQ scores:
282 | dataHist = sigma * randn(1,1e3) + mu;
283 | [data, binEdges] = histcounts(dataHist, 100,'Normalization', 'cdf');
284 | x = (binEdges(1:end-1) + binEdges(2:end))/2; % Get the center of the bins.
285 |
286 | % Alright, we've created a cumulative distribution of IQ scores. Now, let's
287 | % fit the data. I'll show you two different functions that I typically use
288 | % for nonlinear fitting...
289 |
290 | % Another anonymous function.
291 | fitfun = @(p,x)(normcdf(x,p(1),p(2)));
292 |
293 | % 1) 'nlinfit'
294 | params = nlinfit(x,data,fitfun,[100 15]);
295 |
296 | % Let's take a look at our fitted parameters:
297 | params
298 |
299 | % Hopefully, they're pretty close to the mu and sigma values we used to
300 | % generate our pretend data.
301 |
302 | % 2) 'lsqcurvefit'
303 | params2 = lsqcurvefit(fitfun,[100 15],x,data);
304 | params2
305 |
306 | % Let's see how good our fits were.
307 | figure(100); clf;
308 | hold on
309 | plot(x, data, 'b.');
310 | plot(x, fitfun(params,x), 'r', 'LineWidth', 1);
311 | hold off;
312 | xlabel('IQ score'); ylabel('cumulative probability');
313 |
314 | % There! We fit the data. That's all there is to it. The two fitting
315 | % function each have their own advantages and I'm happy to discuss those,
316 | % but for now, I just wanted you to see the process in action.
317 |
318 |
--------------------------------------------------------------------------------
/code/MATLAB/SignalAndNoiseTutorial.m:
--------------------------------------------------------------------------------
1 | % SignalAndNoiseTutorial.m
2 | % by Mike Manookin 11/2019
3 |
4 | x = 0 : 10;
5 |
6 | p1 = poisspdf(x, 1);
7 |
8 |
9 | p2 = poisspdf(x, 2);
10 |
11 | x = 0:2;
12 | y = [0.81 0.17 0.02 0.64 0.28 0.08];
13 |
14 | % Let's define anonymous functions.
15 |
16 | % This would be for the single-photon condition.
17 | pfun1 = @(m,k)([(m.^k * exp(-m))./factorial(k),((2*m).^k * exp(-2*m))./factorial(k)]);
18 |
19 | % This would be for the coincident model:
20 | pfun2 = @(m,k)([(m.^k * exp(-m))./factorial(k)+(m.^(k-1) * exp(-m))./factorial(k-1),((2*m).^k * exp(-2*m))./factorial(k)+((2*m).^(k-1) * exp(-2*m))./factorial(k-1)]);
21 |
22 | m = 0.21;
23 |
24 | % Single-photon model.
25 | p1 = 0;
26 |
27 |
28 |
29 | % Let's generate data from Equation 10 from Baylor et al 1979:
30 | m = 0.53;
31 | a = 1.2;
32 | sigma0 = 0.15;
33 | sigma1 = 0.3;
34 | x = -1:0.1:3;
35 |
36 | p = zeros(1, length(x));
37 | for j = 1 : length(x)
38 | r = x(j);
39 | for k = 0:3
40 | p(j) = p(j) + (exp(-m)*m^k)/factorial(k) .* 1./(2*pi*(sigma0^2+k*sigma1^2)).^0.5 .* exp(-(r - k*a).^2 / (2*(sigma0^2 + k*sigma1^2)));
41 | end
42 | end
43 |
44 | % Divide by the number of k's you've iterated over..
45 | p = p / 4;
46 |
47 | figure(1); clf;
48 | plot(x,p)
49 |
50 |
--------------------------------------------------------------------------------
/code/MATLAB/SignalAndNoiseTutorial[Conflict].m:
--------------------------------------------------------------------------------
1 | % SignalAndNoiseTutorial.m
2 | % by Mike Manookin 11/2019
3 |
4 | x = 0:2;
5 | y = [0.81 0.17 0.02 0.64 0.28 0.08];
6 |
7 | % Let's define anonymous functions.
8 |
9 | % This would be for the single-photon condition.
10 | pfun1 = @(m,k)([(m.^k * exp(-m))./factorial(k),((2*m).^k * exp(-2*m))./factorial(k)]);
11 |
12 | % This would be for the coincident model:
13 | pfun2 = @(m,k)([(m.^k * exp(-m))./factorial(k)+(m.^(k-1) * exp(-m))./factorial(k-1),((2*m).^k * exp(-2*m))./factorial(k)+((2*m).^(k-1) * exp(-2*m))./factorial(k-1)]);
14 |
15 | m = 0.21;
16 |
17 | % Single-photon model.
18 | p1 = 0;
19 |
20 |
21 |
--------------------------------------------------------------------------------
/code/Python/ProbabilityDistributionsTutorial.ipynb:
--------------------------------------------------------------------------------
1 | {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"ProbabilityDistributionsTutorial.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"_O2wjKwgPJsP"},"source":["# **Probability distributions**\n","\n","Today we're going to focus on three general probability distributions and two special types of those distributions: \n","\n","1. **Gaussian distributions**\n","2. **Poisson distribution**\n","3. **Uniform distributions**\n","4. **Binomal distributions**\n"," * Special case: **Bernoulli distribution**\n","\n","\n","## **Normal (Gaussian) distributions**\n","The Gaussian distribution is arguably the most useful probability distributions out there. The reason is that many random processes are described well by a Gaussian distribution when the number of samples is large (for more on why, look up the central limit theorem).\n","\n","When data have a Gaussian distribution, there are some extra mathematical tricks that we can use to analyze those data. One of the reasons for this is that (if we have sampled the data sufficiently) we can describe the data with two variables: the mean ($\\mu$) and the variance ($\\sigma^2$).\n","\n","This is the equation for a Gaussian distribution:\n","\n","$f(x) = \\frac{1}{\\sigma \\sqrt{2 \\pi}}e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}$\n","\n","$\\mu$ is the mean of the distribution\n","\n","$\\sigma$ is the standard deviation of the distribution (square root of the variance)\n","\n","It's alright if equations aren't your thing. The thing to remember is that you have some distribution of your data and that there is a mean/average ($\\mu$) and another parameter describing how spread out the distribution is---the standard deviation ($\\sigma$). The following code allows us to play with those two parameters and see how it affects the Gaussian distribution. Go ahead and change 'mu' and 'sigma' and then push the \"play\" button to see how the distribution changes."]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":296},"id":"t9TqkEblIR8y","executionInfo":{"status":"ok","timestamp":1630553613765,"user_tz":420,"elapsed":1364,"user":{"displayName":"Mike Manookin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Ggqm5Gu3fF6zZeMUl4BlfJw_UYWrxC4O6YnC9Zsbg=s64","userId":"13097636622245819913"}},"outputId":"f62e0405-17b9-46d4-a2b2-2186840e7b91"},"source":["# Numpy module\n","import numpy as np\n","\n","# Seaborn for visualizing distributions\n","import seaborn as sns\n","\n","numSamples = 10000;\n","numBins = 25;\n","\n","# The distribution mean\n","mu = 1.0\n","\n","# The standard deviation (sigma).\n","sigma = 0.3\n","\n","# 'randn' just generates a bunch of random numbers that have a Gaussian distribution\n","y = sigma * np.random.randn(numSamples) + mu\n","\n","\n","ax = sns.histplot(data=y, stat=\"probability\", bins=numBins, kde=True, element='poly')\n","ax.set(xlabel='Gaussian distribution')"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[Text(0.5, 0, 'Gaussian distribution')]"]},"metadata":{},"execution_count":1},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29m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PygD9LbGa0W4gVrgHPq2qrqvYA24HpQ547D9ivqnucYSRO9sd0uAwDlqtq90nWPaGq3c4f/BeJzc9xOi4GHlPVTmcwvUeB9znr9qvqwJAR64DK03wPM4FYgTDj0TbgxPSLqvpV4DKg2Fn0DaARWEzsyCHgLA/z9s90yHl+mNgfzUeAjwHPOsv/Cfg2sRE11zlHGoN9F3hRVc8GPj7weo7eQfcjnObReAIZBnSe6mXiPI67L87AqPy8ZmKxAmHGoxeAkIj886BlmYPu5wH1qholNiDawDfvg8ACic0Dnk+sqAyMyZ/nDC39DWKFBRGZpaprVPVGoJm3D7088D4Dwy9fO8KfYSdQKSKznMefjbfRSTK0AzkjeK9lIhJyisslxEbXjbsvHCd7/VeAT4hIpohkEWuWe2UEOUyKsQJhxh2nSeYTwAdEZL+IvEVsgqFvOZv8GviSiGwi1pTT6TzvMPAwsNX5d4OzfQ7wlIhsBl4Fvuks/4mIbHGakF4HNg2J8mPgByKygRF+Y3aanq4DnnY6qZtOsmm8DC8S++O+UUSuTuDtNjvPeRP4rqrWnWJfANwBPDvQST0o83pi80m/RWz2sztVdfDzTJqx0VyNMcbEZUcQxhhj4rICYYwxJi4rEMYYY+KyAmGMMSYuKxDGGGPisgJhjDEmLisQxhhj4vp/3NHhtQGUE6sAAAAASUVORK5CYII=\n","text/plain":[""]},"metadata":{"needs_background":"light"}}]},{"cell_type":"markdown","metadata":{"id":"mTzeQHlO186Q"},"source":["Go ahead and play around with the parameters for the Gaussian distribution. What you'll notice as you change the parameters, is that the values along the x-axis change, but the general, bell-curve, shape stays the same.\n","\n","Gaussian functions will keep coming up, not just in understanding neuroscience concepts, but also in your data analysis. For example, many of the tools that simplify statistical calculations (such as t-tests) assume that your data conforms to a Gaussian distribution. If you're not certain that this is the case, then you need to use other methods.\n","\n","\n","\n","## **Poisson distributions**\n","\n","A Poisson distribution is a very important type of distribution in neuroscience. This type of distribution is discrete, meaning that every data entry is an integer value such as 0, 1, 2... (not 1.3439034).\n","\n","Why is the Poisson distribution so useful? Well, it turns out that there are many physical processes that are well described with Poisson statistics. Here are a few examples that are relevant to you and me:\n","\n","1) In physics, the frequency of photon arrivals.\n","\n","2) Neural spike counts (not exactly due to the refractory period)...\n","\n","3) Frequency of vesicle release at synapses\n","\n","One of the key properties of the Poisson distribution is how many variables are required to describe them. You'll recall from our discussion of Gaussian distributions that we need two numbers to describe them: 1) the mean ($\\mu$) tells you where the distribution is centered and 2) the variance ($\\sigma^2$) tells you how spread out the distribution is. Well, a Poisson distribution is even easier, you just need one number to describe it because the mean and variance are equal.\n","\n","The standard deviation ($\\sigma$) is the square root of the variance and, since the mean and variance are equal, it is also the square root of the mean ($\\mu$).\n","\n","$\\sigma^2 = \\mu$\n","\n","$\\sigma = \\sqrt{\\mu}$\n","\n","\n","Let's look at concrete example. Photon arrivals at a detector obey Poisson statistics so let's simulate a distribution of photon counts based on a mean values."]},{"cell_type":"code","metadata":{"id":"ytTYtvzNamwT","colab":{"base_uri":"https://localhost:8080/","height":296},"executionInfo":{"status":"ok","timestamp":1630536801243,"user_tz":420,"elapsed":967,"user":{"displayName":"Mike Manookin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Ggqm5Gu3fF6zZeMUl4BlfJw_UYWrxC4O6YnC9Zsbg=s64","userId":"13097636622245819913"}},"outputId":"40ec2c38-9bc1-43e8-fc4c-9c3335295dd3"},"source":["# Numpy module\n","import numpy as np\n","\n","import math\n","\n","# Seaborn for visualizing distributions\n","import seaborn as sns\n","\n","numSamples = 10000;\n","\n","# Define the mean/variance of the distribution\n","mu = 3.0\n","\n","# This is a way of generating a Poisson distribution.\n","y = np.random.poisson(mu, size=numSamples)\n","\n","ax = sns.histplot(data=y, stat=\"probability\", discrete=True)\n","ax.set(xlabel='photon count per bin')\n"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[Text(0.5, 0, 'photon count per bin')]"]},"metadata":{},"execution_count":56},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAA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2QvdVqInV3N320qp425lImSgYviVo91YYizSfPMCRJTTzDkCQ18QxDktTEwJAkNTEwJElNDAxJUhMDQ5LU5P8DEGaloLRFexAAAAAASUVORK5CYII=\n","text/plain":[""]},"metadata":{"needs_background":"light"}}]},{"cell_type":"markdown","metadata":{"id":"d8tmgh8Gsa5v"},"source":["## **Uniform distributions**\n","\n","Data can also be distributed uniformly: a case in which all of the possible outcomes are equally likely. If we think of this in the context of the photon count example above, having a count of {0,1,2,...} would occur with equal probability. \n","\n","Let's look at some code for generating a visualizing data with a uniform distribution.\n","\n"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":296},"id":"VctlcwJxNBJ1","executionInfo":{"status":"ok","timestamp":1630536390831,"user_tz":420,"elapsed":428,"user":{"displayName":"Mike Manookin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Ggqm5Gu3fF6zZeMUl4BlfJw_UYWrxC4O6YnC9Zsbg=s64","userId":"13097636622245819913"}},"outputId":"c58248b5-8130-469d-db0d-00ea888b4307"},"source":["# Numpy module\n","import numpy as np\n","\n","# Seaborn for visualizing distributions\n","import seaborn as sns\n","\n","numSamples = 10000;\n","numBins = 25;\n","\n","y = np.random.rand(numSamples)\n","\n","\n","ax = sns.histplot(data=y, stat=\"probability\", bins=numBins, kde=False, element='poly')\n","ax.set(xlabel='Uniform distribution')"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[Text(0.5, 0, 'Uniform distribution')]"]},"metadata":{},"execution_count":52},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3wc9Z3/8ddHktVlSZblbmODW0wHhzQgEEqAAx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FBiZ+UfROx/6x1gXptlyoDTgMnu7mZW4u7bzWwG8LS7PxosB5Dt7lOD+9PbbHN+UNeRwD3ExpjancuA/XbuQdknL5D1w9jL5Pub2WTgeTObGMw7iNjeVxOw1Mx+7+7xo4JKH6c9COnpdneqf/z0x4Pf84CxHaxvEvChuy8L7t9H7IIrOz3cZvmdw3MsJHahlRp3rwSazKykzbJHAE+4e7277+DTYwFBbGj5RuBuM/s6saEPdqdtLfEehF3XAhgYUkuiDie2h4W7fwCsITZGE8CLwfhVjcQOffWpqw9KxxQQ0tNVAaVtpg0CtsTd3zkibYSu7xXXtbm/c93RuNs773f6uYLrjxxG7EJVJwPPdqKWT6wq5H4rn/yfzu1sfW3Eb28yXlvpZRQQ0qO5ey2w0cy+AmBmg4ATgNf3cJVLgbFmNj64/23glS4XGvMq8DUzyzOzIuCUtguYWSFQ7O4zgZ8ABwazaogNR56os4L1HU5sdM5qYDWxS0/uvDDSuATW/Rrwz8FjJgJjiL1GIvpGIL3CucBtZvbb4P7V7r5yT1bk7o1m9l1io9lmERsmuis9hOLX/Y6ZPUzsesibg3W3VQQ8FbSFGHBpMP0hYiON/huJ9TBqNLP5xEbt/F4w7TFiwzovBuYSu94D7l5lsavILSJ2BcHb4tZzO/AHM1tIbA/kO+7eZH3iCrzSVRrNVUREQukQk4iIhFJAiIhIKAWEiIiEUkCIiEgoBYSIiIRSQIiISCgFhIiIhPr/bnwattYNkV0AAAAASUVORK5CYII=\n","text/plain":[""]},"metadata":{"needs_background":"light"}}]},{"cell_type":"markdown","metadata":{"id":"XDBJuKJUBt06"},"source":["## **Binomial distributions**\n","\n","Binomial distributions are an important type of discrete distribution (as opposed to a continuous distribution, such as a Gaussian distribution).\n","\n","$f(k; p) = \\big( \\frac{n!}{k!(n-k)!} \\big) p^k (1 - p)^{n-k}$ for k $\\in$ {0, 1, ..., n}\n","\n","Let's look at an example of how this distribution might be used. Let's say I give you a coin and ask you to flip the coin five times (that's your $n$ variable). If you know it's a fair coin, what are the chances that you end up with zero heads or one heads, etc? That's your $k$ variable! \n"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":296},"id":"x2q1fAZ_Bscf","executionInfo":{"status":"ok","timestamp":1630986008348,"user_tz":420,"elapsed":882,"user":{"displayName":"Mike Manookin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Ggqm5Gu3fF6zZeMUl4BlfJw_UYWrxC4O6YnC9Zsbg=s64","userId":"13097636622245819913"}},"outputId":"0f9a917b-218a-4924-eeb0-bcf0c7b4af3a"},"source":["# Numpy module\n","import numpy as np\n","\n","# Seaborn for visualizing distributions\n","import seaborn as sns\n","\n","numSamples = 10000;\n","\n","n = 5\n","\n","# This is the probability that a value of '1' is observed. Go ahead and play \n","# with this value and see how the distribution changes. It needs to be a value \n","# between 0-1. For a fair coin, the value should be 0.5.\n","p = 0.5\n","\n","rng = np.random.default_rng()\n","y = rng.binomial(n, p, numSamples)\n","\n","ax = sns.histplot(data=y, stat=\"probability\", discrete=True)\n","ax.set(xlabel='Binomial distribution')"],"execution_count":1,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[Text(0.5, 0, 'Binomial distribution')]"]},"metadata":{},"execution_count":1},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAXRElEQVR4nO3de7RedX3n8feHIGDxUpSsLsiFRI2XMFjQQ2y9awXjVIl2cBK8LOiiC3WgxeXqmsHpFNpop4JVOzrYwpJMUbTB+2RNo5QR0FpEkiCCCUZDiiTBWaSCF4oCId/549mRx5OdnCfJ2ec55+T9Wuussy+/3z7fHRbnc/b+7ee3U1VIkjTaIcMuQJI0ORkQkqRWBoQkqZUBIUlqZUBIklod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AlwNf3jVIPYZ/o/dyoO/QG2vZNX7yV8A7mnqP7mt/PbBw1yD1qGP9IfD7zYywbwXOH+Dna5rzMVdJUiuvICRJrQwISVIrA0KS1MqAkCS1MiAkSa0MCElSKwNCktTq/wP35uj2+OgVaAAAAABJRU5ErkJggg==\n","text/plain":[""]},"metadata":{"needs_background":"light"}}]},{"cell_type":"markdown","metadata":{"id":"GQ6HV8U7aWri"},"source":["## **Bernoulli distribution**\n","\n","The Bernoulli distribution is a type of binomial distribution. Data with this distribution have values that are either 0 or 1.\n","\n","$f(k; p) = p^k (1 - p)^{1-k}$ for k $\\in$ {0, 1}\n","\n"]},{"cell_type":"code","metadata":{"id":"QboHmkDnavjQ","colab":{"base_uri":"https://localhost:8080/","height":296},"executionInfo":{"status":"ok","timestamp":1630539284255,"user_tz":420,"elapsed":382,"user":{"displayName":"Mike Manookin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Ggqm5Gu3fF6zZeMUl4BlfJw_UYWrxC4O6YnC9Zsbg=s64","userId":"13097636622245819913"}},"outputId":"9d570ff3-b800-4926-aa29-073e01dfe245"},"source":["# Numpy module\n","import numpy as np\n","\n","# Seaborn for visualizing distributions\n","import seaborn as sns\n","\n","numSamples = 10000;\n","\n","n = 1\n","\n","# This is the probability that a value of '1' is observed. Go ahead and play \n","# with this value and see how the distribution changes. It needs to be a value \n","# between 0-1\n","p = 0.1\n","\n","rng = np.random.default_rng()\n","y = rng.binomial(n, p, numSamples)\n","\n","ax = sns.histplot(data=y, stat=\"probability\")\n","ax.set(xlabel='Bernoulli distribution')"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[Text(0.5, 0, 'Bernoulli distribution')]"]},"metadata":{},"execution_count":59},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGx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R79t3/gvpa9x51VlzC4VPMTYFOSl8/SdHqf9vQcNcP2fe0HPPo6jvMaahExCPSE0V2XXsJgSvDNwL9L8tRu3/Ikzxz3WFX1AHB/kl/qNv1bYOrs4E7g57vlPQ3qjnINj05Y+MaZGiR5DrCzqj4K/A/ghcAPGUyTPa713XjEfsBJwP/qtv+/JM/rtr9mqP1sx7+DwdnSc7v14ddEDTMINN+mxghuAi4D3lRVj1TVl4FLgOuS3MLgI0X35pcnDKYaPz/JzQzGGc7rtv8RcGaSG9m3eevfAfx2V99snxD1BuDWrn/PZ/ARg98Hrklya5Lzx3ieLcCfALcD3wY+320/h8G7g67lsWMUlwJnd4PCh01trKoHGcxU+bmu5n8C9uodUVqcnH1UkhrnGYEkNc4gkKTGGQSS1DiDQJIaZxBIUuMMAklqnEEgSY37/+IygPeb6Df7AAAAAElFTkSuQmCC\n","text/plain":[""]},"metadata":{"needs_background":"light"}}]}]}
--------------------------------------------------------------------------------