Learn scientific model fitting and Bayesian inference through worked examples with PyAutoFit. HowToFit starts from first principles and guides you from defining a model and fitting data to interpreting results and combining information across datasets.
You don’t need prior experience with Bayesian statistics. If you already know the fundamentals, head to the PyAutoFit workspace for concise examples.
- Start in your browser — open the series introduction in Google Colab without installing anything locally.
- Run it locally — install PyAutoFit, download this repository and open the Jupyter notebooks in
notebooks/. - Read Chapter 1 with images — browse the available lectures and their results directly on GitHub.
After the introduction, begin with Tutorial 1: Models.
The PyAutoFit AI Assistant can explain concepts, equations and code, help with notebook errors, and discuss your results. Paste this prompt into your AI coding agent:
I want to work through HowToFit
(https://github.com/PyAutoLabs/HowToFit) with the
PyAutoFit Assistant (https://github.com/PyAutoLabs/autofit_assistant).
First clone the assistant repository, cd into it and follow its AGENTS.md.
Enter HowToFit mode. Help me find the lectures and get started,
then answer questions as I work through them at my own pace.
See AI Options for tools and setup guidance.
| Chapter | What you’ll learn |
|---|---|
| 1. Introduction | Models, likelihoods, searches, interpreting results and building a scientific workflow |
| Advanced: Graphical and Hierarchical Models | Combining datasets, sharing model parameters and inferring population properties |
Work through Chapter 1 in order, then try the workspace examples with your own models and data. Return to the advanced chapter when you need to fit multiple datasets together.
Ask questions, suggest improvements and share your work in PyAutoLabs Discussions, or chat with us on Slack.
To contribute, see the contribution guide.
If you use HowToFit or PyAutoFit in your research, see the citation guide.
See the license.
