{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Uncertainty assessment\n", "\n", "The IPCC guidelines provide information on taking into account uncertainty.\n", "The `bonsai_ipcc` package implements those by allowing the user to do analytical error propagation and Monte Carlo simualtion when running a tier sequence. \n", "\n", "To use one of the approaches, each parameter involved in a sequence requires information about its uncertainty. This information is specifeid by the properties \"def\" , \"min\", \"max\", \"abs_min\" and \"abs_max\" (mean, 2.5 percentile, 97.5 percentile, absolute minimum, absolute maximum) in the parameter table.\n", "\n", "Let´s use have a look into the waste incineration example." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Add data with uncertainty\n", "As already done in the previous tutorial for running a sequence, we need to add the data which is not provided by the package. So let´s do this again." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import bonsai_ipcc\n", "import pandas as pd\n", "import numpy as np\n", "\n", "my_ipcc = bonsai_ipcc.IPCC()\n", "\n", "# urban population\n", "d = {\n", " \"year\": [2010,2010,2010,2010,2010],\n", " \"region\": [\"DE\",\"DE\",\"DE\",\"DE\",\"DE\"],\n", " \"property\": [\n", " \"def\",\"min\",\"max\",\"abs_min\",\"abs_max\"\n", " ],\n", " \"value\": [\n", " 62940432.0,61996325.52,63884538.48,0.0,np.inf,\n", " ],\n", " \"unit\": [\n", " \"cap/yr\",\"cap/yr\",\"cap/yr\",\"cap/yr\",\"cap/yr\",\n", " ],\n", "}\n", "urb_pop = pd.DataFrame(d).set_index([\"year\", \"region\", \"property\"])\n", "\n", "my_ipcc.waste.incineration.parameter.urb_population=urb_pop" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To take the uncertainty into account, we need to add the values for `def`, `min`, `max`, `abs_min`, and `abs_max`. A description of the `property` dimension can be found here:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | description | \n", "remarks | \n", "
---|---|---|
code | \n", "\n", " | \n", " |
def | \n", "default | \n", "mean | \n", "
min | \n", "minimum | \n", "2.5th percentile | \n", "
max | \n", "maximum | \n", "97.5th percentile | \n", "
abs_max | \n", "absolute maximun | \n", "theoretical upper bound | \n", "
abs_min | \n", "absolute minimum | \n", "theoretical lower bound | \n", "
dummy | \n", "place holder for emtpy tables | \n", "NaN | \n", "