How to understand the role of testval, why this parameter greatly affects the model?

How to understand the role of testval, why this parameter greatly affects the model?

You can set the testval to control where the sampler starts. You should usually not do this, and if your choice matters than that is a pretty sure sign that sampling isn’t working properly for at least some of your starting values, and probably for all of them. Do you have a concrete example where you face a problem like this?

For example, in the algorithm for human deceit at the [Probabilistic-Programming-and-Bayesian-Methods-for-Hackers]

in pymc2, the code like this:

with model:
true_answers = pm.Bernoulli(“truths”, p, size=N)
first_coin_flips = pm.Bernoulli(“first_flips”, 0.5, size=N)
second_coin_flips = pm.Bernoulli(“second_flips”, 0.5, size=N)

in pymc3, the code like this:

with model:
true_answers = pm.Bernoulli(“truths”, p, shape=N, testval=np.random.binomial(1, 0.5, N))
first_coin_flips = pm.Bernoulli(“first_flips”, 0.5, shape=N, testval=np.random.binomial(1, 0.5, N))
second_coin_flips = pm.Bernoulli(“second_flips”, 0.5, shape=N,
testval=np.random.binomial(1,0.5, N))
why we set the testval in Pymc3