Skip to content

Commit 421d98e

Browse files
committed
restructured example notebooks and changed internal links between them so they work
1 parent 94fdae4 commit 421d98e

File tree

68 files changed

+423
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+423
-344
lines changed

.error-books

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Notebooks that contain deliberate errors
2-
optimisation-on-a-loglikelihood
2+
optimisation/maximum-likelihood

.slow-books

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Slow notebooks
2-
automatic-differentiation-using-autograd.ipynb
3-
sampling-hamiltonian-mcmc.ipynb
4-
sampling-slice-doubling-mcmc.ipynb
5-
sampling-slice-overrelaxation-mcmc.ipynb
6-
sampling-slice-stepout-mcmc.ipynb
7-
stats-autoregressive-moving-average-errors.ipynb
8-
toy-model-beeler-reuter-ap.ipynb
9-
toy-model-fitzhugh-nagumo.ipynb
10-
toy-model-goodwin-oscillator.ipynb
11-
toy-model-hes1-michaelis-menten.ipynb
12-
toy-model-hodgkin-huxley-ik.ipynb
13-
toy-model-lotka-volterra.ipynb
14-
toy-model-repressilator.ipynb
2+
other-functionality/toy/automatic-differentiation-using-autograd.ipynb
3+
sampling/hamiltonian-mcmc.ipynb
4+
sampling/slice-doubling-mcmc.ipynb
5+
sampling/slice-overrelaxation-mcmc.ipynb
6+
sampling/slice-stepout-mcmc.ipynb
7+
other-functionality/stats/autoregressive-moving-average-errors.ipynb
8+
other-functionality/toy/model-beeler-reuter-ap.ipynb
9+
other-functionality/toy/model-fitzhugh-nagumo.ipynb
10+
other-functionality/toy/model-goodwin-oscillator.ipynb
11+
other-functionality/toy/model-hes1-michaelis-menten.ipynb
12+
other-functionality/toy/model-hodgkin-huxley-ik.ipynb
13+
other-functionality/toy/model-lotka-volterra.ipynb
14+
other-functionality/toy/model-repressilator.ipynb

examples/README.md

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -8,103 +8,101 @@ relevant code.
88

99

1010
## Getting started
11-
- [Optimisation: First example](./optimisation-first-example.ipynb)
12-
- [Sampling: First example](./sampling-first-example.ipynb)
13-
- [Writing a model](./writing-a-model.ipynb)
14-
- [Writing a custom LogPDF](./writing-a-logpdf.ipynb)
15-
- [Writing a custom LogPrior](./writing-a-prior.ipynb)
11+
- [Optimisation: First example](./optimisation/first-example.ipynb)
12+
- [Sampling: First example](./sampling/first-example.ipynb)
13+
- [Writing a model](./other-functionality/stats/custom-model.ipynb)
14+
- [Writing a custom LogPDF](./other-functionality/stats/custom-logpdf.ipynb)
15+
- [Writing a custom LogPrior](./other-functionality/stats/custom-prior.ipynb)
1616

1717

1818
## Optimisation
1919

2020
### Particle-based methods
21-
- [CMA-ES](./optimisation-cmaes.ipynb)
22-
- [PSO](./optimisation-pso.ipynb)
23-
- [SNES](./optimisation-snes.ipynb)
24-
- [XNES](./optimisation-xnes.ipynb)
21+
- [CMA-ES](./optimisation/cmaes.ipynb)
22+
- [PSO](./optimisation/pso.ipynb)
23+
- [SNES](./optimisation/snes.ipynb)
24+
- [XNES](./optimisation/xnes.ipynb)
2525

2626
### Local optimisers
27-
- [Nelder-Mead](./optimisation-nelder-mead.ipynb)
27+
- [Nelder-Mead](./optimisation/nelder-mead.ipynb)
2828

2929
### Further optimisation
30-
- [Ask-and-tell interface](./optimisation-ask-and-tell.ipynb)
31-
- [Convenience methods fmin() and curve\_fit()](./optimisation-convenience.ipynb)
32-
- [Multiple objectives](./optimisation-multi-objective.ipynb)
33-
- [Optimisation on a loglikelihood](./optimisation-on-a-loglikelihood.ipynb)
34-
- [Transformed parameter space](./optimisation-transformed-parameters.ipynb)
30+
- [Ask-and-tell interface](./optimisation/ask-and-tell.ipynb)
31+
- [Convenience methods fmin() and curve\_fit()](./optimisation/convenience.ipynb)
32+
- [Maximum loglikelihood](./optimisation/maximum-likelihood.ipynb)
33+
- [Multiple objectives](./optimisation/multi-objective.ipynb)
34+
- [Transformed parameter space](./optimisation/transformed-parameters.ipynb)
3535

