Uncertainties

MethodAssumesAccounts for
fit_model_lsqfit covarianceerror bars correct and uncorrelated; model locally linearthe quoted errors, rescaled so that χ²ᵣ = 1
bootstrap_fitmany exchangeable blocks of datacorrelated calibration errors, wrong error bars, a bad night or baseline

The posterior samplers (fit_model_nested, fit_model_ensemble, fit_model_pigeons) use the error bars as given; they are not part of the study below.

This page reports a simulation study of the two methods, compared with PMOIRED on the same data. The code is in demos/bootstrap_validation, where RESULTS.md has the same tables.

Method

120 independent noise realisations ("universes") of one observation are generated and fitted. The error bar each method gives on one universe is compared with the scatter of the best fits over all universes:

sigma_true    = std over universes of the best-fit value      <- the truth
sigma_report  = mean over universes of the quoted 1 sigma     <- the claim
ratio         = sigma_report / sigma_true                     <- 1.00 = calibrated
coverage      = fraction of universes with |best - truth| < sigma_report
                                                              <- 0.683 = calibrated

A ratio below 1 means the error bars are too small. sigma_true from 120 universes has about 6.5% noise; it is the same for all methods in a regime, so differences between methods in a column are smaller than that.

The model is a binary at CHARA/MIRC H-band resolution (a partially resolved primary plus an unresolved companion at 1.44 mas with 5% of the flux), fitted for four parameters to V² and T3PHI. The uv coverage, MJDs, telescope configurations and error bars come from a real dataset; the observables are replaced.

RegimeSimulated noise
idealindependent Gaussian noise at the quoted error bars
systematicsas ideal, plus a calibration offset per (epoch, baseline or triangle), common to all wavelengths: 5% on V², 1.5° on T3PHI
underestimatednoise at 2× the quoted error bars
fewblocksas ideal, one snapshot: 18 blocks instead of 180
mismatchthe truth has a third component that is not fitted

Choosing a resampling scheme

bootstrap_fit(...; mode=...) sets how the block multiplicities are drawn. Times are per replicate, single-threaded, on the benchmark dataset (1440 data points, 180 blocks, 4 free parameters; demos/bootstrap_validation/benchmark.jl).

ModeScheme180 blocks18 blocksms / replicate
:replacement (default)multinomial0.87–1.010.96–1.143.4
:halfsamplebalanced repeated replication: a random half0.94–1.061.24–1.562.8
:weightsmultiplier (Bayesian) bootstrap: continuous block weights, applied to the error bars0.78–0.990.71–0.853.1
:pmoiredPMOIRED's two independent half-samples, fitted jointly0.62–0.74 ⚠0.67–0.79 ⚠3.2

The block columns give the range of the ratio over the regimes and parameters with that number of blocks; bold is the best per column.

`:pmoired` gives error bars √2 too small

:pmoired reproduces PMOIRED's scheme, for comparing with PMOIRED results. Its block multiplicities have variance ½ instead of 1, so its error bars are 0.62–0.79 of the true scatter in every regime, with 1σ coverage near 0.50. bootstrap_fit warns on its first use in a session.

  • :halfsample is the best calibrated with many blocks, and the fastest, since each replicate fits half the data. With few blocks its error bars are too large.
  • :replacement is within 14% in all regimes, including the single snapshot.
  • :weights gives the smallest error bars of the three, most so with few blocks.

A replicate takes 3.4 ms, against 3.8 ms for one Levenberg-Marquardt fit; 0.85 ms of it is the resampling. With threaded = true (default) replicates run on all Julia threads: 500 replicates take about 0.6 s on 16 threads.

granularity sets the blocks. :config (default) is one block per MJD and telescope configuration, and is calibrated from 18 blocks up. :epoch (one block per MJD) gives 0.92–1.83 on a single snapshot. :point (one block per data point) ignores correlations between points. bootstrap_fit warns when there are fewer than 10 blocks.

MJD precision

Blocks are keyed on the MJD. readoifits stores v2_mjd, t3_mjd, vis_mjd, flux_mjd and uv_mjd as Float64 for any T (Float32 values near MJD 55000 are 5.6 minutes apart), so the blocks are the same with T = Float32 and T = Float64.

Results

ratio = quoted sigma / true scatter, one column per parameter; the last column is the coverage averaged over the four parameters (0.683 when calibrated).

Regime: ideal

methodA,udB,fB,xB,ycoverage
OITOOLS analytic (LM)0.960.980.981.040.66
OITOOLS parametric MC0.910.960.961.030.63
OITOOLS block bootstrap0.890.950.951.010.64
OITOOLS epoch bootstrap0.900.970.921.010.62
OITOOLS weighted bootstrap0.880.950.870.990.61
OITOOLS half-sample (BRR)0.940.981.011.060.66
OITOOLS PMOIRED scheme0.650.700.670.740.49
PMOIRED analytic (dpfit)0.960.980.981.040.65
PMOIRED bootstrapFit0.640.690.660.740.47
PMOIRED bootstrapFit (no start jitter)0.650.690.670.740.48

