pavel
pavel

Reputation: 398

Variational inference in PyStan API?

I can't find any mentioning of variational inference in PyStan documentation, even though it has been added in Stan itself. Am I missing something, or is the Python API just not implementing it yet?

Upvotes: 3

Views: 1254

Answers (2)

chmullig
chmullig

Reputation: 13406

Currently (PyStan 2.14), it's available under the StanModel.vb() call.

>>> from pystan import StanModel
>>> m = StanModel(model_code='parameters {real y;} model {y ~ normal(0,1);}')
>>> results = m.vb()
>>> # results saved on disk in format inspired by CSV
>>> print(results['args']['sample_file'])

Upvotes: 1

Bob Carpenter
Bob Carpenter

Reputation: 3753

It is not in PyStan 2.9.0, but we're working on integrating it.

Upvotes: 3

Related Questions