3636

3737
## Sampling
3838

3939
### MCMC without gradients
40-
- [Differential Evolution MCMC](./sampling-differential-evolution-mcmc.ipynb)
41-
- [DREAM MCMC](./sampling-dream-mcmc.ipynb)
42-
- [Emcee Hammer](./sampling-emcee-hammer.ipynb)
43-
- [Haario Adaptive Covariance MCMC](./sampling-adaptive-covariance-haario.ipynb)
44-
- [Haario-Bardenet Adaptive Covariance MCMC](./sampling-adaptive-covariance-haario-bardenet.ipynb)
45-
- [Metropolis Random Walk MCMC](./sampling-metropolis-mcmc.ipynb)
46-
- [Population MCMC](./sampling-population-mcmc.ipynb)
47-
- [Rao-Blackwell Adaptive Covariance MCMC](./sampling-adaptive-covariance-rao-blackwell.ipynb)
48-
- [Slice Sampling: Stepout MCMC](./sampling-slice-stepout-mcmc.ipynb)
49-
- [Slice Sampling: Doubling MCMC](./sampling-slice-doubling-mcmc.ipynb)
50-
- [Slice Sampling: Overrelaxation MCMC](./sampling-slice-overrelaxation-mcmc.ipynb)
40+
- [Differential Evolution MCMC](./sampling/differential-evolution-mcmc.ipynb)
41+
- [DREAM MCMC](./sampling/dream-mcmc.ipynb)
42+
- [Emcee Hammer](./sampling/emcee-hammer.ipynb)
43+
- [Haario Adaptive Covariance MCMC](./sampling/adaptive-covariance-haario.ipynb)
44+
- [Haario-Bardenet Adaptive Covariance MCMC](./sampling/adaptive-covariance-haario-bardenet.ipynb)
45+
- [Metropolis Random Walk MCMC](./sampling/metropolis-mcmc.ipynb)
46+
- [Population MCMC](./sampling/population-mcmc.ipynb)
47+
- [Rao-Blackwell Adaptive Covariance MCMC](./sampling/adaptive-covariance-rao-blackwell.ipynb)
48+
- [Slice Sampling: Doubling MCMC](./sampling/slice-doubling-mcmc.ipynb)
49+
- [Slice Sampling: Overrelaxation MCMC](./sampling/slice-overrelaxation-mcmc.ipynb)
50+
- [Slice Sampling: Stepout MCMC](./sampling/slice-stepout-mcmc.ipynb)
5151

5252
### MCMC with gradients
53-
- [Hamiltonian MCMC](./sampling-hamiltonian-mcmc.ipynb)
54-
- [MALA MCMC](./sampling-mala-mcmc.ipynb)
55-
- [Monomial-Gamma HMC MCMC](./sampling-monomial-gamma-hmc.ipynb)
56-
- [Relativistic MCMC](./sampling-relativistic-mcmc.ipynb)
53+
- [Hamiltonian MCMC](./sampling/hamiltonian-mcmc.ipynb)
54+
- [MALA MCMC](./sampling/mala-mcmc.ipynb)
55+
- [Monomial-Gamma HMC MCMC](./sampling/monomial-gamma-hmc.ipynb)
56+
- [Relativistic MCMC](./sampling/relativistic-mcmc.ipynb)
5757

5858
### Nested sampling
59-
- [Ellipsoidal nested sampling](./sampling-nested-ellipsoidal-sampling.ipynb)
60-
- [Rejection nested sampling](./sampling-nested-rejection-sampling.ipynb)
59+
- [Ellipsoidal nested sampling](./sampling/nested-ellipsoidal-sampling.ipynb)
60+
- [Rejection nested sampling](./sampling/nested-rejection-sampling.ipynb)
6161

6262
### Analysing sampling results
63-
- [Autocorrelation](./plot-mcmc-autocorrelation.ipynb)
64-
- [Effective sample size](./sampling-effective-sample-size.ipynb)
65-
- [Pairwise scatterplots](./plot-mcmc-pairwise-scatterplots.ipynb)
66-
- [Pairwise scatterplots with KDE](./plot-mcmc-pairwise-kde-plots.ipynb)
67-
- [Predicted time series](./plot-mcmc-predicted-time-series.ipynb)
68-
- [Trace plots](./plot-mcmc-trace-plots.ipynb)
63+
- [Autocorrelation](./other-functionality/plotting/mcmc-autocorrelation.ipynb)
64+
- [Effective sample size](./sampling/effective-sample-size.ipynb)
65+
- [Evaluating noise models using autocorrelation plots of the residuals](./other-functionality/plotting/residuals-autocorrelation.ipynb)
66+
- [Pairwise scatterplots](./other-functionality/plotting/mcmc-pairwise-scatterplots.ipynb)
67+
- [Predicted time series](./other-functionality/plotting/mcmc-predicted-time-series.ipynb)
68+
- [Trace plots](./other-functionality/plotting/mcmc-trace-plots.ipynb)
6969

