StudentT Parameters

This is related to Can’t recover the scale parameter in Student’s T model. Firstly, the fact that lam or sd can be specified (but not both) doesn’t seem to be documented very well. It’s reasonably obvious from looking at the source, but otherwise not very well explained anywhere I don’t think.

My question is around the Stochastic Volatility example on the Getting Started page. I think I can follow most of it, but why the 1/volatility_process in the line

r = pm.StudentT('r', nu, lam=1/volatility_process, observed=returns)

Also, I am not very clear on the ‘log’ volatilities. Are both the si in the expression si ~ N(si-1, 1/sigma^2) and the expression s in the code the log of the volatility value? If so, why do we need both the log in log(yi) and the exp in exp(-2si)? And why the factor of 2?

These are model specifications that make the parameters easier to understand mostly. For example, you can parameterize the Normal distribution with standard deviation or precision, although the two is just a different representation of the same thing, sometimes people prefer to formula one way or the other so that the sampler could sample from the posterior easier (e.g., all the parameters are in a similar range).

As why choosing this particular parameterization in this example, maybe @twiecki have some domain specific reference?

This is a replication from the original NUTS paper: https://arxiv.org/abs/1111.4246. But looking at it now it seems like John Salvatier changed the model quite a bit. I’m not quite sure where the constants come from. It could just be that the curvature of the posterior is a bit less dramatic if you target different parts of the log-transform.