Skip to main content
Sandbox Physics
Planet atmospheres from grazing rays to molecular evidence

L3

What an atmospheric posterior can and cannot tell us

A posterior is a distribution of parameter values conditional on data, priors and a physical model. It can be narrow even when that model fails. We therefore examine parameter tradeoffs and predicted residuals together, using the same measured bins throughout.

Define a Gaussian measurement model

Call the measured depth in bin ii yiy_i and its reported standard uncertainty sis_i, both in parts per million. The prediction mi(θ)m_i(\theta) is the apparent photon-binned depth derived in L2. The vector θ\theta contains temperature, water fraction, cloud pressure, ten-bar radius ratio and, in one model, unocculted cool fraction.

The input is an author-released fitted radius-ratio-squared spectrum. Its upstream light-curve analysis already treated limb darkening and transit geometry. We do not replace it with a uniform-disk fit to the original light curves, which are not inputs here.

For this conditional exercise, assume independent Gaussian errors with the supplied standard deviations. Independence is an additional assumption: the table does not provide a full wavelength covariance. No fitted noise multiplier is added to make residuals look acceptable.

Subtract prediction from observation to obtain a residual. Divide by the reported uncertainty to express that discrepancy in standard-error units. Square these standardized residuals and add them to obtain chi-square.

The Gaussian likelihood is a probability density for observing the data at fixed parameters. Its normalization contains the actual uncertainty of each bin. Retaining this factor distinguishes a specified likelihood from an arbitrary score, even though a parameter-independent factor cancels in a sampling acceptance ratio.

A low chi-square locates a good-fitting part of this model; it does not give the volume of other parameter values that also fit. A single best point therefore cannot stand in for the full posterior, or for a comparison of model evidence.

ri(θ)=yi−mi(θ)si,χ2(θ)=∑i=174ri(θ)2r_i(\theta)=\frac{y_i-m_i(\theta)}{s_i},\qquad \chi^2(\theta)=\sum_{i=1}^{74}r_i(\theta)^2
A positive residual means the observed transit is deeper than the model in that bin. The sum is dimensionless.
L(y∣θ)=∏i=17412π siexp⁡ ⁣[−[yi−mi(θ)]22si2]\mathcal L(y\mid\theta)=\prod_{i=1}^{74}\frac{1}{\sqrt{2\pi}\,s_i}\exp\!\left[-\frac{[y_i-m_i(\theta)]^2}{2s_i^2}\right]
This normalized Gaussian likelihood is conditional on independent reported errors and on the fixed physical forward model.

Reading: Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS · WASP-39 b NIRISS author data · Zenodo 7709712 and fixed repository commit · Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II · Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy

Choose a finite prior and keep its meaning visible

The main exercise uses uniform temperature from 800 to 1600 kelvin; uniform base-ten logarithmic water fraction from minus seven to minus two; uniform base-ten logarithmic cloud pressure from minus four to one, with pressure in bar; and uniform ten-bar radius ratio from 0.130 to 0.145. All intervals are finite, so every prior is proper.

The cloud-only model fixes cool fraction at zero. The contamination model instead gives it a uniform prior from zero to 0.05 at a fixed cool-region temperature of 4500 kelvin. Separate sensitivity runs use 3500 kelvin or a narrower upper fraction of 0.01. These are chosen conditions, not measured spot coverage or a physical prior inferred from stellar monitoring.

Uniform in log⁡10x\log_{10}x is not uniform in xx. A change of variable supplies the inverse-abundance factor below. Each decade of water fraction receives equal prior mass. Changing that choice may change a weakly constrained answer.

Bayes’ rule multiplies likelihood by prior and divides by their integral. That denominator makes the posterior integrate to one. The sampler need not know its numerical value to draw from the normalized distribution, but an evidence calculation would require it. No evidence or Bayes factor is computed in this exercise.

w=log⁡10x∼U(−7,−2),p(x)=15ln⁡(10) x(10−7≤x≤10−2)w=\log_{10}x\sim\mathcal U(-7,-2),\qquad p(x)=\frac{1}{5\ln(10)\,x}\quad(10^{-7}\le x\le10^{-2})
The prior density in linear abundance includes the Jacobian. It vanishes outside the stated finite interval.
p(θ∣y,M)=L(y∣θ,M) p(θ∣M)∫L(y∣ϑ,M) p(ϑ∣M) dϑp(\theta\mid y,M)=\frac{\mathcal L(y\mid\theta,M)\,p(\theta\mid M)}{\int\mathcal L(y\mid\vartheta,M)\,p(\vartheta\mid M)\,d\vartheta}
The model label includes the absorption sources, cloud law, stellar spectra, numerical domain and error assumptions. A posterior is always conditional on these choices.