7070

7171
## Statistical modelling
72-
- [Autoregressive moving average errors](./stats-autoregressive-moving-average-errors.ipynb)
73-
- [Cauchy sampling error](./stats-cauchy-sampling-error.ipynb)
74-
- [Integrated noise model](./sampling-integrated-gaussian-log-likelihood.ipynb)
75-
- [Log priors](./stats-log-priors.ipynb)
76-
- [Student-t noise model](./stats-student-t-sampling-error.ipynb)
72+
- [Autoregressive moving average errors](./other-functionality/stats/autoregressive-moving-average-errors.ipynb)
73+
- [Cauchy sampling error](./other-functionality/stats/cauchy-sampling-error.ipynb)
74+
- [Integrated noise model](./other-functionality/stats/integrated-gaussian-log-likelihood.ipynb)
75+
- [Log priors](./other-functionality/stats/log-priors.ipynb)
76+
- [Student-t noise model](./other-functionality/stats/student-t-sampling-error.ipynb)
7777

7878

7979
## Toy problems
8080

8181
### Models
82-
- [Beeler-Reuter action potential model](./toy-model-beeler-reuter-ap.ipynb)
83-
- [Constant model](./toy-model-constant.ipynb)
84-
- [Fitzhugh-Nagumo model](./toy-model-fitzhugh-nagumo.ipynb)
85-
- [Goodwin oscillator model](./toy-model-goodwin-oscillator.ipynb)
86-
- [HES1 Michaelis-Menten model](./toy-model-hes1-michaelis-menten.ipynb)
87-
- [Hodgkin-Huxley Potassium current model](./toy-model-hodgkin-huxley-ik.ipynb)
88-
- [Logistic growth model](./toy-model-logistic.ipynb)
89-
- [Lotka-Volterra predator-prey model](./toy-model-lotka-volterra.ipynb)
90-
- [Repressilator model](./toy-model-repressilator.ipynb)
91-
- [Simple Harmonic Oscillator model](./toy-model-simple-harmonic-oscillator.ipynb)
92-
- [SIR Epidemiology model](./toy-model-sir.ipynb)
93-
- [Stochastic Degradation model](./toy-model-stochastic-degradation.ipynb)
82+
- [Beeler-Reuter action potential model](./other-functionality/toy/model-beeler-reuter-ap.ipynb)
83+
- [Constant model](./other-functionality/toy/model-constant.ipynb)
84+
- [Fitzhugh-Nagumo model](./other-functionality/toy/model-fitzhugh-nagumo.ipynb)
85+
- [Goodwin oscillator model](./other-functionality/toy/model-goodwin-oscillator.ipynb)
86+
- [HES1 Michaelis-Menten model](./other-functionality/toy/model-hes1-michaelis-menten.ipynb)
87+
- [Hodgkin-Huxley Potassium current model](./other-functionality/toy/model-hodgkin-huxley-ik.ipynb)
88+
- [Logistic growth model](./other-functionality/toy/model-logistic.ipynb)
89+
- [Lotka-Volterra predator-prey model](./other-functionality/toy/model-lotka-volterra.ipynb)
90+
- [Repressilator model](./other-functionality/toy/model-repressilator.ipynb)
91+
- [Simple Harmonic Oscillator model](./other-functionality/toy/model-simple-harmonic-oscillator.ipynb)
92+
- [SIR Epidemiology model](./other-functionality/toy/model-sir.ipynb)
93+
- [Stochastic Degradation model](./other-functionality/toy/model-stochastic-degradation.ipynb)
9494

