EngineBuilder.set_duration()

EngineBuilder.set_duration()#

EngineBuilder.set_duration(warmup_duration, posterior_duration, term_duration=50, thinning_posterior=1, thinning_warmup=1)[source]#

Sets epochs using the stan_epochs() function.

Note that term_duration needs to be long enough that tuning algorithms like dual averaging can converge.

See also

add_posterior

For adding posterior epochs.

add_burnin

For adding burnin epochs.

add_adaptation

For adding adaptation epochs.

set_duration

An alternative method to specify adaptation and posterior epochs, see notes for details.

Notes

There are some differences in the details between the methods add_posterior(), add_adaptation(), add_burnin() and set_duration().

  • set_duration() overwrites all existing epochs with the epochs defined in this method. In contrast, the add_ methods only add additional epochs that are appended to the potentially existing ones.

  • set_duration() sets both adaptation and posterior epochs, while each add_ method only adds epochs of one type.

  • set_duration() has an argument term_duration that defines the number of samples drawn in the final fast adaptation epoch, and it defaults to a fixed value of 50 samples. In contrast, add_adaptation() defines the number of samples drawn in the final fast adaptation epoch as a fraction of the total number of adaptation samples, and allows users to change this fraction via the argument term. As a result, if add_adaptation() is used, the length of the final fast adaptation phase increases automatically, if the total number of warmup samples increases, while it remains constant if set_duration() is used.