initial values in RStan/PyStan output?

48 views
Skip to first unread message

Bob Carpenter

unread,
Sep 29, 2013, 3:37:12 PM9/29/13
to stan...@googlegroups.com
The initial value is being saved in the Stan 2.0 command
line program.

I'd like to have the same behavior in RStan, PyStan,
etc. (Daniel --- this can go in the xxxStan spec.)

Sorry if it's already there --- I didn't know what to write
back to the person on the user's list about the new RStan.

I also added a feature request for doc in the Wiki on
how to build and install RStan from source. (Sorry if it's
there somewhere already --- I couldn't find it.)

- Bob

Marcus Brubaker

unread,
Sep 29, 2013, 4:26:23 PM9/29/13
to stan...@googlegroups.com
Is it being saved during sampling as well?  It would be good to confirm this, as I only know for sure about the optimization commands.

Cheers,
Marcus




- Bob

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jiqiang Guo

unread,
Sep 29, 2013, 5:27:01 PM9/29/13
to stan...@googlegroups.com
Since rstan 1.0, there is a function get_inits() to obtain the actual initial values.  But, there isn't any for the optimizing. 

--
Jiqiang 


To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.

Bob Carpenter

unread,
Sep 29, 2013, 6:40:37 PM9/29/13
to stan...@googlegroups.com
Thanks. I didn't see the get_inits() function.

Do you think it should be in the output iterations, too?
I think it makes sense, but then it'll just skew the
traceplots even more if they include it.

- Bob

Jiqiang Guo

unread,
Sep 30, 2013, 6:46:16 PM9/30/13
to stan...@googlegroups.com
Suppose we run the eight school example at https://code.google.com/p/stan/wiki/RStanGettingStarted#Example_1:_Eight_Schools, we can use get_inits as follows. 

It is not in the csv files for now. 

> ii <- get_inits(fit)
> ii
[[1]]
[[1]]$mu
[1] 0.6838074

[[1]]$tau
[1] 0.6452438

[[1]]$eta
[1]  1.2558788  0.2486423 -1.1750325  1.3058190 -1.1714209  1.0709960  0.7367854
[8] -0.4932346

[[1]]$theta
[1]  1.49415540  0.84424232 -0.07437499  1.52637900 -0.07204463  1.37486092
[7]  1.15921362  0.36555088


[[2]]
[[2]]$mu
[1] -0.9556651

[[2]]$tau
[1] 4.332435

[[2]]$eta
[1]  1.4987792  1.5643572 -1.8967160 -0.3008269 -0.3494690  0.5654918 -0.4822732
[8] -0.1321233

[[2]]$theta
[1]  5.537699  5.821811 -9.173065 -2.258978 -2.469717  1.494291 -3.045082
[8] -1.528081


[[3]]
[[3]]$mu
[1] -1.023053

[[3]]$tau
[1] 0.1470396

[[3]]$eta
[1]  0.6825585 -1.3558435 -1.7691651 -0.7966862 -0.5692770  0.1701447 -0.9438256
[8]  1.5039454

[[3]]$theta
[1] -0.9226900 -1.2224157 -1.2831904 -1.1401975 -1.1067594 -0.9980351 -1.1618328
[8] -0.8019136


[[4]]
[[4]]$mu
[1] 0.7117374

[[4]]$tau
[1] 0.8896294

[[4]]$eta
[1] -0.05865353  0.57099054 -0.13552422  0.44198954 -1.89727981  0.03972086
[7]  0.51042112 -0.93344531

[[4]]$theta
[1]  0.6595575  1.2197074  0.5911711  1.1049443 -0.9761384  0.7470743  1.1658231
[8] -0.1186829


--

Bob Carpenter

unread,
Oct 1, 2013, 4:13:03 AM10/1/13
to stan...@googlegroups.com
Thanks --- you already mentioned the function was there. My
problem was that I didn't know about it and didn't see it scanning
the index. Of course, I saw it in the doc as soon as you pointed me to it.

(Speaking of which, the reason I didn't find the building from
source is that you had an index that didn't include it. I updated
and organized the index with some descriptions. Thanks again for
putting it there in the first place.)

I do NOT think this should go in the getting started docs.

- Bob
> stan-dev+unsubscribe@__googlegroups.com <mailto:stan-dev%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out <https://groups.google.com/groups/opt_out>.
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages