{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "# Higher order sensitivity indices for interaction models\n", "\n", " \n", "**Vinzenz Gregor Eck**, Expert Analytics \n", "\n", " **Jacob Sturdy**, Department of Structural Engineering, NTNU \n", "\n", " **Leif Rune Hellevik**, Department of Structural Engineering, NTNU\n", "\n", "\n", "Date: **Jul 13, 2018**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# ipython magic\n", "%matplotlib notebook\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# plot configuration\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", "plt.style.use(\"ggplot\")\n", "# import seaborn as sns # sets another style\n", "matplotlib.rcParams['lines.linewidth'] = 3\n", "fig_width, fig_height = (7.0,5.0)\n", "matplotlib.rcParams['figure.figsize'] = (fig_width, fig_height)\n", "\n", "# font = {'family' : 'sans-serif',\n", "# 'weight' : 'normal',\n", "# 'size' : 18.0}\n", "# matplotlib.rc('font', **font) # pass in the font dict as kwar" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# import modules\n", "import numpy as np\n", "import chaospy as cp\n", "from monte_carlo import generate_sample_matrices_mc\n", "from monte_carlo import calculate_sensitivity_indices_mc\n", "from xlwt.Utils import col_by_name" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# A model with interaction\n", "
\n", "\n", "For convenience and simplicity, we consider the same model as before:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "$$\n", "\\begin{equation}\n", "Y = \\sum_{i=1}^{r} \\Omega_i \\, Z_i\n", "\\label{eq:non_add_model} \\tag{1}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The only difference is that we render ([1](#eq:non_add_model))\n", "non-additive by letting both $\\Omega_i$ and $Z_i$ be random\n", "variables. By doing so our model will have products of two distinct\n", "random variables, and consequently it will be a non-additive model, as it no longer fulfills the criterion:\n", "\n", "\n", "\n", "