{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "cfbf2843",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "db882013",
            "cell_type": "markdown",
            "source": "To create a new Gaussian distribution, we would do the following:\n",
            "metadata": {}
        },
        {
            "id": "cd083558",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.stats import rv_continuous\nclass gaussian_gen(rv_continuous):\n    \"Gaussian distribution\"\n    def _pdf(self, x):\n        return np.exp(-x**2 / 2.) / np.sqrt(2.0 * np.pi)\ngaussian = gaussian_gen(name='gaussian')",
            "outputs": []
        },
        {
            "id": "6e1beee4",
            "cell_type": "markdown",
            "source": "``scipy.stats`` distributions are *instances*, so here we subclass\n`rv_continuous` and create an instance. With this, we now have\na fully functional distribution with all relevant methods automagically\ngenerated by the framework.\n\nNote that above we defined a standard normal distribution, with zero mean\nand unit variance. Shifting and scaling of the distribution can be done\nby using ``loc`` and ``scale`` parameters: ``gaussian.pdf(x, loc, scale)``\nessentially computes ``y = (x - loc) / scale`` and\n``gaussian._pdf(y) / scale``.",
            "metadata": {}
        }
    ]
}