Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# HowToFit

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/start_here.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/start_here.ipynb)

[Start Here on Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/start_here.ipynb) |
[Start Here on Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/start_here.ipynb) |
[Installation Guide](https://pyautofit.readthedocs.io/en/latest/installation/overview.html) |
[PyAutoFit readthedocs](https://pyautofit.readthedocs.io/en/latest/index.html) |
[Browse Chapter 1 With Images](markdown/README.md) |
Expand Down Expand Up @@ -78,27 +78,27 @@ output figures inline. Nothing runs and nothing installs — you just read it. T
skimming a tutorial before running it, or for reading on a phone. Markdown pages currently exist only
for the chapter 1 tutorials listed with a `markdown` link below; every other tutorial is Colab-only.

**[Start Here](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/start_here.ipynb)** — a one-page overview of the whole series.
**[Start Here](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/start_here.ipynb)** — a one-page overview of the whole series.

- **[Chapter 1: Introduction](scripts/chapter_1_introduction/README.md)** — Models, likelihoods, non-linear searches, why modeling is hard, and how to interpret the results of a fit, ending with a short guide to building a scientific workflow.
- Start Here: HowToFit Lectures — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/start_here.ipynb) / [markdown](markdown/chapter_1_introduction/start_here.md))
- Tutorial 1: Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_1_models.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_1_models.md))
- Tutorial 2: Fitting Data — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_2_fitting_data.md))
- Tutorial 3: Non Linear Search — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_3_non_linear_search.md))
- Tutorial 4: Why Modeling Is Hard — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_4_why_modeling_is_hard.md))
- Tutorial 5: Results and Samples — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_5_results_and_samples.md))
- Tutorial 6: Gradients — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb))
- Tutorial 7: The Details — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb))
- Tutorial 8: Scientific Workflow — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_8_scientific_workflow.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_8_scientific_workflow.md))
- Tutorial Optional: Bayesian Formalism — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb))
- Start Here: HowToFit Lectures — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/start_here.ipynb) / [markdown](markdown/chapter_1_introduction/start_here.md))
- Tutorial 1: Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_1_models.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_1_models.md))
- Tutorial 2: Fitting Data — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_2_fitting_data.md))
- Tutorial 3: Non Linear Search — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_3_non_linear_search.md))
- Tutorial 4: Why Modeling Is Hard — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_4_why_modeling_is_hard.md))
- Tutorial 5: Results and Samples — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_5_results_and_samples.md))
- Tutorial 6: Gradients — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb))
- Tutorial 7: The Details — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb))
- Tutorial 8: Scientific Workflow — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_8_scientific_workflow.ipynb) / [markdown](markdown/chapter_1_introduction/tutorial_8_scientific_workflow.md))
- Tutorial Optional: Bayesian Formalism — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb))
- **[Advanced Chapter: Graphical & Hierarchical Models](scripts/chapter_advanced/README.md)** — Fitting many datasets simultaneously with graphical models, hierarchical models, and Expectation Propagation.
- Tutorial 1: Individual Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb))
- Tutorial 2: Graphical Model — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb))
- Tutorial 3: Graphical Benefits — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb))
- Tutorial 4: Hierarchical Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb))
- Tutorial 5: Expectation Propagation — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb))
- Tutorial Optional: Hierarchical Expectation Propagation — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb))
- Tutorial Optional: Hierarchical Individual — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb))
- Tutorial 1: Individual Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb))
- Tutorial 2: Graphical Model — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb))
- Tutorial 3: Graphical Benefits — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb))
- Tutorial 4: Hierarchical Models — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb))
- Tutorial 5: Expectation Propagation — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb))
- Tutorial Optional: Hierarchical Expectation Propagation — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb))
- Tutorial Optional: Hierarchical Individual — ([Colab](https://colab.research.google.com/github/PyAutoLabs/HowToFit/blob/2026.9.15.1/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb))

Model-fits run considerably faster on a GPU. In Colab, enable one via *Runtime* → *Change runtime type*
→ *Hardware accelerator* before running a notebook.
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_1_introduction/start_here.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_1_introduction/tutorial_1_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_advanced/tutorial_1_individual_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
14 changes: 0 additions & 14 deletions notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,6 @@
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
"\n",
" # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n",
" # which the released autonerves bootstrap does not yet install and Colab\n",
" # does not ship. Without these the notebook dies partway through a fit.\n",
" # Remove once autonerves > 2026.9.15.1 is released.\n",
" subprocess.check_call(\n",
" [\n",
" sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n",
" \"corner==2.2.2\",\n",
" \"optax>=0.2.5\",\n",
" \"xxhash<=3.4.1\",\n",
" \"blackjax>=1.6.2\",\n",
" ]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtofit\")"
Expand Down
Loading
Loading