Skip to main content

🌀 stanhf

Convert a histfactory model into a Stan model.

Convert a histfactory declarative specification of a model in json into a Stan model. Stan is a probabilistic programming language and a set of algorithms with automatic differentiation.

We follow the histfactory specification as closely as possible and the target function (log-likelihood) should match that from pyhf up to a constant term to within a negligible numerical difference.

Install

pip install stanhf

At runtime, the first time you use stanhf it could install cmdstan if it isn't found. This is required to lint, validate and compile any Stan models, though stanhf can be used as a conversion tool without it.

Run

Stanhf consists of one CLI. See

stanhf --help

for details. Try e.g.,

stanhf ./examples/model.json

This converts, compiles and validates the example model. The compiled model is a cmdstan executable. You can run the usual Stan algorithms (HMC, optimization etc) through this executable.

Workflows

See EXAMPLE.md for a walkthrough of how to run and analyse outpus from a compiled Stan model.

Metadata

Release files for stanhf 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stanhf 1.1.0
File Size Uploaded
stanhf-1.1.0.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stanhf 1.1.0
File Interpreter ABI Platform
stanhf-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.8 kB

Release files / stanhf-1.1.0.tar.gz

Download URL stanhf-1.1.0.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1158976afdea6dbb25ff441d0ed8531fa29b8e1dda8d29f507f7fbdc9768771d
BLAKE2b-256 checksum
How to use checksums
51dad6c66683cec00959dfaec7b2f7c2cfe7323ad789a07d36e3ab010e537cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / stanhf-1.1.0-py3-none-any.whl

Download URL stanhf-1.1.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf411aa81a52df74e13d34657b738252cd66cff001f887774a856b847d38e8de
BLAKE2b-256 checksum
How to use checksums
77f74105230f77aab9dc9001965df8abb01ab338583c9ca11cf3a1f5ae44f222
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page