Regime: systematics

methodA,udB,fB,xB,ycoverage
OITOOLS analytic (LM)0.180.340.270.310.22
OITOOLS parametric MC0.040.090.070.080.06
OITOOLS block bootstrap0.880.920.870.960.61
OITOOLS epoch bootstrap0.890.900.850.940.61
OITOOLS weighted bootstrap0.820.900.780.920.58
OITOOLS half-sample (BRR)0.990.980.941.000.65
OITOOLS PMOIRED scheme0.680.690.620.700.50
PMOIRED analytic (dpfit)0.180.340.270.310.21
PMOIRED bootstrapFit0.660.670.630.700.50
PMOIRED bootstrapFit (no start jitter)0.670.680.620.700.49

Regime: underestimated

methodA,udB,fB,xB,ycoverage
OITOOLS analytic (LM)1.010.961.000.950.68
OITOOLS parametric MC0.480.470.490.470.37
OITOOLS block bootstrap0.960.910.970.900.64
OITOOLS epoch bootstrap0.940.930.930.900.63
OITOOLS weighted bootstrap0.920.900.860.900.63
OITOOLS half-sample (BRR)1.000.941.030.950.65
OITOOLS PMOIRED scheme0.680.680.670.660.51
PMOIRED analytic (dpfit)1.010.960.990.950.67
PMOIRED bootstrapFit0.670.650.670.650.49
PMOIRED bootstrapFit (no start jitter)0.670.670.680.650.50

Regime: fewblocks

methodA,udB,fB,xB,ycoverage
OITOOLS analytic (LM)1.051.020.881.020.70
OITOOLS parametric MC1.010.990.861.000.69
OITOOLS block bootstrap0.961.060.971.140.69
OITOOLS epoch bootstrap0.921.731.831.620.70
OITOOLS weighted bootstrap0.810.850.710.750.57
OITOOLS half-sample (BRR)1.331.261.241.560.79
OITOOLS PMOIRED scheme0.700.760.670.790.52
PMOIRED analytic (dpfit)1.031.000.871.000.70
PMOIRED bootstrapFit0.700.720.640.710.54
PMOIRED bootstrapFit (no start jitter)0.690.710.640.700.52

Regime: mismatch

methodA,udB,fB,xB,ycoverage
OITOOLS analytic (LM)2.762.302.772.650.05
OITOOLS parametric MC1.020.871.021.030.01
OITOOLS block bootstrap11.115.804.796.010.25
OITOOLS epoch bootstrap11.612.012.492.440.04
OITOOLS weighted bootstrap10.225.575.446.830.25
OITOOLS half-sample (BRR)10.115.386.226.630.25
OITOOLS PMOIRED scheme6.273.964.154.630.23
PMOIRED analytic (dpfit)2.762.302.712.640.05
PMOIRED bootstrapFit6.764.103.624.600.22
PMOIRED bootstrapFit (no start jitter)6.944.083.664.550.22

Summary

  1. OITOOLS analytic (LM) and PMOIRED analytic (dpfit) agree to two decimals in every regime; both rescale the covariance to χ²ᵣ = 1.
  2. PMOIRED bootstrapFit gives 0.64–0.74 in every regime, with coverage near 0.50. mode = :pmoired reproduces it to ±0.02 in all 20 (regime, parameter) cells.
  3. With correlated calibration errors (systematics), the analytic covariance is 3–5× too small after χ²ᵣ rescaling (a factor 3.8 here). The block bootstraps give 0.78–1.00.
  4. With noise at 2× the quoted errors, the analytic errors give 0.95–1.01.
  5. Refitting perturb_data replicates (parametric Monte Carlo) equals the analytic covariance in ideal and fewblocks, gives half in underestimated, and is 11–25× too small with systematics. It is not offered as an uncertainty method.
  6. With an unmodelled third component the best fit is off by 10–36 true σ. The bootstraps' error bars grow 5–11×, and coverage is 0.22–0.25 for the bootstraps and 0.05 for the analytic errors.

Cross-package performance

Same file, same model, same number of replicates:

single fitbootstrap, 1 process/threadbootstrap, all cores
OITOOLS bootstrap_fit3.8 ms3.4 ms / replicate1.2 ms / replicate (16 threads)
PMOIRED bootstrapFit44 ms78 ms / replicate30 ms / replicate (24 processes)

A PMOIRED replicate fits a dataset built from two copies of the data.

Reproducing

cd demos/bootstrap_validation
OUT=/tmp/bootstrap_validation

julia --project=../.. make_universes.jl $OUT 120   # simulate
python3 sanitize.py $OUT                           # make files readable by PMOIRED
julia --project=../.. -t auto run_oitools.jl $OUT 100
PMOIRED_MAX_THREADS=12 python3 run_pmoired.py $OUT 100
python3 analyze.py $OUT                            # the tables above
julia --project=../.. benchmark.jl $OUT            # the wall times above

demos/bootstrap_validation/README.md describes the steps, including what sanitize.py changes for PMOIRED to read the files.