Using Turing as a replacement of Klara

data is that data you have observed. I’m not familiar with your problem so I can’t tell you exactly what it is.

Turing is for much more complex models where you can’t or don’t want to write up the likelihood.

Sorry for getting a bit off-topic, but I was intrigued by your comment. I guess I don’t understand Turing fully. What is an example of a model that can be used by Turing but it’s likelihood can’t be written?

I use “can’t” here to refer to the case where it’s just time intensive to do so. Turing kind of implicitly builds a likelihood function that is quite ugly in its raw form. Models with a lot of hierarchy, many different distribution types, and stochastic control flow would be cases where an analytic or numerical likelihood are very difficult to write down by hand.

1 Like

I don’t believe that such models exist, it is rather a preference that some people have.

I always prefer to code the likelihood directly. Doing so allows me to utilitise standard tools for benchmarking, testing, and optimizing my code. This was the motivation for writing

If you are otherwise comfortable coding log posteriors, you may find it useful.

1 Like

Thanks. I too prefer using explicit likelihoods for the reasons you mentioned, which is why I am already using your excellent DynamicHMC.

I’m still relatively new to probabilistic programming, so wanted to check that I wasn’t missing out on the ability to use a broad class of models by not using Turing.

1 Like

so datais the generated values from the posterior that we have right?

Yes. data is the data you are conditioning on when you calculate the posterior p(parameters | data).

1 Like