Guidelines for rstan-based packages

Oops yeah meant to point to this particular issue

Also what kind of survival models are you working on? Weā€™ve been wanting to
get survival models (essentially a stan_survreg function similar
to Rā€™s survreg) into rstanarm for a while but havenā€™t had the time.

Jonah

So far I have multi-level weibull and weibull-uniform mixture models. Itā€™s a setting where a whole range of quantiles needs to be accurately represented by the model and you need to avoid noisy estimates for small units without much data so multi-level models are really a good match. The multi-level part works well but I need something more flexible than the Weibull-uniform mixture for dealing with the tail.

Writing or generating all-doubles wrappers makes the most sense if Iā€™m going to avoid expose_stan_functions. I did look at the code generator and the changes needed in the code are pretty minimal but I havenā€™t looked at how a flag for all-doubles would need to be plumbed through the code generator.

You shouldnā€™t have to use expose_stan_functions. Just write your C++ functions in the src/ directory, export them to R in the NAMESPACE, and then in the Stan programs declare those functions in the functions block without defining them. It works now if you install a StanHeaders that is based on the develop versions of math and stan.

Let me know if you need help. It needs to drop the
tempate type declarations and replace all their uses
with ā€œdoubleā€. Itā€™ll leave residual constant reference
arguments, but that shouldnā€™t be a problem in this context.

  • Bob

Iā€™ll start a separate thread about this, if you donā€™t like what I propose there it would be good to do a call/skype to resolve it.

Quick question: there arenā€™t any tests currently for the generate_function* functions so I have no examples to go on. My first thought about how to create tests for the generate_doubles_function tests is to write the out stream to a stringstream and count matches to expected substrings. Is that what you would do?

Ok Iā€™m going to post these guidelines on stan-users soon. Should I put them elsewhere as well? On mc-stan.org somewhere maybe?

A wiki? I feel like the github.com/stan-dev/stan wiki is way out of control and I wish there was a separate wiki.

If we actually wanted to solve these problems, we could do one of a number of things:

  • just keep on with how weā€™re managing it
  • create a new repo (cause there are no organization level wikis) that holds a wiki
  • create a new github.io repo that we point wiki.mc-stan.org to. Itā€™ll be .md files for editing and it wonā€™t be just a normal wiki. Itā€™ll be a website.

Thoughts?

I agree that the stan-dev/stan wiki is wrong for something thatā€™s basically targeting technical users. I like the github.io option, but thatā€™s mostly because I find the github wikis hard to navigate.

I donā€™t think the wiki is necessarily the wrong place. I just think we need to organize a little better. Bobā€™s already taken a first pass. We need to take subsequent passes to get it in shape.

@jonah, Iā€™d suggest doing whatever is easy to implement.

Iā€™m also planning on putting the guidelines in a CRAN vignette so another
option is to post on stan-users for now and then when the vignette is up on
CRAN we could just put a link to the CRAN vignette somewhere instead of
hosting our own version. That way all changes would also only need to be
made in one place.