Define own noninformative prior in stan

In the simple case of normally distributed data with unknown mean and variance, Jeffrey's prior is given by $$p(\mu, \sigma^2)=\frac{1}{\sigma^2}.$$ How can I define such a prior in the Stan language, i.e. how do I need to change the model statement below to obtain the desired result? (The model statement now is for the prior $p(\mu, \sigma^2)\propto 1.$

data {
int<lower=0> n; // obs in group x
real x[n];
}
parameters {
real muX;
real<lower=0> sigmaSquared;
real postPred;
}
transformed parameters
{
real<lower=0> sigmaX;
sigmaX <- sqrt(sigmaSquared);
}
model {
x ~ normal(muX, sigmaX);
postPred ~ normal(muX, sigmaX);
}
• You can't (at least I do not know any way to) directly define improper prior other than the default priors (the one you mentioned). You could instead use zero-ones trick to define an entire likelihood or, in your case, likelihood + prior. This should be very similar to the case of OpenBUGS software. – Tomas Jun 12 '15 at 19:24
• Thanks. Could you elaborate on what you mean by 'zero-ones trick' and where I can read up on how to define an entire likelihood? – Nussig Jun 12 '15 at 19:26
• In fact you don't need zero-one trick for the entire likelihood, only for your new prior. You can find info on how to construct them in OpenBUGS here: users.aims.ac.za/~mackay/BUGS/Manuals/Tricks.html Under the "Specifying a new prior distribution". Theta would be your $\sigma$ in that specific case – Tomas Jun 12 '15 at 19:33