For the models fit with an rstanarm modeling function that supports
the QR
argument (see e.g, stan_glm
), if QR
is
set to TRUE
then the prior distributions for the regression
coefficients specified using the prior
argument are not relative to
the original predictor variables \(X\) but rather to the variables in the
matrix \(Q\) obtained from the \(QR\) decomposition of \(X\).
In particular, if prior = normal(location,scale)
, then this prior on
the coefficients in \(Q\)-space can be easily translated into a joint
multivariate normal (MVN) prior on the coefficients on the original
predictors in \(X\). Letting \(\theta\) denote the coefficients on
\(Q\) and \(\beta\) the coefficients on \(X\) then if \(\theta
\sim N(\mu, \sigma)\) the corresponding prior on
\(\beta\) is \(\beta \sim MVN(R\mu, R'R\sigma^2)\), where \(\mu\) and \(\sigma\) are vectors of the
appropriate length. Technically, rstanarm uses a scaled \(QR\)
decomposition to ensure that the columns of the predictor matrix used to
fit the model all have unit scale, when the autoscale
argument
to the function passed to the prior
argument is TRUE
(the
default), in which case the matrices actually used are
\(Q^\ast = Q \sqrt{n-1}\) and \(R^\ast =
\frac{1}{\sqrt{n-1}} R\). If autoscale = FALSE
we instead scale such that the lower-right element of \(R^\ast\) is
\(1\), which is useful if you want to specify a prior on the coefficient
of the last predictor in its original units (see the documentation for the
QR
argument).
If you are interested in the prior on \(\beta\) implied by the prior on
\(\theta\), we strongly recommend visualizing it as described above in
the Description section, which is simpler than working it out
analytically.