# Initial value different from specified initial value

**URL:** <https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279>\
**Category:** General\
**Tags:** initialization\
**Created:** [August 25, 2025, 2:51pm UTC](https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279 "2025-08-25T14:51:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![buf](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/buf/32/18551_2.png) [@buf](https://discourse.mc-stan.org/u/buf)\
**Post date:** [August 25, 2025, 2:51pm UTC](https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279/1 "2025-08-25T14:51:19Z")

</div>

Hi everyone,

I am trying to understand the ‘initial values’ in one of my models. I specify some initial values, and they are recognized by Stan, as can be seen in the first screenshot:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/7/1/712fce5c22d37568a837e4c51b34c244df659e44.png)

Now, when I look into the sampled values, I can see they don’t perfectly match my initial values. From what I understand (and read elsewhere), I should think of the initial values as ‘timestep zero’, and the first values in my samples are then ‘timestep one’, meaning after NUTS has wandered around a bit in parameter space. This makes sense to me and explains why values are near, but not identical to, my specified initial values. However, for the two parameters ‘pdd1\_pop’ and ‘dtopt\_vpop’, the values are very different, and 34 for pdd1\_pop and 19 for dtopt\_vpop are further from where the chains eventually settle than my specified initial values:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/6/0/60483a12f8c8234543e5eaf151b155be49724342.png)

Both these parameters have a lower bound of 0, but many of the other parameters have that as well. It is unintuitive to me why some parameters would change so drastically while others don’t change much at all. Also, I don’t fully understand the warm-up phase in NUTS, so maybe this behaviour is expected.

Any hint or explanation would be greatly appreciated.

Cheers,

Friedrich

---

<div class="post-metadata">

**Author:** ![jsocolar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jsocolar/32/2486_2.png) [@jsocolar](https://discourse.mc-stan.org/u/jsocolar)\
**Post date:** [August 25, 2025, 3:01pm UTC](https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279/2 "2025-08-25T15:01:09Z")

</div>

If the gradient with respect to those parameters is very steep at your initial point, this could explain it. You can check using **`grad_log_prob`. See** [log\_prob and grad\_log\_prob functions — log\_prob-methods • rstan](https://mc-stan.org/rstan/reference/stanfit-method-logprob.html)

---

<div class="post-metadata">

**Author:** ![buf](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/buf/32/18551_2.png) [@buf](https://discourse.mc-stan.org/u/buf)\
**Post date:** [August 25, 2025, 3:59pm UTC](https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279/3 "2025-08-25T15:59:28Z")

</div>

Hi Jacob,

Thanks for your reply. Here are the gradients at the initial values:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/4/8/4814b1cff99dc614b26309c78455b6fcebb33971.png)

The first one is pdd1\_pop, and the 5th one is dtopt\_vpop. So yes, they are the parameters with the steepest gradients. And since the one for pdd1 is negative and for dtopt is positive, we can expect our first sampled value for pdd1 to be smaller than the initial value, and for dtopt, we would expect a value larger than the initial value?

---

<div class="post-metadata">

**Author:** ![jsocolar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jsocolar/32/2486_2.png) [@jsocolar](https://discourse.mc-stan.org/u/jsocolar)\
**Post date:** [August 25, 2025, 6:03pm UTC](https://discourse.mc-stan.org/t/initial-value-different-from-specified-initial-value/40279/4 "2025-08-25T18:03:03Z")

</div>

That would be the first-order expectation, yes. It’s possible that the gradients for these two parameters twist through some odd shape that flips the sign (while the remainder of the parameters wander around in a way that prevents the no-U-turn criterion from being triggered), but I think this would not be very likely.