Reading: Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy · Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II

Why several physical changes can fit the same shape

In the thin isothermal limit, a stronger absorber shifts the altitude of a fixed optical-depth contour by a logarithm of its abundance. Raising the reference radius can compensate for reducing abundance. Moving an opaque cloud upward removes lower layers and can suppress the contrast that additional absorbers would otherwise create.

At the saved local scale height of about 828 kilometres, a tenfold increase in abundance would move an idealized contour by about 1910 kilometres. A decrease of similar size in reference radius could offset that shift in the thin approximation. Real bands depart from a common shift because cross sections vary with pressure and temperature, clouds cut off some paths, and different wavelengths saturate differently.

An unocculted cool fraction changes the stellar denominator and adds a wavelength-dependent depth distortion. It can trade off against reference radius and some broad atmospheric shape. The actual 5500-kelvin photosphere and the selected cool spectra constrain the form of this distortion; it is not a freely drawn polynomial.

A posterior ridge is therefore a family of compensating explanations within a chosen model. The ten-bar pressure is fixed here to define the radius convention. This does not mean the data independently measure that pressure, or uniquely identify water fraction.

Rtr≃R0+Hln⁡x+other terms,ΔR0≃−H Δln⁡xR_{\rm tr}\simeq R_0+H\ln x+\text{other terms},\qquad \Delta R_0\simeq-H\,\Delta\ln x
This local, approximately fixed-scale-height relation explains a tradeoff; the likelihood uses the full pressure-dependent forward model.

Reading: Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II · Chubb et al. (2021) · ExoMolOP cross sections and k-tables

Change the sampling coordinate without changing the radius prior

The radius–abundance ridge makes a naive proposal inefficient: a small change in radius can shift every depth bin together. Let qR=R0/R⋆q_R=R_0/R_\star be the dimensionless reference radius ratio, and let u\boldsymbol{u} collect the other parameters scaled to their finite unit intervals.

For each choice of those other parameters, a deterministic anchor estimates a radius near the mean observed depth. The calculation then samples an offset from that anchor. This shifts the coordinate origin; it keeps every radius in the original interval available and does not substitute a fitted radius for the sampled parameter.

At fixed other parameters and observed data, an interval dzdz corresponds to an interval in the radius ratio dqR=s dzdq_R=s\,dz. This factor converts probability density between the coordinates; it is the relevant Jacobian. Dividing it by the original radius-prior width gives the density below.

The transformed support is 1500 offset units wide and its density is one over 1500. Their product is one. Moving the anchor, even when it uses the observed data, merely moves this complete interval; it creates neither a narrower radius prior nor a Gaussian prior on the offset.

qR=A(u;y)+sz,s=10−5,∂qR∂z=sq_R=A(\boldsymbol{u};y)+s z,\qquad s=10^{-5},\qquad \frac{\partial q_R}{\partial z}=s
The anchor is a computational coordinate shift. It never restricts the original uniform radius-ratio interval.
0.130−As≤z≤0.145−As,pcoord(z∣u;y)=s0.015=11500\frac{0.130-A}{s}\le z\le\frac{0.145-A}{s},\qquad p_{\mathrm{coord}}(z\mid\boldsymbol{u};y)=\frac{s}{0.015}=\frac{1}{1500}
This is the original prior expressed in coordinates at fixed data; its density is zero outside this support. The other unit-coordinate scale factors cancel their corresponding uniform prior densities, leaving this exact radius factor.

Reading: Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size

Draw a distribution and check that the chains explored it

The reproducible calculation starts four dispersed Markov chains. A symmetric Gaussian proposal suggests a new point. Under the hard finite prior, a proposal outside the allowed region is rejected. Otherwise the likelihood-and-prior ratio gives its Metropolis acceptance probability. Repeated accepted and repeated rejected positions both belong in the chain.

During 6000 warmup iterations per chain, the proposal covariance and step size adapt. They then remain fixed for at least 16,000 retained iterations per chain. A radius coordinate follows a deterministic conditional anchor to avoid proposing enormous depth shifts; the original uniform radius prior and the exact constant triangular Jacobian are retained. There is no extra Gaussian prior on that coordinate.

Rank-normalized and folded split-chain diagnostics test agreement among chains, including differences in location and spread. Bulk and tail effective sample sizes estimate how much independent information remains after autocorrelation. All four real-data runs pass the frozen targets: split R-hat at most 1.01, and both effective sample sizes at least 400 for every varying parameter.

