{"id":7585,"library":"pymc-extras","title":"PyMC Extras","description":"PyMC-Extras (version 0.10.0) serves as an experimental extension library for PyMC, providing a sandbox for new probability distributions, advanced model fitting algorithms, and other specialized code not yet integrated into the main PyMC repository. It aims to offer bleeding-edge features to users, with a flexible release cadence tied to the development cycle of its experimental components.","status":"active","version":"0.10.0","language":"en","source_language":"en","source_url":"https://github.com/pymc-devs/pymc-extras","tags":["pymc","bayesian","statistics","probabilistic-programming","distributions","samplers","experimental"],"install":[{"cmd":"pip install pymc-extras","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core probabilistic programming framework; pymc-extras builds upon it.","package":"pymc","optional":false}],"imports":[{"note":"Prefer explicit module imports (e.g., `import pymc_extras.distributions as pmx_dist`) or direct symbol imports for better code readability and avoiding name clashes.","wrong":"from pymc_extras.distributions import *","symbol":"distributions","correct":"from pymc_extras import distributions"},{"note":"Access advanced MCMC samplers and related tools, such as robust HMC algorithms.","symbol":"samplers","correct":"from pymc_extras import samplers"}],"quickstart":{"code":"import pymc as pm\nfrom pymc_extras import distributions as pmx_dist\nimport numpy as np\n\n# Define a custom distribution from pymc-extras, e.g., the LogitNormal\nwith pm.Model() as model:\n    # Example using LogitNormal, suitable for modeling proportions\n    proportion_latent = pm.Normal(\"proportion_latent\", mu=0, sigma=1)\n    proportion = pmx_dist.LogitNormal(\"proportion\", mu=proportion_latent, sigma=1)\n\n    # In a real scenario, you would typically add observed data for inference.\n    # Example: obs = pm.Binomial(\"obs\", n=10, p=proportion, observed=np.array([5, 6, 7]))\n\n    # For this quickstart, we just demonstrate model definition.\n    # trace = pm.sample(draws=1000, tune=1000, chains=2)\n    print(f\"Model created with LogitNormal distribution: {model.named_vars['proportion']}\")","lang":"python","description":"Demonstrates defining a PyMC model using a specialized distribution, `LogitNormal`, from `pymc-extras`. This illustrates how to seamlessly integrate `pymc-extras` components into a standard PyMC workflow, typically followed by sampling if observed data is provided."},"warnings":[{"fix":"Treat `pymc-extras` components as potentially unstable; review release notes for updates and consider migrating critical production code to stable PyMC features where available.","message":"Features in `pymc-extras` are experimental and subject to change or removal without strict adherence to semantic versioning. They may not be stable for production use.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use a recent, stable version of PyMC (`pip install --upgrade pymc`) alongside `pymc-extras`. Check the `pymc-extras` README or documentation for specific PyMC version requirements.","message":"Ensure compatibility with your PyMC installation. `pymc-extras` is generally developed against the latest stable PyMC version, and older PyMC versions might lead to API mismatches or runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly check PyMC release notes and `pymc-extras` updates. If a feature moves to core PyMC, consider updating your code to use the official PyMC implementation for long-term stability and maintenance.","message":"Some features from `pymc-extras` might eventually be integrated into core PyMC. While this offers stability, it means the `pymc-extras` version of a feature might become redundant or deprecated.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install pymc-extras`","cause":"The `pymc-extras` library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'pymc_extras'"},{"fix":"Verify the correct spelling and existence of the distribution in the `pymc-extras` documentation or by inspecting the module contents (e.g., `dir(pmx_dist)` if imported as `pmx_dist`).","cause":"Attempted to access a distribution that does not exist or has a different name within `pymc_extras.distributions`.","error":"AttributeError: module 'pymc_extras.distributions' has no attribute 'MyCustomDistribution'"},{"fix":"Ensure both PyMC and `pymc-extras` are up-to-date (`pip install --upgrade pymc pymc-extras`). Review the documentation for the specific distribution's parameter requirements. If issues persist, consider isolating the problem in a minimal reproducible example.","cause":"Often indicates an incompatibility between `pymc-extras` and the installed PyMC/PyTensor versions, or incorrect usage of a distribution's parameters (e.g., passing `None` where a tensor is expected).","error":"TypeError: unsupported operand type(s) for +: 'TensorVariable' and 'NoneType' (or similar PyTensor/Aesara runtime errors when using custom distributions)"}]}