Skip to main content

No project description provided

Project description

🌀 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stanhf-1.1.0.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stanhf-1.1.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file stanhf-1.1.0.tar.gz.

File metadata

  • Download URL: stanhf-1.1.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for stanhf-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1158976afdea6dbb25ff441d0ed8531fa29b8e1dda8d29f507f7fbdc9768771d
MD5 25f52cfa4e7be366ea938edecf0db4c1
BLAKE2b-256 51dad6c66683cec00959dfaec7b2f7c2cfe7323ad789a07d36e3ab010e537cac

See more details on using hashes here.

File details

Details for the file stanhf-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: stanhf-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for stanhf-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf411aa81a52df74e13d34657b738252cd66cff001f887774a856b847d38e8de
MD5 c1f49924793e5dad587e3b067e3dc838
BLAKE2b-256 77f74105230f77aab9dc9001965df8abb01ab338583c9ca11cf3a1f5ae44f222

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page