Metadata-Version: 2.1
Name: jupyterstan
Version: 0.1.2
Summary: Magics for defining stan code in notebooks.
Home-page: https://github.com/janfreyberg/jupyterstan
Author: Jan Freyberg
Author-email: jan.freyberg@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: IPython
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: ipython
Requires-Dist: pystan

# jupyterstan

`jupyterstan` is a package to help development of Stan models (using `pystan`)
in jupyter notebooks.

The package is heavily based on Arvinds-ds
[stanmagic](https://github.com/Arvinds-ds/stanmagic) package, but provides an
interface that simply returns a `pystan.Model` object.

In addition, it bundles Arvinds-ds `stan_code_helper` package to improve
syntax highlighting for stan cells.


## Installation

To install the library:

```
pip install jupyterstan
```

## Usage

To use the `magic` in your notebook, you need to lead the extension:

```
%load_ext jupyterstan
```

To define a stan model inside a jupyter notebook, start a cell with the `%%stan`
magic. You can also provide a variable name, which is the variable name that
the `pystan.Model` object will be assigned to. For example:

```
%%stan paris_female_births
data {
    int male;
    int female;
}

parameters {
    real<lower=0, upper=1> p;
}

model {
    female ~ binomial(male + female, p);
}
```

Then, to use your defined model:

```
fit = paris_female_births.sampling(
    data={'male': 251527, 'female': 241945},
    iter=1000,
    chains=4
)
```


