"Wiki" or "Facebook" for Stan models; building the Stan community

foo.stan : model file

foo.data.R : data file as readable by CmdStan
can this be read by PyStan or other interfaces?

foo.init.R : init file in same format

No R necessary. Tet .data.R file name suffix is just to
indicate that the data CmdStan accepts is in the form
of an R dump file.

  • Bob

re: data: I would imagine thereā€™s some user friendly way to edit a
dictionary encoded as JSON (or just upload a JSON-formatted data).

Also, we could check the R and Python programs to verify that they pass
some basic tests. For example, we can check that the Stan programs
contained within compile ā€“ even if we donā€™t allow any sampling or
optimization to be done.

Yes on both counts. We should dust off Mitziā€™s json data dumps; I donā€™t know why it was never exposed.

If we donā€™t have a lot of submissions, then we can fire up some computational time with the local machines we have.

Did a var_context ever get written for JSON? If so,
it should be easy to plumb through.

But then what about the interfaces? Do they use native
package JSON readers and the usual from-memory calls
or do they provide files and use the Stan readers?

  • Bob

Yes, thereā€™s a var_context for json data. Mitzi had written the parser
for it too.

Inside the Stan repo: src/stan/io/json/

Regarding interfaces: theyā€™d need to use the json readers we provide.
Unless we rewrite the json var_context to wrap the other objects.

Iā€™m pretty sure PyStan just uses Python JSON readers and
then calls a Stan function with the memory as an argument
so that itā€™s then read from Pythonā€™s memory, not from JSON.

  • Bob

Yes. Thereā€™s a var_context implementation in PyStan that uses the
in-memory data from Python.

But itā€™s not, because at least now one chain takes 2.5s with 1 core in my old laptop and 25s in Kaggle. So in practice itā€™s only 2 minutes of three year old laptop time. Itā€™s also often pausing for very long times for no reason, and restarting can take minutes. I really canā€™t recommend running Stan or rstanarm in Kaggle kernels.

OK ā€” good to know.

  • Bob

Hi, just to clarify, below is the submission that I created and sent to Daniel and Thel as an example of the sort of thing Iā€™d like to do.
There are a few relevant issues here:

  1. Metadata (title, authors, acknowledgments, references, abstract, file descriptions, story, challenges): That would come in the Arxiv-like submission form
  2. I have 2 Stan programs, not just 1. This is pretty important, actually, as Iā€™d like to be able to submit a mini-project, not just individual Stan programs. Indeed, in many or even most contexts it makes sense to play around and try different models.
  3. Thereā€™s R code. Itā€™s not necessary to me that the R code be able to run.
  4. I have not supplied the Jason file or whatever. I understand from Bob that such a file can be created with one line in R. If so, Iā€™m happy to insert that one line of code inside my R script, save the Jason file, and submit it along with everything else.
    See you
    Andrew