{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "d345ce36",
            "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": "ccf5f87d",
            "cell_type": "markdown",
            "source": "Instantiate a distribution with the desired parameters:\n",
            "metadata": {}
        },
        {
            "id": "f6daf92b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy import stats\nX = stats.Normal(mu=1., sigma=2.)",
            "outputs": []
        },
        {
            "id": "03e4d3cf",
            "cell_type": "markdown",
            "source": "Evaluate the first raw moment:\n",
            "metadata": {}
        },
        {
            "id": "c640abcf",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=1, kind='raw')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "0b5dfce9",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=1, kind='raw') == X.mean() == X.mu",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8b9c5615",
            "cell_type": "markdown",
            "source": "Evaluate the second central moment:\n",
            "metadata": {}
        },
        {
            "id": "086ba6b1",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=2, kind='central')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "4.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "df59f7fc",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=2, kind='central') == X.variance() == X.sigma**2",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "020067d1",
            "cell_type": "markdown",
            "source": "Evaluate the fourth standardized moment:\n",
            "metadata": {}
        },
        {
            "id": "d5e5c63b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=4, kind='standardized')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "3.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "a3e41fbd",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.moment(order=4, kind='standardized') == X.kurtosis(convention='non-excess')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}