# 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": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Matthew Mould",
"author_email": "mattdmould@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ab/8f/a41dc78002a69d82f741d6c6ba13c4ac11c939b96e70a52fe4703f63b1e0/popodds-0.7.0.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.0",
"project_urls": {
"Homepage": "https://github.com/mdmould/popodds"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ef7b9937778ef284187d14c27ae4eb5ad1d01495001c45fd341b49540e6352af",
"md5": "81e93411859c54bca0b0afad3b82d15e",
"sha256": "060caacd1a44895b1ce1e507e4fac0afebd390a1c11b78fe6e7b3c2087e09cde"
},
"downloads": -1,
"filename": "popodds-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "81e93411859c54bca0b0afad3b82d15e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6816,
"upload_time": "2023-05-19T23:00:43",
"upload_time_iso_8601": "2023-05-19T23:00:43.775109Z",
"url": "https://files.pythonhosted.org/packages/ef/7b/9937778ef284187d14c27ae4eb5ad1d01495001c45fd341b49540e6352af/popodds-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ab8fa41dc78002a69d82f741d6c6ba13c4ac11c939b96e70a52fe4703f63b1e0",
"md5": "daec16b0c7326b5935299c93f4875ed0",
"sha256": "1a8d6c7745b422e31439fa24e3803c2f69c0072c0f88f36543522cc8c7f2a282"
},
"downloads": -1,
"filename": "popodds-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "daec16b0c7326b5935299c93f4875ed0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6274,
"upload_time": "2023-05-19T23:00:45",
"upload_time_iso_8601": "2023-05-19T23:00:45.352451Z",
"url": "https://files.pythonhosted.org/packages/ab/8f/a41dc78002a69d82f741d6c6ba13c4ac11c939b96e70a52fe4703f63b1e0/popodds-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-19 23:00:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mdmould",
"github_project": "popodds",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "kaydee",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "astropy",
"specs": []
}
],
"lcname": "popodds"
}