{
 "metadata": {
  "name": "example1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import os\n",
      "\n",
      "from pandas import Series, DataFrame\n",
      "import pandas as pd\n",
      "\n",
      "import example1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "data = example1.read_data()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "data['fruit_per_tree']"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>farm</th>\n",
        "      <th>fruit</th>\n",
        "      <th>variety</th>\n",
        "      <th>year</th>\n",
        "      <th>mean</th>\n",
        "      <th>sd</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2014</td>\n",
        "      <td> 200</td>\n",
        "      <td> 30.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2014</td>\n",
        "      <td> 150</td>\n",
        "      <td> 22.50</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td>  pear</td>\n",
        "      <td>        Nashi</td>\n",
        "      <td> 2014</td>\n",
        "      <td>  50</td>\n",
        "      <td>  7.50</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3 </th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2014</td>\n",
        "      <td> 160</td>\n",
        "      <td> 24.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4 </th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2014</td>\n",
        "      <td> 120</td>\n",
        "      <td> 18.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2015</td>\n",
        "      <td> 220</td>\n",
        "      <td> 33.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2015</td>\n",
        "      <td> 175</td>\n",
        "      <td> 26.25</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7 </th>\n",
        "      <td> Farm A</td>\n",
        "      <td>  pear</td>\n",
        "      <td>        Nashi</td>\n",
        "      <td> 2015</td>\n",
        "      <td>  55</td>\n",
        "      <td>  8.25</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8 </th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2015</td>\n",
        "      <td> 180</td>\n",
        "      <td> 27.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9 </th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2015</td>\n",
        "      <td> 150</td>\n",
        "      <td> 22.50</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10</th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2016</td>\n",
        "      <td> 240</td>\n",
        "      <td> 36.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11</th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2016</td>\n",
        "      <td> 200</td>\n",
        "      <td> 30.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12</th>\n",
        "      <td> Farm A</td>\n",
        "      <td>  pear</td>\n",
        "      <td>        Nashi</td>\n",
        "      <td> 2016</td>\n",
        "      <td>  60</td>\n",
        "      <td>  9.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13</th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2016</td>\n",
        "      <td> 200</td>\n",
        "      <td> 30.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14</th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2016</td>\n",
        "      <td> 180</td>\n",
        "      <td> 27.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15</th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2017</td>\n",
        "      <td> 250</td>\n",
        "      <td> 37.50</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16</th>\n",
        "      <td> Farm A</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2017</td>\n",
        "      <td> 225</td>\n",
        "      <td> 33.75</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17</th>\n",
        "      <td> Farm A</td>\n",
        "      <td>  pear</td>\n",
        "      <td>        Nashi</td>\n",
        "      <td> 2017</td>\n",
        "      <td>  60</td>\n",
        "      <td>  9.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18</th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td> Granny Smith</td>\n",
        "      <td> 2017</td>\n",
        "      <td> 220</td>\n",
        "      <td> 33.00</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19</th>\n",
        "      <td> Farm B</td>\n",
        "      <td> apple</td>\n",
        "      <td>     Jonathon</td>\n",
        "      <td> 2017</td>\n",
        "      <td> 200</td>\n",
        "      <td> 30.00</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>20 rows \u00d7 6 columns</p>\n",
        "</div>"
       ],
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "      farm  fruit       variety  year  mean     sd\n",
        "0   Farm A  apple  Granny Smith  2014   200  30.00\n",
        "1   Farm A  apple      Jonathon  2014   150  22.50\n",
        "2   Farm A   pear         Nashi  2014    50   7.50\n",
        "3   Farm B  apple  Granny Smith  2014   160  24.00\n",
        "4   Farm B  apple      Jonathon  2014   120  18.00\n",
        "5   Farm A  apple  Granny Smith  2015   220  33.00\n",
        "6   Farm A  apple      Jonathon  2015   175  26.25\n",
        "7   Farm A   pear         Nashi  2015    55   8.25\n",
        "8   Farm B  apple  Granny Smith  2015   180  27.00\n",
        "9   Farm B  apple      Jonathon  2015   150  22.50\n",
        "10  Farm A  apple  Granny Smith  2016   240  36.00\n",
        "11  Farm A  apple      Jonathon  2016   200  30.00\n",
        "12  Farm A   pear         Nashi  2016    60   9.00\n",
        "13  Farm B  apple  Granny Smith  2016   200  30.00\n",
        "14  Farm B  apple      Jonathon  2016   180  27.00\n",
        "15  Farm A  apple  Granny Smith  2017   250  37.50\n",
        "16  Farm A  apple      Jonathon  2017   225  33.75\n",
        "17  Farm A   pear         Nashi  2017    60   9.00\n",
        "18  Farm B  apple  Granny Smith  2017   220  33.00\n",
        "19  Farm B  apple      Jonathon  2017   200  30.00\n",
        "\n",
        "[20 rows x 6 columns]"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# the base case (no simulation)\n",
      "example1.simulate(data, N=0)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th>num trees</th>\n",
        "      <th>fruit per tree</th>\n",
        "      <th>volume</th>\n",
        "      <th>cost per fruit</th>\n",
        "      <th>var cost</th>\n",
        "      <th>revenue per fruit</th>\n",
        "      <th>revenue</th>\n",
        "      <th>fixed cost</th>\n",
        "      <th>profit</th>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>iteration</th>\n",
        "      <th>year</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">base case</th>\n",
        "      <th>2014</th>\n",
        "      <td> 950</td>\n",
        "      <td> 680</td>\n",
        "      <td> 132500</td>\n",
        "      <td> 0.86</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 4.70</td>\n",
        "      <td> 123400</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 11000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 950</td>\n",
        "      <td> 780</td>\n",
        "      <td> 155750</td>\n",
        "      <td> 0.86</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 4.90</td>\n",
        "      <td> 151430</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 35050</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 950</td>\n",
        "      <td> 880</td>\n",
        "      <td> 179000</td>\n",
        "      <td> 0.86</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 5.08</td>\n",
        "      <td> 180680</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 60320</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 950</td>\n",
        "      <td> 955</td>\n",
        "      <td> 197000</td>\n",
        "      <td> 0.86</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 5.28</td>\n",
        "      <td> 206800</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 83380</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>4 rows \u00d7 9 columns</p>\n",
        "</div>"
       ],
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "                num trees  fruit per tree  volume  cost per fruit  var cost  \\\n",
        "iteration year                                                                \n",
        "base case 2014        950             680  132500            0.86     22400   \n",
        "          2015        950             780  155750            0.86     26380   \n",
        "          2016        950             880  179000            0.86     30360   \n",
        "          2017        950             955  197000            0.86     33420   \n",
        "\n",
        "                revenue per fruit  revenue  fixed cost  profit  \n",
        "iteration year                                                  \n",
        "base case 2014               4.70   123400       90000   11000  \n",
        "          2015               4.90   151430       90000   35050  \n",
        "          2016               5.08   180680       90000   60320  \n",
        "          2017               5.28   206800       90000   83380  \n",
        "\n",
        "[4 rows x 9 columns]"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# one-factor sensitivities\n",
      "sensitivities = example1.simulate(data, N=-1)\n",
      "sensitivities"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th>cost per fruit</th>\n",
        "      <th>fixed cost</th>\n",
        "      <th>fruit per tree</th>\n",
        "      <th>num trees</th>\n",
        "      <th>revenue</th>\n",
        "      <th>revenue per fruit</th>\n",
        "      <th>var cost</th>\n",
        "      <th>volume</th>\n",
        "      <th>profit</th>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>iteration</th>\n",
        "      <th>year</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">base case</th>\n",
        "      <th>2014</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 680</td>\n",
        "      <td> 950</td>\n",
        "      <td> 123400</td>\n",
        "      <td> 4.700</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 132500</td>\n",
        "      <td>  11000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 780</td>\n",
        "      <td> 950</td>\n",
        "      <td> 151430</td>\n",
        "      <td> 4.900</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 155750</td>\n",
        "      <td>  35050</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 880</td>\n",
        "      <td> 950</td>\n",
        "      <td> 180680</td>\n",
        "      <td> 5.080</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 179000</td>\n",
        "      <td>  60320</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 955</td>\n",
        "      <td> 950</td>\n",
        "      <td> 206800</td>\n",
        "      <td> 5.280</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 197000</td>\n",
        "      <td>  83380</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">high fixed cost</th>\n",
        "      <th>2014</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 680</td>\n",
        "      <td> 950</td>\n",
        "      <td> 123400</td>\n",
        "      <td> 4.700</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 132500</td>\n",
        "      <td>  11000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 780</td>\n",
        "      <td> 950</td>\n",
        "      <td> 151430</td>\n",
        "      <td> 4.900</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 155750</td>\n",
        "      <td>  35050</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 880</td>\n",
        "      <td> 950</td>\n",
        "      <td> 180680</td>\n",
        "      <td> 5.080</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 179000</td>\n",
        "      <td>  60320</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 955</td>\n",
        "      <td> 950</td>\n",
        "      <td> 206800</td>\n",
        "      <td> 5.280</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 197000</td>\n",
        "      <td>  83380</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">high revenue per fruit</th>\n",
        "      <th>2014</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 680</td>\n",
        "      <td> 950</td>\n",
        "      <td> 148080</td>\n",
        "      <td> 5.640</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 132500</td>\n",
        "      <td>  35680</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 780</td>\n",
        "      <td> 950</td>\n",
        "      <td> 181716</td>\n",
        "      <td> 5.880</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 155750</td>\n",
        "      <td>  65336</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 880</td>\n",
        "      <td> 950</td>\n",
        "      <td> 216816</td>\n",
        "      <td> 6.096</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 179000</td>\n",
        "      <td>  96456</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 955</td>\n",
        "      <td> 950</td>\n",
        "      <td> 248160</td>\n",
        "      <td> 6.336</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 197000</td>\n",
        "      <td> 124740</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">low fixed cost</th>\n",
        "      <th>2014</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 680</td>\n",
        "      <td> 950</td>\n",
        "      <td> 123400</td>\n",
        "      <td> 4.700</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 132500</td>\n",
        "      <td>  11000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 780</td>\n",
        "      <td> 950</td>\n",
        "      <td> 151430</td>\n",
        "      <td> 4.900</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 155750</td>\n",
        "      <td>  35050</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 880</td>\n",
        "      <td> 950</td>\n",
        "      <td> 180680</td>\n",
        "      <td> 5.080</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 179000</td>\n",
        "      <td>  60320</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 955</td>\n",
        "      <td> 950</td>\n",
        "      <td> 206800</td>\n",
        "      <td> 5.280</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 197000</td>\n",
        "      <td>  83380</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th rowspan=\"4\" valign=\"top\">low revenue per fruit</th>\n",
        "      <th>2014</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 680</td>\n",
        "      <td> 950</td>\n",
        "      <td>  98720</td>\n",
        "      <td> 3.760</td>\n",
        "      <td> 22400</td>\n",
        "      <td> 132500</td>\n",
        "      <td> -13680</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2015</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 780</td>\n",
        "      <td> 950</td>\n",
        "      <td> 121144</td>\n",
        "      <td> 3.920</td>\n",
        "      <td> 26380</td>\n",
        "      <td> 155750</td>\n",
        "      <td>   4764</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2016</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 880</td>\n",
        "      <td> 950</td>\n",
        "      <td> 144544</td>\n",
        "      <td> 4.064</td>\n",
        "      <td> 30360</td>\n",
        "      <td> 179000</td>\n",
        "      <td>  24184</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2017</th>\n",
        "      <td> 0.86</td>\n",
        "      <td> 90000</td>\n",
        "      <td> 955</td>\n",
        "      <td> 950</td>\n",
        "      <td> 165440</td>\n",
        "      <td> 4.224</td>\n",
        "      <td> 33420</td>\n",
        "      <td> 197000</td>\n",
        "      <td>  42020</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>20 rows \u00d7 9 columns</p>\n",
        "</div>"
       ],
       "output_type": "pyout",
       "prompt_number": 9,
       "text": [
        "                             cost per fruit  fixed cost  fruit per tree  \\\n",
        "iteration              year                                               \n",
        "base case              2014            0.86       90000             680   \n",
        "                       2015            0.86       90000             780   \n",
        "                       2016            0.86       90000             880   \n",
        "                       2017            0.86       90000             955   \n",
        "high fixed cost        2014            0.86       90000             680   \n",
        "                       2015            0.86       90000             780   \n",
        "                       2016            0.86       90000             880   \n",
        "                       2017            0.86       90000             955   \n",
        "high revenue per fruit 2014            0.86       90000             680   \n",
        "                       2015            0.86       90000             780   \n",
        "                       2016            0.86       90000             880   \n",
        "                       2017            0.86       90000             955   \n",
        "low fixed cost         2014            0.86       90000             680   \n",
        "                       2015            0.86       90000             780   \n",
        "                       2016            0.86       90000             880   \n",
        "                       2017            0.86       90000             955   \n",
        "low revenue per fruit  2014            0.86       90000             680   \n",
        "                       2015            0.86       90000             780   \n",
        "                       2016            0.86       90000             880   \n",
        "                       2017            0.86       90000             955   \n",
        "\n",
        "                             num trees  revenue  revenue per fruit  var cost  \\\n",
        "iteration              year                                                    \n",
        "base case              2014        950   123400              4.700     22400   \n",
        "                       2015        950   151430              4.900     26380   \n",
        "                       2016        950   180680              5.080     30360   \n",
        "                       2017        950   206800              5.280     33420   \n",
        "high fixed cost        2014        950   123400              4.700     22400   \n",
        "                       2015        950   151430              4.900     26380   \n",
        "                       2016        950   180680              5.080     30360   \n",
        "                       2017        950   206800              5.280     33420   \n",
        "high revenue per fruit 2014        950   148080              5.640     22400   \n",
        "                       2015        950   181716              5.880     26380   \n",
        "                       2016        950   216816              6.096     30360   \n",
        "                       2017        950   248160              6.336     33420   \n",
        "low fixed cost         2014        950   123400              4.700     22400   \n",
        "                       2015        950   151430              4.900     26380   \n",
        "                       2016        950   180680              5.080     30360   \n",
        "                       2017        950   206800              5.280     33420   \n",
        "low revenue per fruit  2014        950    98720              3.760     22400   \n",
        "                       2015        950   121144              3.920     26380   \n",
        "                       2016        950   144544              4.064     30360   \n",
        "                       2017        950   165440              4.224     33420   \n",
        "\n",
        "                             volume  profit  \n",
        "iteration              year                  \n",
        "base case              2014  132500   11000  \n",
        "                       2015  155750   35050  \n",
        "                       2016  179000   60320  \n",
        "                       2017  197000   83380  \n",
        "high fixed cost        2014  132500   11000  \n",
        "                       2015  155750   35050  \n",
        "                       2016  179000   60320  \n",
        "                       2017  197000   83380  \n",
        "high revenue per fruit 2014  132500   35680  \n",
        "                       2015  155750   65336  \n",
        "                       2016  179000   96456  \n",
        "                       2017  197000  124740  \n",
        "low fixed cost         2014  132500   11000  \n",
        "                       2015  155750   35050  \n",
        "                       2016  179000   60320  \n",
        "                       2017  197000   83380  \n",
        "low revenue per fruit  2014  132500  -13680  \n",
        "                       2015  155750    4764  \n",
        "                       2016  179000   24184  \n",
        "                       2017  197000   42020  \n",
        "\n",
        "[20 rows x 9 columns]"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# full simulation with NPV calculation\n",
      "N = 1000\n",
      "total_per_iteration = example1.simulate(data, N, discount_rate=1.09, base_year=2014)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# example1.sim_output(total_per_iteration, N=1000)\n",
      "# the example output is:\n",
      "total_per_iteration.xs('2017', level='year').describe(percentile_width=80).T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>count</th>\n",
        "      <th>mean</th>\n",
        "      <th>std</th>\n",
        "      <th>min</th>\n",
        "      <th>10.0%</th>\n",
        "      <th>50%</th>\n",
        "      <th>90%</th>\n",
        "      <th>max</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>num trees</th>\n",
        "      <td> 1000</td>\n",
        "      <td>    950.000000</td>\n",
        "      <td>     0.000000</td>\n",
        "      <td>    950.000000</td>\n",
        "      <td>    950.000000</td>\n",
        "      <td>    950.000000</td>\n",
        "      <td>    950.000000</td>\n",
        "      <td>    950.000000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>fruit per tree</th>\n",
        "      <td> 1000</td>\n",
        "      <td>    955.237168</td>\n",
        "      <td>    67.309614</td>\n",
        "      <td>    745.571168</td>\n",
        "      <td>    866.556534</td>\n",
        "      <td>    953.201796</td>\n",
        "      <td>   1042.565182</td>\n",
        "      <td>   1162.525796</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>volume</th>\n",
        "      <td> 1000</td>\n",
        "      <td> 197002.639667</td>\n",
        "      <td> 15843.318492</td>\n",
        "      <td> 146107.155302</td>\n",
        "      <td> 176828.280784</td>\n",
        "      <td> 197058.041813</td>\n",
        "      <td> 218147.691942</td>\n",
        "      <td> 248917.993787</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>cost per fruit</th>\n",
        "      <td> 1000</td>\n",
        "      <td>      0.860000</td>\n",
        "      <td>     0.000000</td>\n",
        "      <td>      0.860000</td>\n",
        "      <td>      0.860000</td>\n",
        "      <td>      0.860000</td>\n",
        "      <td>      0.860000</td>\n",
        "      <td>      0.860000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>var cost</th>\n",
        "      <td> 1000</td>\n",
        "      <td>  33428.245044</td>\n",
        "      <td>  2754.675996</td>\n",
        "      <td>  24530.658741</td>\n",
        "      <td>  29951.415669</td>\n",
        "      <td>  33420.924643</td>\n",
        "      <td>  37068.661590</td>\n",
        "      <td>  42304.587099</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>revenue per fruit</th>\n",
        "      <td> 1000</td>\n",
        "      <td>      5.248422</td>\n",
        "      <td>     0.629983</td>\n",
        "      <td>      3.305905</td>\n",
        "      <td>      4.430684</td>\n",
        "      <td>      5.249441</td>\n",
        "      <td>      6.043197</td>\n",
        "      <td>      7.074839</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>revenue</th>\n",
        "      <td> 1000</td>\n",
        "      <td> 205622.936898</td>\n",
        "      <td> 34415.184494</td>\n",
        "      <td> 111834.725764</td>\n",
        "      <td> 161601.036590</td>\n",
        "      <td> 205022.623841</td>\n",
        "      <td> 251629.816584</td>\n",
        "      <td> 324243.686508</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>fixed cost</th>\n",
        "      <td> 1000</td>\n",
        "      <td>  90000.000000</td>\n",
        "      <td>     0.000000</td>\n",
        "      <td>  90000.000000</td>\n",
        "      <td>  90000.000000</td>\n",
        "      <td>  90000.000000</td>\n",
        "      <td>  90000.000000</td>\n",
        "      <td>  90000.000000</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>profit</th>\n",
        "      <td> 1000</td>\n",
        "      <td>  82194.691854</td>\n",
        "      <td> 33154.200488</td>\n",
        "      <td>  -9570.139303</td>\n",
        "      <td>  39485.338181</td>\n",
        "      <td>  82092.494482</td>\n",
        "      <td> 125823.296143</td>\n",
        "      <td> 197557.104031</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>discount factor</th>\n",
        "      <td> 1000</td>\n",
        "      <td>      0.772183</td>\n",
        "      <td>     0.000000</td>\n",
        "      <td>      0.772183</td>\n",
        "      <td>      0.772183</td>\n",
        "      <td>      0.772183</td>\n",
        "      <td>      0.772183</td>\n",
        "      <td>      0.772183</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>discounted profit</th>\n",
        "      <td> 1000</td>\n",
        "      <td>  63469.383198</td>\n",
        "      <td> 25601.125911</td>\n",
        "      <td>  -7389.903471</td>\n",
        "      <td>  30489.925848</td>\n",
        "      <td>  63390.468076</td>\n",
        "      <td>  97158.670688</td>\n",
        "      <td> 152550.332101</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>11 rows \u00d7 8 columns</p>\n",
        "</div>"
       ],
       "output_type": "pyout",
       "prompt_number": 11,
       "text": [
        "                   count           mean           std            min  \\\n",
        "num trees           1000     950.000000      0.000000     950.000000   \n",
        "fruit per tree      1000     955.237168     67.309614     745.571168   \n",
        "volume              1000  197002.639667  15843.318492  146107.155302   \n",
        "cost per fruit      1000       0.860000      0.000000       0.860000   \n",
        "var cost            1000   33428.245044   2754.675996   24530.658741   \n",
        "revenue per fruit   1000       5.248422      0.629983       3.305905   \n",
        "revenue             1000  205622.936898  34415.184494  111834.725764   \n",
        "fixed cost          1000   90000.000000      0.000000   90000.000000   \n",
        "profit              1000   82194.691854  33154.200488   -9570.139303   \n",
        "discount factor     1000       0.772183      0.000000       0.772183   \n",
        "discounted profit   1000   63469.383198  25601.125911   -7389.903471   \n",
        "\n",
        "                           10.0%            50%            90%            max  \n",
        "num trees             950.000000     950.000000     950.000000     950.000000  \n",
        "fruit per tree        866.556534     953.201796    1042.565182    1162.525796  \n",
        "volume             176828.280784  197058.041813  218147.691942  248917.993787  \n",
        "cost per fruit          0.860000       0.860000       0.860000       0.860000  \n",
        "var cost            29951.415669   33420.924643   37068.661590   42304.587099  \n",
        "revenue per fruit       4.430684       5.249441       6.043197       7.074839  \n",
        "revenue            161601.036590  205022.623841  251629.816584  324243.686508  \n",
        "fixed cost          90000.000000   90000.000000   90000.000000   90000.000000  \n",
        "profit              39485.338181   82092.494482  125823.296143  197557.104031  \n",
        "discount factor         0.772183       0.772183       0.772183       0.772183  \n",
        "discounted profit   30489.925848   63390.468076   97158.670688  152550.332101  \n",
        "\n",
        "[11 rows x 8 columns]"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# chance of loss in 2014\n",
      "(total_per_iteration.xs('2014', level='year')['profit']<=0).sum()/(N+.0)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "pyout",
       "prompt_number": 12,
       "text": [
        "0.27900000000000003"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# histogram of profit in 2014\n",
      "total_per_iteration.xs('2014', level='year')[['profit']].hist(xrot=90);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEmCAYAAACZEtCsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtwVPX5P/D3YmKpJSFB7Eaz6MYksLkAidCkv46WRUgC\n0xLwMpHgYJBYZ2Ds1EureMVQJIvtjAUrjnWgSbUS+ENJeiFGSg6tVg3aRB2DTdANxE1IDUkwKLCQ\nnN8f+2VlTUh2z9ndz37Ovl8zO8PZ2/PecM6TzbOf3TWpqqqCiIgMZYLoAEREFHxs7kREBsTmTkRk\nQGzuREQGxOZORGRAbO5ERAbE5k40hueffx5msxnx8fHo6+tDXFwcOjo6RMciGpeJ69yJRnf27FlM\nnjwZTU1NyM7OHnH5qlWrMG3aNPz6178WkI5obHzmTlHr3LlzY15+7NgxnD59GhkZGWFKRBQ8bO5k\nOFarFQ6HA1lZWZgyZQpWr16NM2fOQFEUWCwWPP3007jyyitRXl4Ot9uNe++9F8nJyUhOTsZ9990H\nt9uNtrY2b1NPSEjAwoULAQATJkzAp59+ij/84Q945ZVX8PTTTyMuLg5Lly4V+ZCJRogRHYAoFF55\n5RU0NDTgsssuw5IlS7Bx40YsXLgQPT096O/vx9GjRzE0NISNGzeiqakJH3zwAQBg6dKl2LhxIzZs\n2ICPP/4YKSkpOHHiBCZM+OZ5kMlkwt133423334b06ZNw4YNG0Q9TKKL4jN3MhyTyYR77rkHycnJ\nSExMxKOPPoqdO3cC8DzzrqioQGxsLCZOnIhXXnkFTzzxBKZOnYqpU6di/fr1eOmllwAA/rwcxZes\nKFKxuZMhTZs2zfvvq6++Gl1dXQCAK664Apdeeqn3sq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F9Q/dvf/oYrrrgCAPDLX/4Su3btwuHDh7Fv3z488MADoSwdFFOnTsWcOXO8p7lz58Llcnn/Hcnu\nvPNOAMAtt9yCnTt34pZbbsHp06cBAG+//bbIaFFBVVVMmjQJAGC1WnHgwAHs3bsX9913nxTvNXjv\nvfcwZ84cPPXUU4iPj4fdbsfEiRMxb948zJs3T3S8cWVlZWHHjh0AgNmzZ+PgwYMAgLa2Nlx66aUi\no/lleHgYZ86cweDgIE6dOoUTJ04AAE6fPo3h4WH/7iREv3hUVfX89jz/4Tff/t5Of3/7iPTb3/5W\nLSoqUj/44APveVarVWAi/3372cnGjRvVH/3oR+oXX3whxTNH2dntdrW5udnnPLfbra5cuVI1mUyC\nUgWus7NTvfXWW9W1a9eqFotFdBy/9ff3q3fccYeakpKi5uXlqTExMarValVvuOEGtaWlRXS8cW3a\ntElNSUlRp0+frr7wwgtqRkaGWl5ermZlZambN2/26z5COnN/9tlnUVdXh4cffhj//Oc/0d/fj5tv\nvhn79+/HZ599JsWLM52dnbj//vthsVhQUVGB2bNnw+l0io41royMDHz88ceYMOGbP86qqqrwm9/8\nBidPnsSRI0cEpjO+zs5OxMbGjvi4B1VV8dZbb+H6668XlEybv/71r/j3v/+NTZs2iY4SkBMnTsDp\ndOLcuXOwWCxSffxGR0cH4uPjMWXKFHz66ad47733YLPZMHv2bL9uH/IXVBsbG/H888+jvb3d+wNe\ntmwZVq9e7dcrvpGitrYWlZWVcDqdPmtPI9WvfvUrFBYWoqCgwOf8+vp6/PznP0d7e7ugZEQUDmFd\nLVNXV4fi4uJwlQu6uro6XHvttcjOzhYdJWB/+ctfsGTJEtExiChMwtrcZ86ciY8++ihc5YJO5vwy\nZyeiwIX8UyGJiCj82NyJiAyIzZ2IyIDY3ImIDCiszV2mNaajkTm/zNmJKHBh/+AwIiIKPY5liIgM\niM2diMiA2NyJiAyIzZ2IyID+PxhGwwgzlBz5AAAAAElFTkSuQmCC\n"
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# histogram of NPV\n",
      "example1.calc_NPVs(total_per_iteration).hist(xrot=90);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAElCAYAAAAfhqICAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9M1Pf9B/DnWVjtAhas82Rc21NAkRYBf9G0M8UoKFmL\nLl1AXAsqzsZm67q6Dmqz+aPfCDadq7UxcVoHtqvVLBHc1jKajo91TVpsJ+kiddp4WORXq4BiTfAH\n7+8fVw6vINxx9743n/fn+Uiacndw79cr9/m8OJ/3vsMmhBAgIiKtjFFdABERBR+HOxGRhjjciYg0\nxOFORKQhDnciIg1xuBMRaYjDnYhIQxzupD2n0wm73Y4rV654rtuzZw/mz58PABgzZgwiIiIQGRkJ\nh8OBdevWobe3F4sXL8aGDRsG3F9VVRViYmLQ29sbsh6I/MXhTpbQ29uL7du3e11ns9k8X3/22Wfo\n7u7G+++/j7feegu7d+/GihUr8Oabbw64rzfeeAOPP/44xozh6UOjF49O0p7NZsNvfvMbvPzyy7h4\n8eKQ3ztt2jTMmzcPJ06cwNKlS3HhwgUcPXrUc3tnZyf+8Y9/oKCgQHbZRAHhcCdLmD17NjIyMvDy\nyy8Penvfp3A0NDTg6NGjSEtLw9ixY5Gbm4t9+/Z5vu/gwYOYPn06kpOTQ1I30UhxuJMl2Gw2bN68\nGTt27MD58+cB9A90AJg5cybGjx+PnJwc/PznP8fKlSsBAIWFhfjrX/+Kq1evAgD27duHwsLC0DdA\n5Kcw1QUQhcp9992HRx55BGVlZZg+fbrXbcePH8eUKVMG/MxDDz2ECRMm4NChQ5g9ezaOHTuGysrK\nUJVMNGIc7mQpmzZtwsyZM7Fu3Tqff6agoAD79u3DyZMnsXjxYvzgBz+QWCFRcDCWIUuJi4tDXl4e\ntm/f7rVbZigFBQV47733sGfPHkYy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9+/ToqKip8ug/u\nliEi0hD3uRMRaYjDnYhIQxzuREQa4nAnItIQhzsRkYb+H58b09h7Bk6uAAAAAElFTkSuQmCC\n"
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}