9595
### Distributions
96-
- [Annulus](./toy-distribution-annulus.ipynb)
97-
- [Cone](./toy-distribution-cone.ipynb)
98-
- [High dimensional gaussian](./toy-distribution-high-dimensional-gaussian.ipynb)
99-
- [Multimodal gaussian distribution](./toy-distribution-multimodal-gaussian.ipynb)
100-
- [Neals Funnel](./toy-distribution-neals-funnel.ipynb)
101-
- [Rosenbrock function](./toy-distribution-rosenbrock.ipynb)
102-
- [Simple Egg Box](./toy-distribution-simple-egg-box.ipynb)
103-
- [Twisted Gaussian Banana](./toy-distribution-twisted-gaussian.ipynb)
96+
- [Annulus](./other-functionality/toy/distribution-annulus.ipynb)
97+
- [Cone](./other-functionality/toy/distribution-cone.ipynb)
98+
- [High dimensional gaussian](./other-functionality/toy/distribution-high-dimensional-gaussian.ipynb)
99+
- [Multimodal gaussian distribution](./other-functionality/toy/distribution-multimodal-gaussian.ipynb)
100+
- [Neals Funnel](./other-functionality/toy/distribution-neals-funnel.ipynb)
101+
- [Rosenbrock function](./other-functionality/toy/distribution-rosenbrock.ipynb)
102+
- [Simple Egg Box](./other-functionality/toy/distribution-simple-egg-box.ipynb)
103+
- [Twisted Gaussian Banana](./other-functionality/toy/distribution-twisted-gaussian.ipynb)
104104

105105

106106
## Miscellaneous
107-
108-
- [Automatic differentiation using autograd](./automatic-differentiation-using-autograd.ipynb)
109-
- [Evaluating noise models using autocorrelation plots of the residuals](./plot-residuals-autocorrelation.ipynb)
110-
- [The example shown on the landing page](./readme-example.ipynb)
107+
- [Automatic differentiation using autograd](./other-functionality/toy/automatic-differentiation-using-autograd.ipynb)
108+
- [The example shown on the landing page](./sampling/readme-example.ipynb)

examples/optimisation-cmaes.ipynb renamed to examples/optimisation/cmaes.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"\n",
99
"This example shows you how to run a global optimisation with [CMA-ES](http://pints.readthedocs.io/en/latest/optimisers/cmaes.html).\n",
1010
"\n",
11-
"For a more elaborate example of an optimisation, see: [basic optimisation example](./optimisation-first-example.ipynb)."
11+
"For a more elaborate example of an optimisation, see: [basic optimisation example](./first-example.ipynb)."
1212
]
1313
},
1414
{
@@ -134,14 +134,14 @@
134134
"language_info": {
135135
"codemirror_mode": {
136136
"name": "ipython",
137-
"version": 3
137+
"version": 2
138138
},
139139
"file_extension": ".py",
140140
"mimetype": "text/x-python",
141141
"name": "python",
142142
"nbconvert_exporter": "python",
143-
"pygments_lexer": "ipython3",
144-
"version": "3.6.4"
143+
"pygments_lexer": "ipython2",
144+
"version": "2.7.14"
145145
}
146146
},
147147
"nbformat": 4,

examples/optimisation-convenience.ipynb renamed to examples/optimisation/convenience.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@
171171
"language_info": {
172172
"codemirror_mode": {
173173
"name": "ipython",
174-
"version": 3
174+
"version": 2
175175
},
176176
"file_extension": ".py",
177177
"mimetype": "text/x-python",
178178
"name": "python",
179179
"nbconvert_exporter": "python",
180-
"pygments_lexer": "ipython3",
181-
"version": "3.6.5"
180+
"pygments_lexer": "ipython2",
181+
"version": "2.7.14"
182182
}
183183
},
184184
"nbformat": 4,

