Sampling and simulation exercises
About DataSAI for Neuroscience Summer School 2025
Polars and split-apply-combine
1
Introduction to data frames and Polars
2
Tidy data and split-apply-combine
3
Polars for Pandas users
Data display
4
Making plots with Bokeh
5
High level plotting with iqplot
6
Styling Bokeh plots
7
Dealing with overplotting
Data file formats
8
Example file format: MAT-files
9
Example file format: TDT files
10
Example file format: NWB files
Probability: The foundation for generative modeling
11
Probability as the logic of science
12
Probability distributions
13
Entropy and the Kullback-Leibler divergence
Sampling out of probability distributions
14
Random number generation
15
Random number generation using Numpy
Simulating generative distributions
16
Simulating the Luria-Delbrück distribution
17
The noisy leaky integrate-and-fire model
18
Modeling nonhomogeneous Poisson spiking
Markov chain Monte Carlo
19
The basics of Markov chain Monte Carlo
20
“Hello, world” —Stan
21
Nonhomogeneous Poisson process arrival times with Stan
Bayesian modeling and inference
22
Basics of Bayesian modeling
23
Conjugacy
24
Choosing priors
25
What about machine learning and artificial intelligence?
26
Bayes's theorem as a model for learning
27
Model building with prior predictive checks
Statistical inference with Markov chain Monte Carlo
28
Parameter estimation with Markov chain Monte Carlo I
29
Reporting summaries of the posterior
30
Posterior predictive checks
31
Parameter estimation with Markov chain Monte Carlo II
Principled inference pipelines
32
MCMC diagnostics via a case study: Artificial funnel of hell
33
Principled analysis pipelines
34
Simulation based calibration and related checks in practice
Model assessment
35
Model comparison
36
Model comparison in practice
Summarizing posterior distributions with maxima
37
Bayesian approach to parameter estimation by optimization
38
Parameter estimation by optimization case study: Gamma likelihood
39
Minorize-maximize algorithms
40
The expectation-maximization (EM) algorithm
41
EM applied to a Gaussian mixture model
42
An example application of the EM algorithm to a Gaussian mixture model
43
K-means clustering
Hierarchical models
44
Modeling repeated experiments
45
Choosing a hierarchical prior
46
Implementation of hierarchical models
47
Generalization of hierarchical models
48
Implementation of a hierarchical model
Principal component analysis and related models
49
Principal component analysis: A heuristic approach
50
Factor analysis
51
Special cases of factor analysis
Hidden Markov models
52
Hidden Markov models
Generalized linear models
53
Generalized linear models: An introduction
54
GLMs applied to neurons and aggression
Polars and split-apply-combine exercises
55
Mastering selection and filtering of data frames
56
Split-Apply-Combine of the frog data set
57
Adding data to a data frame
58
Palmer penguins and split-apply-combine
Data visualization exercises
59
Plotting with Palmer penguins
60
Exploratory data analysis of a zebrafish sleep study
File formats exercises
61
Opening a 7z file
Probability exercises
62
Censored and truncated distributions
63
Distributions of interspike intervals
64
Entropy of the Normal distribution
Sampling and simulation exercises
65
Exploring tails of distributions
66
Spike timing with a refractory period
67
The noisy LIF model and the Inverse Gaussian distribution
Introductory MCMC exercises
68
Sampling out of a bivariate Normal distribution
69
Funnel of hell
Bayesian modeling exercises
70
Working with Boolean data
71
An Inverse Gaussian model for spiking: Prior predictive checks
72
Building a changepoint model
73
Building a model for aggression
Inference with MCMC exercises
74
A Gamma model for spiking
75
Exponential ISIs and Gamma priors
76
Inferring a changepoint
Optimization exercises
77
Optimization and spiking
78
Heavy-tailed distributions and outliers
Hierarchical exercises
79
Hierarchical models are hiding in plain sight
80
Modeling pole descent
PCA exercises
81
Downsampling and PCA with spiking and EMG/ ephys data
82
PCA on time series
HMM exercises
83
The probability of standing still
84
Simulating HMMs
GLM exercises
85
A GLM connecting neuronal activity and movement
86
GLM for EMG data
Appendices
Notation
A
Notation
Computing
B
Configuring your computer to use Python for scientific computing
C
Hello, world.
D
Variables, operators, and types
E
Lists and tuples
F
Iteration
G
Introduction to functions
H
String methods
I
Dictionaries
J
Comprehensions
K
Packages and modules
L
Errors and exception handling
M
File I/O
N
Introduction to Numpy and Scipy
Sampling and simulation exercises
Following is a sample of sampling exercises you can do.
64
Entropy of the Normal distribution
65
Exploring tails of distributions