PHYSICS 267: Statistical Methods in Astrophysics¶
All about Stanford University graduate course Physics 267, Fall 2024 edition.
(Prior to this year, the course was numbered 366. This renumbering does not reflect any change in content or rigor.)
Note: Due to a late-breaking change in file organization, there may be a number of broken links between internal pages (excepting links from the front page). It should always be clear in context what page is being referred to, and it should be possible to get there from here.
Description¶
This course covers the foundations of principled inference from data, primarily in the Bayesian framework, organized around applications in astrophysics and cosmology. Topics include probabilistic modeling of data, parameter constraints and model comparison, numerical methods including Markov Chain Monte Carlo, and connections to frequentist and machine learning frameworks. The course is organized around tutorials that provide hands-on experience with real data.
The class was developed for and is aimed at beginning graduate students in astrophysics and cosmology, and we strongly encourage most first and second year students working in KIPAC to take it when offered (normally every 2 years). However, the course materials are provided here for anyone who might want to learn (see the recommended prerequisites). Therefore, the usual syllabus information is split into two parts:
Syllabus documents¶
- An overview of the course for everyone
- Information, logistics and policies specifically for enrolled students
Additional quick links¶
- Stanford course catalog entry
- Canvas site
- Google drive (for tutorial notebooks)
- Tentative schedule (see Canvas for the official schedule)
- Getting Started and Demo tutorial
Learning goals (abbreviated)¶
Our aim is to provide students with a foundation of experience in
- the reasoning that underlies principled inference from data,
- the algorithms and approximations employed for inference, and
- the strategies involved in solving realistically complex inference problems using real data.
You can find these spelled out in more detail in the overview.
Content¶
Start by looking at the Overview to understand how this course works, and Getting Started to get up and running with Python and Jupyter, if needed. Enrolled students should also read the Syllabus page to see what is expected.
The course content can be browsed here in static HTML format through the hyperlinks below. This is sufficient for the notes, but to do the tutorials you will need to download them in Jupyter notebook format from the Google Drive folder linked at the top of this page.
A natural progression through the course notes and tutorials is depicted below. If you know the name of the notebook you're looking for, it may be faster to search for it in the table farther below, which is also in a reasonable order.
Flowchart¶
flowchart TB classDef tutorial fill:#ffcccc, stroke:#f00; classDef opttutorial fill:#ffeeee; subgraph header [" "] subgraph Legend [Legend] direction LR N[Notes] --> T{{Tutorial}}:::tutorial %%N --> OT([Ungraded Tutorial]):::opttutorial end subgraph Logistics [Logistics] direction LR Noverview[Overview] Noverview --> Nsyllabus[Syllabus] Noverview --> Nsetup[Getting Started] Nsetup --> Tdemo{{Demo}}:::tutorial end end style header fill:#fff,stroke:#fff Logistics ==> Principles subgraph Principles [Principles] direction LR Ngenmod[Generative Models] Nprobability[Essential Probability] Ngenmod --> Tgenmod{{Generative Models}}:::tutorial Nprobability --> Tprob{{Essential Probability}}:::tutorial Ngenmod & Nprobability --> Nbayes[Bayes' Law] Nbayes --> Ncred[Credible Regions] & Nerrorbars[''Error Bars''] & Nfreq[Frequentism] & Nmodeval1[Goodness of Fit] Nbayes --> Tbayes{{Bayes' Law}}:::tutorial Ncred --> Tcred{{Credible Regions}}:::tutorial Ncred & Nmodeval1 & Nfreq & Tbayes & Tcred --> Tgrid{{Vaccine Efficacy /
On a Grid}}:::tutorial end Principles ==> Methods subgraph Methods [Methods] direction LR Nsampling[Monte Carlo Sampling] Nsampling --> Tsampling{{Cluster Redshift Distribution /
MCMC Sampling}}:::tutorial Nsampling --> Ndiagnostics[MCMC Diagnostics] Ndiagnostics --> Nmoresampling[More Sampling Methods] Ndiagnostics & Tsampling --> Tdiagnostics{{MCMC diagnostics}}:::tutorial Nsampling --> Nmodeval[Model Evaluation and Comparison] Nmodeval & Tdiagnostics --> Tmodeval{{Cluster Centering /
Model Evaluation}}:::tutorial Nsampling --> Napprox[Approximate Methods] --> Tapprox{{Approximate Methods}}:::tutorial end Methods ==> Practice subgraph Practice [Practice] direction LR Nmoremod[More Modeling] Nmoremod --> Nmissing[Missing Data and
Selection Effects] & Nfish[How to Avoid
Fooling Ourselves] subgraph PracticeTutorials [ ] direction LR Tmulens{{Microlensing}}:::tutorial Txray{{X-ray Photometry}}:::tutorial Tvdisp{{Cluster Membership /
Mixture Models}}:::tutorial Tmissing{{O-ring Failures /
Missing Data}}:::tutorial Tnew{{Project}}:::tutorial end end Nmissing --> Tmissing Nmoremod --> Tvdisp %% click commands here click Noverview "notes/overview.html" "Overview" click Nsyllabus "notes/syllabus.html" "Syllabus" click Nsetup "notes/getting_started.html" "Getting Started" click Ngenmod "notes/generative_models.html" "Generative Models" click Nprobability "notes/essential_probability.html" "Essential Probability" click Nbayes "notes/bayes_law.html" "Bayes' Law" click Ncred "notes/credible_regions.html" "Credible Regions" click Nerrorbars "notes/errorbars.html" "Error Bars" click Nfreq "notes/frequentism.html" "Frequentism" click Nmodeval1 "notes/goodness.html" "Goodness of Fit" click Nsampling "notes/montecarlo.html" "Monte Carlo Sampling" click Ndiagnostics "notes/mcmc_diagnostics.html" "MCMC Diagnostics" click Nmoresampling "notes/more_samplers.html" "More Samplers" click Nmodeval "notes/model_evaluation.html" "Model Evaluation and Comparison" click Nmoremod "notes/more_modeling.html" "More Modeling" click Nmissing "notes/missingdata.html" "Missing Data" click Napprox "notes/approximate_methods.html" "Approximate Methods" click Nfish "notes/fishing.html" "Foolishness" click Tdemo "tutorials/demo/demo.html" "Demo" click Tgenmod "tutorials/generative_models/generative_models.html" "Generative Models" click Tprob "tutorials/essential_probability/essential_probability.html" "Essential Probability" click Tbayes "tutorials/bayes_law/bayes_law.html" "Bayes' Law" click Tcred "tutorials/credible_regions/credible_regions.html" "Credible Regions" click Tgrid "tutorials/vaccine/vaccine.html" "Vaccine Efficacy / On a Grid" click Tsampling "tutorials/clredshift/clredshift.html" "Cluster Redshift Distribution / MCMC Sampling" click Tdiagnostics "tutorials/mcmc_diagnostics/mcmc_diagnostics.html" "MCMC Diagnostics" click Tapprox "tutorials/approximate_methods/approximate_methods.html" "Approximate Methods" click Tmodeval "tutorials/model_evaluation/model_evaluation.html" "Cluster Centering/Model Evaluation" click Tmulens "tutorials/microlensing/microlensing.html" "Microlensing" click Txray "tutorials/xray_image/xray_image.html" "X-ray Photometry" click Tvdisp "tutorials/cl_membership/cl_membership.html" "Cluster Membership / Mixture Models" click Tmissing "tutorials/missing_data/missing_data.html" "O-ring Failures / Missing Data" click Tnew "tutorials/project/project.html" "Project"
Principles¶
Methods¶
Practice¶
Solutions¶
Solutions to the tutorials are not provided. However, there are static pages showing the outputs of correctly solved tutorials that you can compare your work to, linked from the table above. Keep in mind that your results may not look identical, since many algorithms we use invoke random number generators, and you may be using different data or priors compared with the solutions.
On the use of Javascript¶
We firmly believe that any website that cannot function without Javascript is not a website. Every page linked here should be basically functional without scripts. However, we do use Javascript in three ways that are actually helpful:
Copyright statement¶
Unless otherwise noted, all materials are Copyright 2015, 2017, 2019, 2021, 2023, 2024 by the contributors (below), and licensed under the Creative Commons CC BY-NC (Attribution-NonCommercial) 4.0 International License. Executable code is additionally covered by the BSD 3-Clause License.
Contributors:
- 2024: Adam Mantz
- 2023: Adam Mantz
- 2021: Adam Mantz, Claire Hébert
- 2019: Adam Mantz, Phil Marshall
- 2017: Adam Mantz, Phil Marshall
- 2015: Phil Marshall, Adam Mantz, Elisabeth Krause, Matthew Becker, Eric Charles
Please report broken links and similar in the GitHub issues.