# popodds
Simple package for Bayesian model comparison.
Given samples from a posterior distribution inferred under some default prior, compute the Bayes factor or odds in favour of a new prior model.
## Installation
`pip install popodds`
## Usage
The package consists of the `ModelComparison` class to compute Bayes factors, and a wrapper function `log_odds` for simplicity.
The computation only requires a few ingredients:
- `model` a new prior model or samples from it,
- `prior` the original parameter estimation prior or samples from it
- `samples` samples from a parameter estimation run.
Optional:
- `model_bounds` parameter bounds for the new prior model,
- `prior_bounds` parameter bounds for the original prior model,
- `log` compute probability densities in log space,
- `prior_odds` odds between the prior models, which defaults to unity,
- `second_model` model to compute odds against instead of prior,
- `second_bounds` parameter bounds for the second model,
- `detectable` compare between detectable rather than intrinsic populations.
Raw data
{
"_id": null,
"home_page": "https://github.com/mdmould/popodds",
"name": "popodds",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Matthew Mould",
"author_email": "mattdmould@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a8/00/1d758e7c27a8d72377cb3076f232777247d0a504ce4fb13ef398929c07e9/popodds-0.7.1.tar.gz",
"platform": null,
"description": "# popodds\nSimple package for Bayesian model comparison.\n\nGiven samples from a posterior distribution inferred under some default prior, compute the Bayes factor or odds in favour of a new prior model.\n\n## Installation\n\n`pip install popodds`\n\n## Usage\n\nThe package consists of the `ModelComparison` class to compute Bayes factors, and a wrapper function `log_odds` for simplicity.\n\nThe computation only requires a few ingredients:\n- `model` a new prior model or samples from it,\n- `prior` the original parameter estimation prior or samples from it\n- `samples` samples from a parameter estimation run.\n\nOptional:\n- `model_bounds` parameter bounds for the new prior model,\n- `prior_bounds` parameter bounds for the original prior model,\n- `log` compute probability densities in log space,\n- `prior_odds` odds between the prior models, which defaults to unity,\n- `second_model` model to compute odds against instead of prior,\n- `second_bounds` parameter bounds for the second model,\n- `detectable` compare between detectable rather than intrinsic populations.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple package for Bayesian model comparison.",
"version": "0.7.1",
"project_urls": {
"Homepage": "https://github.com/mdmould/popodds"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "52c8b916262fa4710651d976b4d5835232c6a7be46c79337a8ca8b70802283ec",
"md5": "7c37f837c93d101cf36aef159a8d919f",
"sha256": "f2067e249461f21e72a12397540bcc3cfbeefdd126d0847b1b2ee96a01dd7571"
},
"downloads": -1,
"filename": "popodds-0.7.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7c37f837c93d101cf36aef159a8d919f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6802,
"upload_time": "2024-07-11T03:10:39",
"upload_time_iso_8601": "2024-07-11T03:10:39.366636Z",
"url": "https://files.pythonhosted.org/packages/52/c8/b916262fa4710651d976b4d5835232c6a7be46c79337a8ca8b70802283ec/popodds-0.7.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a8001d758e7c27a8d72377cb3076f232777247d0a504ce4fb13ef398929c07e9",
"md5": "47fbd7d9d6b90ba7730672e709dce913",
"sha256": "4f1b80f548ef2d30950da3f1046899c45962c720bf5e6498e06fea6f5cc3ad71"
},
"downloads": -1,
"filename": "popodds-0.7.1.tar.gz",
"has_sig": false,
"md5_digest": "47fbd7d9d6b90ba7730672e709dce913",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6297,
"upload_time": "2024-07-11T03:10:40",
"upload_time_iso_8601": "2024-07-11T03:10:40.957555Z",
"url": "https://files.pythonhosted.org/packages/a8/00/1d758e7c27a8d72377cb3076f232777247d0a504ce4fb13ef398929c07e9/popodds-0.7.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-11 03:10:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mdmould",
"github_project": "popodds",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "popodds"
}