{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "fffdd5a3",
            "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": "ba3fdcb7",
            "cell_type": "markdown",
            "source": "`nrdtrisd` can be used to recover the standard deviation of a normal\ndistribution if we know the CDF value `p` for a given quantile `x` and\nthe mean `mn`. First, we calculate the normal distribution CDF for an\nexemplary parameter set.\n",
            "metadata": {}
        },
        {
            "id": "753744f3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.stats import norm\nmean = 3.\nstd = 2.\nx = 6.\np = norm.cdf(x, loc=mean, scale=std)\np",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.9331927987311419"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "3a67d214",
            "cell_type": "markdown",
            "source": "Verify that `nrdtrisd` returns the original value for `std`.\n",
            "metadata": {}
        },
        {
            "id": "b497fdd7",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.special import nrdtrisd\nnrdtrisd(mean, p, x)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "2.0000000000000004"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}