stan-dev / posteriordb

Database with posteriors of interest for Bayesian inference
180 stars 36 forks source link

Framework versions for models #82

Open eerolinna opened 4 years ago

eerolinna commented 4 years ago

From what I understand the stan3 modelling language might not be exactly the same as with current stan. pymc3 and pymc4 also have different modeling languages.

Currently the plan is to have each stan model under models/stan and pymc models under models/pymc. How could we support having models in the posterior database for both stan2 and stan3 or for pymc3 and pymc4?

One approach would be reserve models/stan for stan2 and models/pymc for pymc3 and add models of newer versions under models/stan3 and models/pymc4. This approach doesn't feel satisfactory for me, but at the moment I don't have any better ideas either.

MansMeg commented 4 years ago

I agree with your solution.

eerolinna commented 4 years ago

I had an idea for one approach we can use if we need to include a model under stan namespace that has to use language features of a new version

{
  "name": "some_model",
  "model_implementations": {
    "stan": {
      "model_code": "models/stan/some_model.stan",
      "min_version": 3.1
    }
  },
  "other_stuff": "..."
}

So we specify a minimal version of Stan that is needed to run this model implementation

It might be preferrable to usually use

{
  "name": "some_model",
  "model_implementations": {
    "stan3": {
      "model_code": "models/stan/some_model.stan"
    }
  },
  "other_stuff": "..."
}

but I could see the first approach being an useful option to have in some cases

avehtari commented 4 years ago

I agree that it is useful to have this feature. I just add for clarification, there is not yet stan3 modeling language. stanc3 is just v3 of the compiler, and initially will support stan2 language definition. Stan 2 compiler has some bugs, so that it allows some invalid syntax, but stanc3 implements the language definition better. Currently there haven't been immediate plans for breaking backward compatibility. stanc3 will eventually allow easier addition of new features to the language, which will then eventually break the forward compatibility. I hope we can have just one set of Stan models.

eerolinna commented 4 years ago

Good clarification. Having one set of Stan models feels feasable to me.