Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 593
pavel Avatar asked Dec 07 '25 07:12

pavel


2 Answers

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

like image 181
Bob Carpenter Avatar answered Dec 09 '25 21:12

Bob Carpenter


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'])
like image 43
chmullig Avatar answered Dec 09 '25 19:12

chmullig