{"id":10061,"library":"preliz","title":"Preliz Library","description":"Preliz is a Python library for exploring and eliciting probability distributions. It provides a flexible and object-oriented framework for defining, manipulating, and visualizing various distributions, commonly used for setting priors in Bayesian inference workflows. The current version is 0.24.0, and it maintains an active development and release cadence.","status":"active","version":"0.24.0","language":"python","source_language":"en","source_url":"https://github.com/eliciting-distributions/preliz","tags":["statistics","probability","distributions","bayesian-inference","prior-elicitation"],"install":[{"cmd":"pip install preliz","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"As of v0.20.0, distributions are directly available from the top-level 'preliz' module. The old path was deprecated.","wrong":"from preliz.distributions import Normal","symbol":"Normal","correct":"from preliz import Normal"},{"note":"General import for accessing the library's features.","symbol":"preliz","correct":"import preliz"}],"quickstart":{"code":"import preliz\nimport numpy as np\n\n# Define a Normal distribution\nnorm_dist = preliz.Normal(mu=0, sigma=1)\n\n# Get PDF at a specific point\nprint(f\"PDF at x=0: {norm_dist.pdf(0):.3f}\")\n\n# Sample from the distribution\nsamples = norm_dist.rvs(size=100)\nprint(f\"Mean of 100 samples: {np.mean(samples):.2f}\")\nprint(f\"Std dev of 100 samples: {np.std(samples):.2f}\")\n\n# Access a scipy.stats compatible object (if needed)\nscipy_norm = norm_dist.to_scipy()\nprint(f\"Scipy PDF at x=0: {scipy_norm.pdf(0):.3f}\")","lang":"python","description":"Demonstrates how to define a distribution, calculate its PDF, sample from it, and convert it to a scipy.stats compatible object."},"warnings":[{"fix":"Update your import statements. For example, change `from preliz.distributions import Normal` to `from preliz import Normal`. A backward-compatible `from preliz import distributions` was added in `0.22.0`, but direct import is preferred.","message":"Direct import paths for individual distributions changed in `0.20.0`. Previously, distributions like `Normal` were imported from `preliz.distributions`. Now, they are directly available from the top-level `preliz` module.","severity":"breaking","affected_versions":">=0.20.0"},{"fix":"Use the `to_scipy()` method available on `preliz` distribution objects to obtain a `scipy.stats` compatible distribution, or directly use the `preliz` object's native methods for calculations and sampling.","message":"Preliz distribution objects are not direct subclasses of `scipy.stats` distributions and cannot be used interchangeably with `scipy.stats` functions without explicit conversion. They offer their own `pdf()`, `cdf()`, `rvs()` methods.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Replace calls to `dist.plot_pdf()` or `dist.plot_cdf()` with `dist.plot()`. You can specify the desired plot type using the `plot_type` argument, e.g., `dist.plot(plot_type='pdf')`.","message":"The plotting methods `plot_pdf()` and `plot_cdf()` on distribution objects have been deprecated in favor of a more unified `plot()` method.","severity":"deprecated","affected_versions":"Likely >=0.22.0 (check specific changelog)"}],"env_vars":null,"search_vec":"'0.24.0':43 'activ':48 'bayesian':36,57 'bayesian-infer':56 'cadenc':52 'common':30 'current':40 'defin':24 'develop':49 'distribut':13,29,55 'elicit':11,61 'explor':9 'flexibl':17 'framework':22 'infer':37,58 'librari':2,7 'maintain':46 'manipul':25 'object':20 'object-ori':19 'orient':21 'preliz':1,3 'prior':34,60 'prior-elicit':59 'probabl':12,54 'provid':15 'python':6 'releas':51 'set':33 'statist':53 'use':31 'various':28 'version':41 'visual':27 'workflow':38","created_at":"2026-04-17T01:22:10.457201+00:00","updated_at":"2026-04-17T01:22:10.457201+00:00","problems":{"verify_error":"/tmp/tmpltnmps8m/venv/lib/python3.12/site-packages/preliz/ppls/pymc_io.py:16: UserWarning: PyMC not installed. PyMC related functions will not work.\n  warnings.warn(\"PyMC not installed. PyMC related functions will not work.\")\nTraceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.26.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/arviz-devs/preliz","docs":"https://preliz.readthedocs.io","changelog":null,"pypi":"https://pypi.org/project/preliz/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-09","install_tag":null}}