These checks concern the sampling calculation. They do not establish that the physical model is adequate, that a missing mode is impossible, or that an interval has calibrated real-planet coverage. The same sampler also recovers the known moments of a correlated Gaussian. A separately generated known-truth atmosphere and deliberately separated-chain tests check the physical route and the diagnostics.

α=min⁡ ⁣[1,L(y∣θ′)p(θ′)L(y∣θ)p(θ)]\alpha=\min\!\left[1,\frac{\mathcal L(y\mid\theta')p(\theta')}{\mathcal L(y\mid\theta)p(\theta)}\right]
This form applies to the symmetric, frozen proposal. In transformed coordinates the target also includes the exact prior Jacobian.

Reading: Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size · Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy

A converged posterior can still expose a failed explanation

The actual 74-bin exercise makes this distinction concrete. The cloud-only chain reaches a retained minimum chi-square near 332; allowing 4500-kelvin unocculted regions improves it to about 257. Nevertheless, 28 and 23 measured bins respectively fall outside their central 95 percent replicated-measurement intervals. The median-curve standardized residual RMS remains about 2.13 and 1.88.

Both models push temperature toward the 800-kelvin lower boundary and water fraction toward its one-percent upper boundary. The 4500-kelvin contamination model has a median cool fraction near 0.0224, but its narrow positive interval does not by itself establish that spots were detected: positivity is built into its continuous prior, and the point-null model is a separate model.

Changing the fixed cool temperature to 3500 kelvin moves the median fraction to about 0.0373. Restricting the 4500-kelvin fraction to at most 0.01 pushes it against that new boundary and worsens the fit. These sensitivity results demonstrate dependence on the chosen conditions; all retain substantial predictive failures.

A latent prediction interval describes uncertainty in the model’s noiseless mean. A replicated-measurement interval additionally includes the stated measurement noise. Persistent structured residuals against the latter indicate that the constrained explanation is incomplete. They cannot be repaired by reporting only the best-fitting curve or the tightest parameter interval.

p(yinew∣y,M)=∫N ⁣(yinew;mi(θ),si2)p(θ∣y,M) dθp(y_i^{\rm new}\mid y,M)=\int\mathcal N\!\left(y_i^{\rm new};m_i(\theta),s_i^2\right)p(\theta\mid y,M)\,d\theta
For each posterior draw, generate a new Gaussian measurement with the reported bin uncertainty. This distribution checks what data the fitted model predicts under its own error assumptions.

Reading: Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS · Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size · Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy

A saved calculation without opening the Lab

This synthetic example fixes a planet mass of 0.28 Jupiter masses, stellar radius of 0.932 solar radii and ten-bar radius ratio of 0.133. Temperature is 1100 kelvin, water number fraction 0.0001, cloud pressure one bar and unocculted cool fraction zero. The background particle count is 85 percent hydrogen molecules and 15 percent helium atoms.

The calculation uses 384 pressure shells from ten bar to a finite top of one ten-billionth of a bar. It retains 15,084 native opacity samples, pressure-dependent cross sections and 74 independent supplied top-hat bins. These values describe a teaching atmosphere, not a fit to the measured points.

QuantitySaved resultMethod
Reference gravity
4.770 m s−24.770\,\mathrm{m\,s^{-2}}
Fixed planet mass at the ten-bar radius
Local pressure scale height
828.1 km828.1\,\mathrm{km}
Thermal energy per particle divided by particle weight
One-bar cloud height
1949.9 km1949.9\,\mathrm{km}
Inverse-square isothermal pressure law
Minimum planetary bin depth
18614.9 ppm18614.9\,\mathrm{ppm}
Native transfer, then photon binning
Maximum planetary bin depth
20882.7 ppm20882.7\,\mathrm{ppm}
Same gas, cloud and stellar response

For a paper-and-pencil recalculation, use these SI constants:

MJ=1.89813×1027 kgM_J=1.89813\times10^{27}\,\mathrm{kg}
R⊙=6.957×108 mR_\odot=6.957\times10^8\,\mathrm{m}
G=6.67430×10−11 m3 kg−1 s−2G=6.67430\times10^{-11}\,\mathrm{m^3\,kg^{-1}\,s^{-2}}
kB=1.380649×10−23 J K−1k_B=1.380649\times10^{-23}\,\mathrm{J\,K^{-1}}

First obtain the reference radius and gravity, then the scale height and cloud radius. The full spectrum additionally requires the public opacity inputs and the L2 integrals.

Actual-data posteriors retain their failures

All rows use the same measured 74 bins and atmospheric priors. Each has four chains with at least 16,000 retained, correlated positions per chain after warmup. Effective sample size is reported separately; the minima below range over the varying physical parameters. A chain diagnostic pass does not repair the poor predictive fit.

