Bounded prior distributions for ADVI

Hello, I am studying one of the examples from PyMC.

In this example, when fitting ADVI, I noticed that the prior distribution for sigma_a is set as uniform.

It seems to me that after training the variational distribution, it is not transformed using the exp function. When I compared the mean values with az.summary, there is a significant difference.

Upon investigating the pymc.Model, I found that it is set like sigma_a_interval. In this case, what kind of transformation should be applied to obtain the desired results?

When I changed the uniform prior to a half-Cauchy prior in the example, I was able to achieve the desired result using the exp function.

Uniforms use an interval transform, which is basically a generalized logistic function. It maps the range of real numbers to the support of the uniform distribution.

I’m not sure what you mean by “desired result”

Thank you for your reply! My explanation was a bit lacking.

After training ADVI, let’s denote the variational mean and variational standard deviation as mu and sigma, respectively. Typically, data is generated from N(mu, sigma^2), and a transformation must be applied to map it to the constrained domain (e.g., exp function).

I am curious about what kind of transformation is applied after sampling from the normal distribution in this example. It seems that PyMC automatically obtains the (approximating) posterior samples internally, but I would like to understand how this process is handled.

I will investigate how the interval transformation works internally.