When using ADVI, we usually sample the approximation and the using those samples we perform PPC.
Consider following example,
w = Normal("w", mu = 0, sd = 10, shape = number_of_features)
mu = w * x
likelihood = Normal("y", mu = mu, std = 10, observed = y)
approx = pm.advi.fit(1000)
trace = approx.sample(50000)
I want to understand what really happens during the sampling of approx. Is this what happens during when called approx.sample(50000) ?
w = Normal("w", approx.mean.eval() = 0, sd = approx.std.eval(), shape = number_of_features)
mu = w * x
likelihood = Normal("y", mu = mu, std = 10)
trace = sample(50000)
Moreover, if we want to use intermediate mean and std values using the tracker and then compute the PPC for those values, how can I achieve that?