- pymc.init_nuts(*, init='auto', chains=1, n_init=500000, model=None, random_seed=None, progressbar=True, jitter_max_retries=10, tune=None, initvals=None, **kwargs)[source]#
Set up the mass matrix initialization for NUTS.
NUTS convergence and sampling speed is extremely dependent on the choice of mass/scaling matrix. This function implements different methods for choosing or adapting the mass matrix.
Initialization method to use.
auto: Choose a default initialization method automatically. Currently, this is
jitter+adapt_diag, but this can change in the future. If you depend on the exact behaviour, choose an initialization method explicitly.
adapt_diag: Start with a identity mass matrix and then adapt a diagonal based on the variance of the tuning samples. All chains use the test value (usually the prior mean) as starting point.
jitter+adapt_diag: Same as
adapt_diag, but use test value plus a uniform jitter in [-1, 1] as starting point in each chain.
jitter+adapt_diag_grad: An experimental initialization method that uses information from gradients and samples during tuning.
advi+adapt_diag: Run ADVI and then adapt the resulting diagonal mass matrix based on the sample variance of the tuning samples.
advi: Run ADVI to estimate posterior mean and diagonal mass matrix.
advi_map: Initialize ADVI with MAP and use MAP as starting point.
map: Use the MAP as starting point. This is discouraged.
adapt_full: Adapt a dense mass matrix using the sample covariances. All chains use the test value (usually the prior mean) as starting point.
jitter+adapt_full: Same as
adapt_full, but use test value plus a uniform jitter in [-1, 1] as starting point in each chain.
Number of jobs to start.
Dict or list of dicts with initial values to use instead of the defaults from Model.initial_values. The keys should be names of transformed random variables.
Number of iterations of initializer. Only works for ‘ADVI’ init methods.
int, array_like of
Seed for the random number generator.
Whether or not to display a progressbar for advi sampling.
Maximum number of repeated attempts (per chain) at creating an initial matrix with uniform jitter that yields a finite probability. This applies to
Extra keyword arguments are forwarded to pymc.NUTS.
Starting points for each chain.
Instantiated and initialized NUTS sampler object