# Affine transformation in Stan

**URL:** https://discourse.mc-stan.org/t/affine-transformation-in-stan/15278
**Category:** General
**Tags:** specification
**Created:** [May 21, 2020, 3:17am UTC](https://discourse.mc-stan.org/t/affine-transformation-in-stan/15278 "2020-05-21T03:17:32Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)
#### Post date: [May 21, 2020, 12:44pm UTC](https://discourse.mc-stan.org/t/affine-transformation-in-stan/15278/5 "2020-05-21T12:44:50Z")

</div>

To be a bit more concrete, the `offset` and `multiplier` code:

```
parameters {
  real<offset=mu,multiplier=sigma> x;
}
model {
  x ~ normal(mu, sigma);
}

```

Is equivalent to:

```
parameters {
  real x_raw;
}
transformed parameters {
  real x = mu + x_raw * sigma;
}
model {
  x_raw ~ std_normal();
}

```

It makes for a bit more of a concise way to specify a non-centered distribution, and also reduces the number of parameters to be saved (i.e. only need to save `x`, not `x` and `x_raw`) which can be very handy for large models/samples

---

_[View the full topic](https://discourse.mc-stan.org/t/affine-transformation-in-stan/15278)._
