 # Non centered parametrization of lognormal Distribution

Hello, All,
Happy New Year to everyone.

I have a question about how to write the Non-centered parametrization of lognormal distribution in STAN.

Suppose I have a variable, u ~ lognormal(mu, sigma_u), where mu and sigma_u both > 0 -----> (1)

I also understand that this can also be written as exp(u) ~ normal (mu_normal, sigma_u_normal) —> (2)

So my question is how can write Eq. (1) and (2) as non-centered parameterization in STAN?

For Eq(1), I am not sure, but can I write is -> mu + u_raw*sigma_u? with both mu and u_raw having lognormal distribution priors? I am not sure about it.

And for Eq(2). the non-centered version may be written as exp(mu_normal) + exp(u_raw)*sigma_u_normal ? with normal priors for mu_normal and u_raw?

Any guidance will be highly appreciated.

cheers
Antony

In Stan (note it’s a name, not an acronym, so the last letters don’t need to be capitalized, and often folks don’t bother even with the first letter), you can achieve selection of centered/non-centered parameterization of a lognormal prior via:

``````data {
// K: number of identifiable-units-of-observation (IUOO)
int K ;
// N: number of observations total (must be at least one per IUOO)
int<lower=K> N;
// which_K: index associating each observation with its IUOO
int<lower=1,upper=K> which_K[N] ;
// Y: vector of observations
vector[N] Y ;
// centered: binary toggle for intercept centered/non-centered parameterization
int<lower=0,upper=1> centered ;
}
parameters {
// mu: mean (across-IUOOs) of X
real mu ;
// sigma: sd (across-IUOOs) of X
real<lower=0> sigma ;
// X: mean (across observations) for each IUOO
vector<
offset = (centered ? 0 : mu)
, multiplier = (centered ? 1 : sigma)
>[K] X ;
}
model {
//hyper-priors
mu ~ std_normal() ; //must be changed to reflect domain expertise
sigma ~ std_normal() ; //must be changed to reflect domain expertise
//hierarchical *log-normal* prior for X:
X ~ lognormal( mu, sigma ) ;
//likelihood:
Y ~ normal( X[which_K], 1 ) ;
}
``````

That is, you don’t really have to do anything special relative to the normal case other than express X as `lognormal` rather than `normal`

Thanks Mike for both the correction with name and suggestion on non-centered parameterization.

Cheers
Antony

1 Like