Inherit from StanFit in pystan

I’d like to create a new python class that inherits from StanFit. Is there a way to do this with pystan?

I succeeded with the MATLAB interface by directly modifying StanFit.m, but can’t find the corresponding code in pystan.

Thanks,
Neil


Operating System: Mac OS X 10.10.5
Python Version: 3.5.2
Interface Version: 2.17.1.0

PyStan fit-object is found in stan4fitmodel.pyx (Cython class) and model.py shows how it can be initialized.

1 Like

It’s worth mentioning that there is no StanFit per se. Each StanFit is
specialized to a specific Stan model. stanfit4model.pyx is actually a
template, not a proper Cython file.

This is all somewhat confusing. But this mirrors, more or less, how
CmdStan works.

2 Likes

Thank you both. I found what I was looking for and I’ve decided to swerve the idea of inheriting. I’ll define my own class for my particular application.

Cheers