examples/optimisation-on-a-loglikelihood.ipynb renamed to examples/optimisation/maximum-likelihood.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"\n",
99
"As well as minimising error functions, PINTS optimisation can be used to find the maximum of a loglikelihood (or of any [pints.LogPDF object](https://pints.readthedocs.io/en/latest/log_pdfs.html#pints.LogPDF)).\n",
1010
"\n",
11-
"Following on from the [first example](optimisation-first-example.ipynb), we can define an inference problem using the [logistic model](https://pints.readthedocs.io/en/latest/toy/logistic_model.html#module-pints.toy):"
11+
"Following on from the [first example](first-example.ipynb), we can define an inference problem using the [logistic model](https://pints.readthedocs.io/en/latest/toy/logistic_model.html#module-pints.toy):"
1212
]
1313
},
1414
{
@@ -102,7 +102,9 @@
102102
{
103103
"cell_type": "code",
104104
"execution_count": 4,
105-
"metadata": {},
105+
"metadata": {
106+
"collapsed": true
107+
},
106108
"outputs": [],
107109
"source": [
108110
"log_likelihood = pints.GaussianLogLikelihood(problem)"
@@ -381,21 +383,21 @@
381383
],
382384
"metadata": {
383385
"kernelspec": {
384-
"display_name": "Python 3",
386+
"display_name": "Python 2",
385387
"language": "python",
386-
"name": "python3"
388+
"name": "python2"
387389
},
388390
"language_info": {
389391
"codemirror_mode": {
390392
"name": "ipython",
391-
"version": 3
393+
"version": 2
392394
},
393395
"file_extension": ".py",
394396
"mimetype": "text/x-python",
395397
"name": "python",
396398
"nbconvert_exporter": "python",
397-
"pygments_lexer": "ipython3",
398-
"version": "3.6.8"
399+
"pygments_lexer": "ipython2",
400+
"version": "2.7.14"
399401
}
400402
},
401403
"nbformat": 4,

examples/optimisation-multi-objective.ipynb renamed to examples/optimisation/multi-objective.ipynb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"cell_type": "markdown",
1414
"metadata": {},
1515
"source": [
16-
"To simulate this, we'll load two copies of the [logistic model](/toy-model-logistic.ipynb), and run two simulations with the same parameters (the same system) but different initial conditions (a different experiment)."
16+
"To simulate this, we'll load two copies of the [logistic model](../other-functionality/toy/model-logistic.ipynb), and run two simulations with the same parameters (the same system) but different initial conditions (a different experiment)."
1717
]
1818
},
1919
{
@@ -79,7 +79,9 @@
7979
{
8080
"cell_type": "code",
8181
"execution_count": 3,
82-
"metadata": {},
82+
"metadata": {
83+
"collapsed": true
84+
},
8385
"outputs": [],
8486
"source": [
8587
"problem_1 = pints.SingleOutputProblem(model_1, times_1, experiment_1)\n",
@@ -101,7 +103,9 @@
101103
{
102104
"cell_type": "code",
103105
"execution_count": 4,
104-
"metadata": {},
106+
"metadata": {
107+
"collapsed": true
108+
},
105109
"outputs": [],
106110
"source": [
107111
"error = pints.SumOfErrors((error_1, error_2))"
@@ -170,14 +174,14 @@
170174
"language_info": {
171175
"codemirror_mode": {
172176
"name": "ipython",
173-
"version": 3
177+
"version": 2
174178
},
175179
"file_extension": ".py",
176180
"mimetype": "text/x-python",
177181
"name": "python",
178182
"nbconvert_exporter": "python",
179-
"pygments_lexer": "ipython3",
180-
"version": "3.6.8"
183+
"pygments_lexer": "ipython2",
184+
"version": "2.7.14"
181185
}
182186
},
183187
"nbformat": 4,

examples/optimisation-nelder-mead.ipynb renamed to examples/optimisation/nelder-mead.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,21 @@
135135
],
136136
"metadata": {
137137
"kernelspec": {
138-
"display_name": "Python 3",
138+
"display_name": "Python 2",
139139
"language": "python",
140-
"name": "python3"
140+
"name": "python2"
141141
},
142142
"language_info": {
143143
"codemirror_mode": {
144144
"name": "ipython",
145-
"version": 3
145+
"version": 2
146146
},
147147
"file_extension": ".py",
148148
"mimetype": "text/x-python",
149149
"name": "python",
150150
"nbconvert_exporter": "python",
151-
"pygments_lexer": "ipython3",
152-
"version": "3.7.3"
151+
"pygments_lexer": "ipython2",
152+
"version": "2.7.14"
153153
}
154154
},
155155
"nbformat": 4,

examples/optimisation-pso.ipynb renamed to examples/optimisation/pso.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"\n",
99
"This example shows you how to run a global optimisation with [PSO (particle swarm optimisation)](http://pints.readthedocs.io/en/latest/optimisers/pso.html).\n",
1010
"\n",
11-
"For a more elaborate example of an optimisation, see: [basic optimisation example](./optimisation-first-example.ipynb)."
11+
"For a more elaborate example of an optimisation, see: [basic optimisation example](./first-example.ipynb)."
1212
]
1313
},
1414
{
@@ -127,14 +127,14 @@
127127
"language_info": {
128128
"codemirror_mode": {
129129
"name": "ipython",
130-
"version": 3
130+
"version": 2
131131
},
132132
"file_extension": ".py",
133133
"mimetype": "text/x-python",
134134
"name": "python",
135135
"nbconvert_exporter": "python",
136-
"pygments_lexer": "ipython3",
137-
"version": "3.6.4"
136+
"pygments_lexer": "ipython2",
137+
"version": "2.7.14"
138138
}
139139
},
140140
"nbformat": 4,

0 commit comments

Comments
 (0)