PilotRun

class telescopic.tuning.PilotRun(samples, log_prob, acceptance, n_steps, initial_var)

The second halves of the pilot chains of adaptive_metropolis().

Attributes:
samplesndarray, shape (4, n, d)

The states of the second halves, ending with the last; beyond 20 dimensions only states \(\lceil d/20\rceil\) steps apart, or fewer for a short pilot.

log_probndarray, shape (4, n)
acceptancendarray, shape (4,)

Over all the steps of the second halves.

n_stepsint
initial_varndarray, shape (d,)

The variances of the 100 draws from the initial distribution that set the chains’ first covariance.

property cov

The pooled covariance plus 1e-10 times each variance on its diagonal.

A coordinate of variance 0 gets 1e-10.

Returns:
ndarray, shape (d, d)
property initial_width

How many times wider than the target the initial distribution is.

The geometric mean, over the coordinates in which both spread, of the ratio of the standard deviation \(s_{0,i}\) of the 100 draws from the initial distribution that set the chains’ first covariance to the standard deviation \(s_i\) of the second halves,

\[w = \exp\Big(\frac{1}{d'}\sum_i \log\frac{s_{0,i}}{s_i}\Big).\]
Returns:
float or None

None when no coordinate spreads in both.

property mean

The pooled mean.

Returns:
ndarray, shape (d,)
report(max_weight_ratio=None)

The report of this run.

Parameters:
max_weight_ratiofloat, optional

For an independence kernel, the largest weight \(\pi/q\) of the pilot’s draws relative to their median, which the report carries.

Returns:
TuningReport
property rhat

Gelman-Rubin \(\hat R\) of each coordinate.

Returns:
ndarray, shape (d,)