working on chains class & R interface

6 views
Skip to first unread message

Bob Carpenter

unread,
May 13, 2012, 9:20:19 PM5/13/12
to stan...@googlegroups.com
I've got the basic bits of the chains
class going and tested (Daniel has most of
the key stats working on a variable-by-variable
basis already).

I'm going to need to change stan/gm/generator.hpp
to produce output more flexibly than writing csv
format to a stream. But only the compiled model
knows what its variables and their sizes are and
how to transform them given their constraints.

So I propose adding two methods to the compiled model
to allow us to construct a chains() object:

vector<vector<size_t> >
param_dims();

vector<string>
param_names();

and a method to transformthe unconstrained
params in order to populate the chains() object
with samples:

void
transform_params(const vector<double>& unconstrained_params,
vector<double>& params);

I think at the same time I'll probably change
all the output to column-major (or last-index major
for general arrays). That should make the transfer
to R MUCH easier.

- Bob


Jiqiang Guo

unread,
May 22, 2012, 4:08:32 PM5/22/12
to stan...@googlegroups.com
Yes, indeed.  I do need them to create the chains object. 
--
Jiqiang 
Reply all
Reply to author
Forward
0 new messages