# Reparametrization of bounded parameter vector

Hello, I would like to reparametrize a model in a similar way as done for the stochastic volatility example:

There they show a way to reparametrize the log volatility vector h to allow faster sampliing.
My question is whether it is possible to set bound for the vector h, for example by restricting it between 0 and 1. Obviously I cannot do it directly on the transformed paratemer as it would rise an exception.

My problem is not specific to this kind of model, but for any model were we want to set an upper/lower bound for a parameter that is meant to be reparametrize in the “trasformed paramters” section, and the parameter is has some autoregressive form like the log volatility is the example. I have seen a similar question answered by bob carpenter here Non-centered parameterisation with boundaries. But I don’t know how to adapt it for this kind of problem.

thank you very much

1 Like

The most direct way is to apply a transformation to the parameter by hand, i.e. in the notation of the model, you could model h_t exactly as in the model (it has support over whole \mathbf{R}). Then you can define \bar{h}_t = \mathrm{logit}^{-1}(h_t). (inv_logit in Stan). If you then use \bar{h}_t only on the “right hand side” of sampling statements (e.g. y_t \sim Bernoulli(\bar{h}_t)) no additional steps are necessary. If you want to use it on the “left hand side” (e.g. \bar{h}_t \sim Beta(\alpha,\beta) you would need to include the log Jacobian adjustment.

See https://mc-stan.org/docs/2_24/reference-manual/variable-transforms-chapter.html for how Stan computes constrained parameters from unconstrained.