# Simple CAR model and log-transform

**URL:** <https://discourse.mc-stan.org/t/simple-car-model-and-log-transform/4763>\
**Category:** Modeling\
**Tags:** fitting-issues\
**Created:** [July 5, 2018, 1:35pm UTC](https://discourse.mc-stan.org/t/simple-car-model-and-log-transform/4763 "2018-07-05T13:35:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [July 9, 2018, 4:03pm UTC](https://discourse.mc-stan.org/t/simple-car-model-and-log-transform/4763/7 "2018-07-09T16:03:57Z")

</div>

There’s a rather convoluted thread on doing a Laplace approximation to latent variables like those that you might try (I think the final working code ended up in: [Algebraic sovler problems (Laplace approximation in Stan) - #30 by anon75146577](http://discourse.mc-stan.org/t/algebraic-sovler-problems-laplace-approximation-in-stan/2172/30)) if you have to go with non-normal output.

Regarding the log gamma thing, there’s a difference. Just `target += gamma_lpdf(log_tau | 2, 1); ` does not include the -log\_tau adjustment. You need the -log\_tau adjustment because you’re putting a prior on a transformed variable. Section 22.3 “Change of Variables”, page 290 from the 2.17.0 manual has some good details on what this is and where it comes from.

> [@ALang](#):
>
> I also tried your `phi_z` trick but then divergences hit the ceilling (something like 3999…)

Lol you win some you lose some

---

_[View the full topic](https://discourse.mc-stan.org/t/simple-car-model-and-log-transform/4763)._
