Let’s think of a simple exponential model (which works well and fast)

```
data {
int <lower = 0> N; // number of observations
int <lower = 0> K; // number of parameters
row_vector[K] X[N];
real y[N];
}
parameters {
vector[K] beta;
}
model {
beta ~ normal(0, 1);
for(t in 1:N)
y[t] ~ exponential(exp(X[t]*beta));
}
```

My model is actually more complicated and the chains don’t mix. I am trying to reparameterize the model using the fact that if X \sim Exp(\lambda) then X \times \lambda \sim Exp(1)

```
data {
int <lower = 0> N; // number of observations
int <lower = 0> K; // number of parameters
row_vector[K] X[N];
real y[N];
}
parameters {
vector[K] beta;
}
transformed parameters{
real y_std [N];
for(t in 1:N)
y_std[t] = y[t]* exp(X[t]*beta);
}
model {
beta ~ normal(0, 1);
for(t in 1:N)
y_std[t] ~ exponential(1);
}
```

But this second model is not right (does not recover the parameters in synthetic data). Does anyone know why? Thanks!

**Edit**: see code in response below