Result and summary fields

What a result holds

measure: the kept replicates that metatoms (N, d)weights (N,)replicate (N,)estimate(h)quantile(q)histogram(dims)every replicate, censored ones includedindex (R_total,)meeting_times (R_total,)costs (R_total,)tv_bound(t)the run's settings and recordk, m, lag, thin, max_iter, keepseed, kernel, initial, tuning, pilotnames, ndimcountsn_replicates, n_kept, n_censoredn_log_prob, n_grad, n_grad_zeroedwall_time, interrupted, abandoned

The attributes of a telescopic.Result in four groups, with arrows to the methods that read its signed measures and its meeting times; tv_bound counts a censored pair as meeting at max_iter + 1.

Attribute

Content

n_replicates, n_censored

\(R\), the number of replicates whose pairs met, and the number of pairs censored at max_iter (Censored pairs)

k, m, lag, thin, max_iter

the settings of the run (Settings)

names, ndim

the parameter names and the dimension \(d\)

measure

the replicates’ signed measures

index, meeting_times, costs

for every replicate, censored ones included: its index, its meeting time (inf if censored) and its kernel applications

n_log_prob, n_grad, wall_time

the evaluations of the log-density and of its gradient, and the seconds, of the replicates, without tuning, the meeting-time pilot and the gradient check, which runs when the sampler is built

kernel, initial

the frozen kernel and the initial distribution

tuning, pilot

the report of the tuning chains, and the meeting times of the lag-1 pilot pairs that chose k; None when not run

seed

the root numpy.random.SeedSequence, which reproduces the run

interrupted

whether a requested replicate never ran (Parallel runs)

keep, n_kept

the run’s keep, None when every replicate stored its signed measure, and the number of kept replicates that met, which measure, the quantiles, the histograms, estimate, chains() and to_datatree() read (Keeping a subset)

abandoned

the replicates that an error stopped while they ran and that have not run since (Continuing after an error)

The summary

telescopic.Result.summary() returns a telescopic.Summary. It shows a table with one row per parameter, then the settings and diagnostics of the run and the warnings that apply, one per line. A notebook shows it in HTML, as here; print gives it as text, whose lines below the table are wrapped at 80 characters:

summary = result.summary()
summary
meanstandard_errorstdq16q50q84
x00.001305640.004665960.998981-0.9924820.0001248551.00025
x10.0005826170.004628410.999527-0.992660.0001157970.995682
  • R = 1000, k = 37, m = 370, lag = 37, thin = 1
  • kernel: RandomWalk(cov=<2x2>, scale=None, coupling='reflection')
  • meeting times: median 46, 90% 60, 99% 75, max 103; censored 0
  • tail index of the meeting times: 4.02
  • cost per replicate: 381.1 kernel applications, 0.0005 s; relative cost 1.14
  • pairs meeting after k + lag: 1.3% (at most 2.1% at 95%)
  • largest share of one replicate in a variance: 2%, for the variance of x1

The columns of the table:

  • mean: the average of the replicates’ estimates of the parameter’s mean, which is unbiased; standard_error: its Monte Carlo error, valid as the number of replicates grows, however short each run.

  • std: \(\sqrt{\max(0, \widehat{\mathrm{Var}})}\), from the unbiased estimate of the variance; consistent, not unbiased.

  • q16, q50 and q84: the 16%, 50% and 84% quantiles of the pooled signed measures; consistent, not unbiased.

The lines below it:

  • \(R\), the settings k, m, lag and thin (Settings), and the kernel, whose floating-point parameters show to 4 significant figures (summary.footer keeps every digit);

  • with keep, which replicates each column comes from: the mean, its standard error and the standard deviation from all \(R\), and the quantiles from the kept replicates, or “no kept replicate” when none met, with the quantile columns then nan (Keeping a subset);

  • the median, the 90% and 99% quantiles and the maximum of the meeting times of every pair, where censored pairs sort above every pair that met, and a quantile that falls on one shows as > and the cap, such as > 12 for max_iter=12; from 500 replicates, the tail index of those that met (tail); and the number of censored pairs (censored);

  • the mean cost of a replicate in kernel applications and in seconds, and the relative cost, the mean cost over \(m - k + 1\) (Settings);

  • the fraction of pairs that met after k + lag, censored ones included, with a one-sided 95% upper bound: only these replicates carry a bias correction, and with lag = k the fraction is close to the bound on the total variation distance at k (Distance to stationarity);

  • the largest share of one replicate in the variance of the estimate of a coordinate’s mean or variance, and that estimate (variance);

  • for an interrupted run, that its estimates are consistent but not exactly unbiased (Interrupting a run); while an error has abandoned replicates, that the estimates leave out replicates selected for long meeting times, in its place (Continuing after an error);

  • each warning that applies (Warnings).

summary.table holds the columns as arrays, and summary.footer the rest as a dictionary, with keep, n_kept and abandoned, the number of abandoned replicates. telescopic.Summary.to_dict() converts both to Python numbers, and telescopic.Summary.to_pandas() returns the table as a pandas.DataFrame indexed by parameter name (it needs the pandas extra):

summary.to_dict()["parameters"]["x0"]
{'mean': 0.001305641597757814,
 'standard_error': 0.0046659580817638375,
 'std': 0.9989809040469655,
 'q16': -0.9924816684420437,
 'q50': 0.00012485544571522178,
 'q84': 1.0002502577970125}

The diagnostics of a run

telescopic.Result.diagnostics() returns the diagnostics that the summary prints, as a dictionary; The summary defines each line of the summary.

result.diagnostics()
{'meeting_time_50': 46.0,
 'meeting_time_90': 60.0,
 'meeting_time_99': 75.0,
 'meeting_time_max': 103.0,
 'tail_index': 4.018532409639094,
 'censored': 0,
 'late_fraction': 0.013,
 'late_fraction_upper': 0.020589286529908272,
 'tv_bound_at_k': 0.013,
 'variance_share': 0.019296116850431644,
 'variance_share_of': 'the variance of x1',
 'variance_share_replicate': 654,
 'mean_cost': 381.119,
 'seconds_per_replicate': 0.0005003891609999868,
 'relative_cost': 1.1410748502994013}
  • meeting_time_50, meeting_time_90, meeting_time_99, meeting_time_max and censored: the quantiles of the meeting times of every pair, each an observed meeting time from the sorted values, where censored pairs sort above every pair that met, and the number of censored pairs. A quantile that falls on a censored pair is inf.

  • tail_index: the tail index of \(\tau - L + 1\), the power \(\alpha\) at which the probability of a value above \(t\) falls as \(t^{-\alpha}\), by Hill’s estimate from the largest values; nan below 500 replicates or behind ties (tail).

  • late_fraction and late_fraction_upper: the fraction of pairs that met after k + lag, censored ones included, and its one-sided 95% Clopper-Pearson upper bound, an exact binomial confidence bound, which stays informative when the fraction is 0. The fraction is the leading term of tv_bound_at_k, the TV bound at \(k\), and with lag = k the two are close.

  • variance_share, variance_share_of and variance_share_replicate: the largest share of one replicate in the variance of the estimate of a coordinate’s mean or variance, with each replicate’s second moments taken about the mean estimate, that estimate, such as "the variance of x1", and the index of that replicate; nan, None and None below 2 replicates (variance).

  • mean_cost, seconds_per_replicate and relative_cost: the cost of a replicate (Settings).