ConditionMinimum retained chi-squareMaximum split R-hatMinimum bulk/tail ESSBins outside 95 percent replicated interval
Gray cloud, no cool regions331.95331.951.002621.00262186628
4500 kelvin, fraction at most 0.05257.11257.111.003411.0034191623
3500 kelvin, fraction at most 0.05248.17248.171.005361.0053682120
4500 kelvin, fraction at most 0.01279.27279.271.006531.00653106328

Temperature and water abundance accumulate near prior boundaries. The fixed stellar spectrum and fraction prior change the result. The public prediction CSVs keep wavelength-by-wavelength residuals; no evidence or Bayes factor is computed.

Find compensating changes before fitting anything

  1. Compare Clear water bands with High cloud. Describe which parts of the ray bundle disappear and which spectral contrasts are suppressed.
  2. Increase water fraction, then lower the ten-bar radius in Advanced settings to compensate for a mean depth shift. Inspect the wavelengths that fail to move together.
  3. Use the detached tutorial next. Compare the full posterior ranges and standardized residuals together.

Exercises with explanations

  1. Why does the probability that cool fraction is strictly positive fail to test the no-spot hypothesis in the continuous contamination model?

    Read the explanation

    A continuous uniform prior from zero to 0.05 assigns probability zero to the single point zero before any data are considered. The posterior also assigns it zero unless a point mass is explicitly included. Testing the point-null requires a defined separate model or mixture prior with explicit prior mass on the null.

  2. A sampler gives excellent split-chain diagnostics, but many observed bins lie outside replicated-measurement intervals. Which part has succeeded, and which needs revision?

    Read the explanation

    The chains have supplied evidence that they explore this defined posterior consistently. The data check instead says that this posterior’s model and error assumptions predict the measurements poorly. Resolving that failure requires a new stated physical or statistical model and validation.

  3. At a fixed 828-kilometre scale height, estimate the contour shift for a tenfold abundance increase. Explain why it is not a unique abundance measurement.

    Read the explanation

    Multiply the scale height by the natural logarithm of ten to obtain about 1910 kilometres. A reference-radius shift can compensate in the thin limit, and a high cloud can hide part of the changed annulus. The complete pressure-dependent spectrum constrains combinations of abundance, reference radius and cloud height.

Sources and calculation scope

  1. Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size

    Bayesian Analysis 16, 667–718; corrected rank-normalization denominator and author appendix https://avehtari.github.io/rhat_ess/rhat_ess.html. The independent NumPy implementation also follows the Stan 2.33 reference definition of autocorrelation and initial positive, monotone pair truncation. IID, AR(1) and deliberately separated-chain checks are included. These diagnostics concern sampling, not physical model adequacy.

  2. Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS

    Published Nature 614, 670–675. Read Figures 1–3 and the extraction, light-curve and atmospheric-model Methods. The tutorial uses a fixed author-released nirHiss spectrum, with 74 selected order-one bins; it does not repeat the paper’s full chemical and cloud retrieval.

  3. WASP-39 b NIRISS author data · Zenodo 7709712 and fixed repository commit

    Archived data are CC BY 4.0. The exact CSV comes from author repository commit 0608071e1e70ec7ff12707774ea03ace4b52ea85, which also carries an MIT license. Original bytes, row selection, units and SHA256 are saved in the public provenance file. The complete archive was not downloaded.

  4. Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy

    Fixed accepted version, arXiv 1702.02051v2; published MNRAS 470, 2972–2981, DOI 10.1093/mnras/stx1453. Section 2.2 derives the thin, constant-gravity limit; Sections 3.2–3.3 discuss the reference radius and pressure. The course derives its inverse-square-gravity extension separately.

  5. Chubb et al. (2021) · ExoMolOP cross sections and k-tables

    A&A 646, A21, full text Sections 3.1–3.3 and Tables 1–3. The actual sampled cross-section product supplies pressure, temperature, wavenumber and square centimetres per molecule. Its approximate hydrogen–helium broadening and source resolution remain model assumptions.

  6. Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II

    Fixed arXiv 1812.06184v1; published AJ 157, 96, DOI 10.3847/1538-3881/aaf892. Section III.1, Equations 3–6 define the unocculted-region correction and its uniform-intensity approximation. Section IV.3 explains why molecular contamination is generally weak at typical FGK activity levels.

  7. Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy

    Fixed accepted arXiv 1811.01681v2; published AJ 157, 114, DOI 10.3847/1538-3881/aaffd3. Section II.2.2 derives the likelihood mapping; Figures 2, 5, 7 and 10 test processing, calibration, line-list choice and missing absorbers. The low-resolution teaching opacity cannot reproduce the paper’s resolved-line analysis.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy