Open njtierney opened 5 years ago
So this is operating on a model object rather than on a set of samples? If that's the case, surely we'd be pulling out the number of partially observed nodes from the graph.
jags
= operating on the jags model.stanfit
= the fitted modelwe'd be pulling out the number of partially observed nodes from the graph.
That sounds about right, but I'm not sure how to retrieve the graph structure from the jags/stan models? Maybe I can wrap up this feature and then we can add methods for n_var
for stanfit
and jags
later.
See my recent push to the glance branch. My thinking is that if a node has an value upon compilation then it is likely to be a parameter in the model. For nodes which have size k we can count it as k parameters or as 1 using the unroll_vectors
logical.
This is my current thinking for
n_var
forstanfit
andjags
classes:You can test on:
example_stan_model
andexample_jags_model
- the models for which are given indata-raw
I'm not sure if this is a good idea the way it is currently written...also, the number of variables is kind of a pretty big question! if things are nicely laid out in an
mcmc.list
then it is clear, but things likejags
andstanfit
models are perhaps less clear.What do you think, @samclifford ?