# Initializing values for the "optimizing" function using rstan

**URL:** <https://discourse.mc-stan.org/t/initializing-values-for-the-optimizing-function-using-rstan/1241>\
**Category:** Modeling\
**Created:** [July 14, 2017, 5:23pm UTC](https://discourse.mc-stan.org/t/initializing-values-for-the-optimizing-function-using-rstan/1241 "2017-07-14T17:23:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![howard](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/howard/32/17112_2.png) [@howard](https://discourse.mc-stan.org/u/howard)\
**Post date:** [July 14, 2017, 5:23pm UTC](https://discourse.mc-stan.org/t/initializing-values-for-the-optimizing-function-using-rstan/1241/1 "2017-07-14T17:23:21Z")

</div>

This is just a note that if you are trying to initialize the starting values in R of the parameters using the optimizing function, then the structure of the “init” list option as described in the rstan manual is wrong. The manual points to the “stan” function and suggests that the init parameter should be a list of lists.

In fact, if you have, for example, parameters a, b, then init should be specified as just  
init = list (a=a, b=b)

and not  
init = list(list(a=list(a), b=list(b)) )  
as suggested by the manual.

Perhaps the manual should be corrected?

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [July 17, 2017, 11:15pm UTC](https://discourse.mc-stan.org/t/initializing-values-for-the-optimizing-function-using-rstan/1241/2 "2017-07-17T23:15:29Z")

</div>

Thanks! I created an issue:

[https://github.com/stan-dev/rstan/issues/434](https://github.com/stan-dev/rstan/issues/434)

so it should get fixed for the next release.

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Post date:** [July 18, 2017, 6:01am UTC](https://discourse.mc-stan.org/t/initializing-values-for-the-optimizing-function-using-rstan/1241/3 "2017-07-18T06:01:23Z")

</div>

Thanks for letting us know. I just added a clarification in the doc for the next release.

[https://github.com/stan-dev/rstan/commit/901101506c4f1a00f209fdab5dd7aacc6633e5b0](https://github.com/stan-dev/rstan/commit/901101506c4f1a00f209fdab5dd7aacc6633e5b0)
