{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Summary of all the experiments done" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib notebook\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "from scipy import stats\n", "import os as os\n", "from statsmodels.stats import multitest\n", "from mpl_toolkits.mplot3d import axes3d \n", "\n", "pd.set_option('display.max_rows', 20)\n", "pd.set_option('display.max_columns', 500)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## I. Implementation of the pairwise competition - comparison with other models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### I.1 Idea\n", "First assessment upon discovering the MESS model : the competition implemented compares the trait of each individual to the mean trait value for the community, which does not seem biologically very realistic to me. For example the that case, the blue individual would be favored above the green; which seems contrary to the niche theory which is being assumed when speaking about competition for ressource access.\n", "\n", "\n", "\n", "\n", "Therefore, I implemented a model for pairwise competition : the distance to each other individual is computed pairwise !" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": true }, "outputs": [], "source": [ "#Neutral VS Pairwise VS mean 20 gen\n", "cmp_pw = pd.read_csv(\"20gen_test_pw_vs_mean/pairwise_20gen/SIMOUT.txt\", sep=\"\\t\", header=0)\n", "cmp_neutral = pd.read_csv(\"20gen_test_pw_vs_mean/neutral_20gen/SIMOUT.txt\", sep=\"\\t\", header=0)\n", "cmp_mean = pd.read_csv(\"20gen_test_pw_vs_mean/mean_20gen/SIMOUT.txt\", sep=\"\\t\", header=0)\n", "# Sumstats start at \"S\" which is index 21, e.g. cmp_mean_res.iloc[:, 21:]\n", "ss_start_idx = list(cmp_mean.columns).index(\"S\")\n", "ss_columns = cmp_mean.columns[21:]\n", "# Param files used for the simulations are in the 20gen_test_pw_vs_mean/ directory" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support. ' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
');\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " // select the cell after this one\n", " var index = IPython.notebook.find_cell_index(this.cell_info[0]);\n", " IPython.notebook.select(index + 1);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "/home/juliette/.local/lib/python3.8/site-packages/numpy/lib/histograms.py:839: RuntimeWarning: invalid value encountered in greater_equal\n", " keep = (tmp_a >= first_edge)\n", "/home/juliette/.local/lib/python3.8/site-packages/numpy/lib/histograms.py:840: RuntimeWarning: invalid value encountered in less_equal\n", " keep &= (tmp_a <= last_edge)\n" ] } ], "source": [ "fig = plt.figure(figsize=(6,6))\n", "\n", "#===============\n", "# First subplot\n", "#===============\n", "ax = fig.add_subplot(2, 2, 1)\n", "\n", "\n", "ax.hist(ttres_mean[1],align='left')\n", "ax.set_xlim(0,1)\n", "ax.set_ylabel(\"Number of summary statistics\")\n", "ax.set_title(\"mean competition\")\n", "\n", "ax = fig.add_subplot(2, 2, 2)\n", "ax.hist(ttres_pw[1], align='left')\n", "ax.set_xlim(0,1)\n", "ax.set_title(\"pairwise competition\")\n", "\n", "ax = fig.add_subplot(2, 2, 3)\n", "ax.hist(ttres_neutral[1], align='left')\n", "ax.set_xlabel(\"p-value (Bonferroni correction)\")\n", "ax.set_xlim(0,1)\n", "ax.set_ylabel(\"Number of summary statistics\")\n", "ax.set_title(\"neutral\")\n", "\n", "ax = fig.add_subplot(2, 2, 4)\n", "ax.hist(ttres_filtering[1], align='left')\n", "ax.set_xlabel(\"p-value (Bonferroni correction)\")\n", "ax.set_xlim(0,1)\n", "ax.set_title(\"environmetal filtering\")\n", "\n", "plt.suptitle(\"T-test between MESS with and without arrays\\n for all community assembly\")\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Conclusion : \n", "The new implementation, which changed the managing of the local community (and their traits) from lists to arrays does not seem to have distrubed the simulations : the obtained summary statistics are the same as before.\n", "\n", "This increased speed allows us to have a global graph of the summarys statistics to show the different behaviour of the models:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support. ' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
');\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "X = filt500[\"ecological_strength\"]\n", "Y = [np.mean(filt500[\"is_neutral\"][i][-25:]) for i in range(len(filt500))]\n", "plt.scatter(X,Y,color=\"#3F681C\", label=\"filtering\", alpha=0.5, marker='.')\n", "plt.xscale('log')\n", "plt.xlim(1e-5,100)\n", "plt.ylabel('convergence twd neutrality',size=14)\n", "plt.xlabel('ecological strength',size=14)\n", "plt.title(\"degree of convergence (filtering)\",size=16)\n", "plt.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This gives the impression that the degree of convergeance toward neutrality is really wide spread, and the the ecological strength has therefore little impact.\n", "\n", "*Hypothesis:* The trait value converges quickly toward the optimum when es is high, and then all surviving species are more or less equivalent, so it becomes more \"neutral\" even for the highest values of ecologicial strength. For the lowest values, this convergence still occurs but takes more time; thus resulting in non-neutral simulations at some point (allows higher divergence in trait values for the surviving species ?\n", "\n", "*Hypothesis testing:* Look at the convergence for different time step + Look at the trait value distribution as a function of the ecological strength (for different time step (TO DO)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " This graphs seems to confirm the hyopethesis : the spread occurs later in time.\n", "(notebook in filtering_es. Points are the proportion of neutrality over 25 timepoints (500 generations total : there is a point every 5 complete generations). Param file in filtering_es/)\n", " \n", " \n", "\"filtering\"\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### V.3.2 Competition" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**DATA INFORMATIONS:**\n", "notebook in emergeant_neutrality/emergeant_neutrality.ipynb (with param file)\n", "\n", "For pairwise : all interaction terms are -1 (classical negative interaction, no use of the matrx in itself)\n", "\n", "500 generations, scan through ecological strength, speciation probablity, migration probability and population size. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "\n", "\"drawing\"\n", "\"drawing\"\n", " \n", "
\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A few remarks : \n", "* Pairwise behaves as expected : a high ecological strength drives simulations away from neutrality while a very low one drives it toward neutrality. This is expected from the mathematical formula of the death probabilities. **However** this was also expected for the filtering and the mean competition, but is not observed.\n", "\n", "NB for pairwise : with time, simulations becomes \"neutral\" for higher values of ecological strength\n", "\n", "\"drawing\"\n", "\n", "\n", "*Hyp:* would do as filt if longer time ??\n", "\n", "* The mean competition seems to have a local minimum of \"neutrality\". In itself, mean competition is a mix of both other models : it aims to go away from a target (which essentially fixed as we expect the mean to stay around 0 - this will however be explored more in details).\n", "\n", "NB: no strinking time pattern ?\n", "\n", "\"drawing\"\n", "\n", "*Hypothesis ?* For higher ecological strength : only 2 species surviving (- and +), away from mean and any other individual dies straight away so there is almost None and it can look neutral if they are equally far away from the mean ?\n", "\n", "*How to test that ?* Look at trait distribution across time (+ neutral convergence through time for several ecological strength ?) + Evolution of convergence toward neutrality through time ?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*Other hypothesis for mean competition :* it is expected that the simulations would \"go neutral\" as the ecological strength rises because then every \"death probability\" rises to infinite too and through the normalisation it gets almost neutral. The same beahivor should be observed for pairwise competition as the ecological strength continues rising ?\n", "\n", "*Hyp tested but not confirmed :*\n", "\"filtering\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " No apparent change in the distribution through time : always a minimum of neutrality for an intermediate value of ecological strentgh. *Hypothesis ?*\n", "\"filtering\"\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Naturally, the ecological strength is not the only parameter having a rather strong impact on the convergeance toward neutrality :\n", "\n", "
\n", "\n", "\"filtering\"\n", "\n", "\"drawing\"\n", " \n", "
\n", "
\n", "\"drawing\"\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For both mean competition and environmental filtering, the lower the migration and speciation rates, the higher the convergeance toward neutraltiy, whereas this seems to have no impact on pairwise competition cases. When looking more closely however, the effect is more important for the speciation rate than for the migration rate. Therefore, we will look at the same kind of graph but for speciation rate and ecological strength, as to determine which one has the strongest impact.\n", "\n", "*Hypothesis:* More migration and speciation enables more selection, and thus is less neutral ? But then why is it different for pairwise ? Selection sufficiently strong in any case, independentely from rates ?\n", "\n", "*Hypothesis testing:* Watch speed of convergence toward neutral for different rates ?\n", "(~ would converge anyway but later if higher rates ?) : We will look at graphs of speciation rate and ecological strength impact on convergence toward neutrality, for different time steps !\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\"filtering\"\n", "\"filtering\"\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One can note here that the more dispersed points at the beginning are those with the highest speciation rate (which enables a quicker convergence toward the optimum), which seems to confirm that the spread of the points occurs once the optimum trait value is reached" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\"filtering\"\n", "\"filtering\"\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There is however less difference across time when considering the mean competition. However, what is strinking is that the points having the highest neutrality despite a strong ecological strength are the points having the lowest speciation rate, so supposedly the one evolving slower. *Hypothesis?*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### No impact of migration and speciation for pairwise competition ?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data in this subsection : data from the inference\n", "\n", "(~6400 simulations of each community assembly model. generation 0; alpha 1000-10000; S_m 250; ecologixal_strength 0.01-10; intrasp_comp \\*; intersp_comp \\*, mutualism_pro 0-1, J 1000-5000, m 0.001-0.01, speciation_prob 0.0005-0.005)\n", "\n", "NB: for intersp and intrasp terms, * means logunif draw 0.01-10 for both mean and variance of the gamma law. THOUGH IN THE SIM INTRA\\< INTER AND I DON'T KNOW WHY" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When looking more closely to the summary statistics, we observe that migration and speciation rate both to make a difference (for pairwise competition here) in certain summary statistics (mostly trait-related values ?), contrary to what is observed in the convergence toward neutrality:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"/\n", "\n", "\"drawing\"/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### V.4 Traits through time" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"\n", "\"drawing\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Observations here : degenerated plots for one of the case (inter < intra - but here probably my mistake : mutualism instead of competition --- similar results expected in any case) + Globally degenerated plots when terms are drawn from a gamma law.\n", "\n", "**CCL**: Do *not* use a gamma law draw but just two random values, and with the intraspecific competition being *necessarily* higher than the interspecific competition ? Or finally just one term total ?\n", "\n", "*Hypothesis:* This could be prevented by using a progressive invasion of the island or the landbridge origin instead of the volcanic ?\n", "\n", " - Progressive invasion just results very quickly in an island full with just one species\n", " - Landbridge origin is not very realistic in what we are studying\n", " - I tested the landbridge origin : still the same issue !\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"filtering\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Below this is the old text and figures \\ Do not look at it" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Traits thourgh time : does not seem to validate the hypothesis for pairwise competition to have evenly spread species ! **out of 93 simulations of 200 generations with no mutualism at all, 50 had just on trait at the end !\n", "With mutualism : 58/93 so the effect is unclear.**\n", "Instead of plots, I am going to have some stats : Look at the species abundance for the different models ?\n", "*(However, couting from the resulting plots as I did seems to be a bad idea : I never saw more than 6 species, while there was supposed to be sometimes around 25 ? I have to recode a more proper way to get these data about trait distribution)*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This graph confirms the intuition seen on seperated data that in pairwise_competition there are often few (even only 1) species surviving. *IS THIS A BUG IN THE CODE ? CONVERGEANCE TOWARD 1 SPECIES LATE IN TIME ?*\n", "\n", "However, there might be some discontinuity in the model (intra- and interspecific terms being fixed or variables; being identical or different; having mutualism (positive interaction) or not). This is why we are going to look more into details at the number of species distribution for pairwise competition:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "\"drawing\"\n", "\"drawing\"\n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Having only mutualism or only antagonism seems to twist the simulations toward having only one species surving, while having of both support a higher diversity. This bimodal distribution might twist the classification between the community assembly model, because you are necessarily far from a big part of the simulations ?\n", "\n", "However, this also shows that there is a continuity in the mutualism proportion (no big difference between 0 and 0+e or 1 and 1-e), so the proporition can be predicted." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Another important factor is the difference between intra and interspecific competition:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is clear that the impact of the relative strength of inter-specific and intra-specific competition is much higher than the impact of the proportion of so-called \"mutualism\"\n", "\n", "Thus, a discrepancy between inter- and intra-specific competition seems to favor a high number of species. (+ there is still no discontinuity when the two terms are stricly equals or slightly different). **Notabely however, I noticed that in all simulations here, interspecific competition is higher than intraspecif. This seems biologically sensible, but I do not remember having impose such a constraint in the code, I have to verify what happened here !**\n", "\n", "For more global results on the effects of inter-/ intra-specific competition strength and mutualism proportions, see the complete graphs of summary statistics below:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"/\n", "\"drawing\"/\n", "\"drawing\"/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "***ANALYSIS ?***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's look more closely at the impact of ecological strength itself. We observed previously that the model converged toward neutrality when the ecological strength decrease from 10 to 0.01. However, there is no observable differences in the summary statistics :" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"drawing\"/\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*This is rather surprising, and a further analysis should be conducted to try to understand how this can be so : other parameters not evenly distributed between the different classes of ecological strength ?*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Inference from empirical data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we get an idea of how our models work, we can use them to try to infer the model from empirical data, and then predict their coefficient." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To do the inference, I use ~6400 simulations of each community assembly model. generation 0; alpha 1000-10000; S_m 250; ecologixal_strength 0.01-10; intrasp_comp \\*; intersp_comp \\*, mutualism_pro 0-1, J 1000-5000, m 0.001-0.01, speciation_prob 0.0005-0.005\n", "\n", "NB: for intersp and intrasp terms, * means logunif draw 0.01-10 for both mean and variance of the gamma law. THOUGH IN THE SIM INTRA\\< INTER AND I DON'T KNOW WHY\n", "\n", "Confusion matrix for the trained classifier : \n", "\n", "\"drawing\"\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0competitionfilteringneutralpairwise_competition
0community_assembly_model0.001350.0368180.9599170.001915
\n", "
" ], "text/plain": [ " Unnamed: 0 competition filtering neutral \\\n", "0 community_assembly_model 0.00135 0.036818 0.959917 \n", "\n", " pairwise_competition \n", "0 0.001915 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0alphaecological_strengthJmgenerationspeciation_prob_lambda
0estimate8325.4438122.1256513902.5676270.005310814.9054220.0008160.859447
1lower 0.0255925.3335720.0116202558.4673340.0013331061.5543330.0005100.791662
2upper 0.9759866.9961779.2889374916.3109870.009625874.9293180.0015200.989689
\n", "
" ], "text/plain": [ " Unnamed: 0 alpha ecological_strength J m \\\n", "0 estimate 8325.443812 2.125651 3902.567627 0.005310 \n", "1 lower 0.025 5925.333572 0.011620 2558.467334 0.001333 \n", "2 upper 0.975 9866.996177 9.288937 4916.310987 0.009625 \n", "\n", " generation speciation_prob _lambda \n", "0 814.905422 0.000816 0.859447 \n", "1 1061.554333 0.000510 0.791662 \n", "2 874.929318 0.001520 0.989689 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import joblib\n", "spiders_cl = pd.read_csv(\"inference_results/Reunion_spiders/est1.csv\")\n", "spiders_proba = pd.read_csv(\"inference_results/Reunion_spiders/proba.csv\")\n", "spiders_est = pd.read_csv(\"inference_results/Reunion_spiders/est2.csv\") \n", "display(spiders_proba)\n", "display(spiders_est)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Posterior predictive check : the prediction does not seem very good !\n", "\n", "\"filtering\"" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "rgr = joblib.load(\"inference_results/Reunion_spiders/cla.pkl\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sabund_h1abund_h2abund_h3abund_h4pi_h1pi_h2pi_h3pi_h4mean_pistd_piskewness_pikurtosis_pimedian_piiqr_piabundance_pi_corSGD_0SGD_1SGD_2SGD_3SGD_4SGD_5SGD_6SGD_9
Feature importance0.0445110.1046630.0622080.0606630.0624250.0480230.0419490.0407610.0384740.0631040.0985640.0403230.0402320.0114370.0451990.0467830.0398820.0304360.0201120.016320.0130150.0132010.0100280.007685
\n", "
" ], "text/plain": [ " S abund_h1 abund_h2 abund_h3 abund_h4 \\\n", "Feature importance 0.044511 0.104663 0.062208 0.060663 0.062425 \n", "\n", " pi_h1 pi_h2 pi_h3 pi_h4 mean_pi \\\n", "Feature importance 0.048023 0.041949 0.040761 0.038474 0.063104 \n", "\n", " std_pi skewness_pi kurtosis_pi median_pi iqr_pi \\\n", "Feature importance 0.098564 0.040323 0.040232 0.011437 0.045199 \n", "\n", " abundance_pi_cor SGD_0 SGD_1 SGD_2 SGD_3 \\\n", "Feature importance 0.046783 0.039882 0.030436 0.020112 0.01632 \n", "\n", " SGD_4 SGD_5 SGD_6 SGD_9 \n", "Feature importance 0.013015 0.013201 0.010028 0.007685 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "array([[]],\n", " dtype=object)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAE/CAYAAADltBDmAAA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xybkuTGQtJtqYXuJ+vqiumsc5Nmcw4DgPekWQlvad9v5bkkukrdZMm+/31QFWte8bxRXohPCyTGcuRwH1V9UhVPQ9cAbxlGmvdlMn87Lb7uR/Wovd0PujNJu6l9z/wukXx/UYdcwwvvTnwrUHP3YzGEuCzwAWb89dk1DELGf6NtEmNBfgG8Ivd9tnARzfHsQAHA3fQW8sNvRuE75/JY+k79mxeeiOt2c/90L5xG3wBjqZ3t/6HwJndvlOBU7vtAP+ja18BjGzs3M1xLMDh9J4i3Q7c2j2O3tzGMaqPoYfuFHx/HQAs7b4uVwKv2ozHcg7wfeC7wOeAbWf4WF5Db1b7E+DxbnunDZ07HQ/fkSZJDc3WNV1JmpEMXUlqyNCVpIYMXUlqyNCVpIYMXUlqyNCVpIYMXUlq6P8DXU+3GwDBnhEAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "display(rgr.feature_importances())\n", "\n", "rgr.plot_feature_importance(figsize=(5,5))\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0competitionfilteringneutralpairwise_competition
0community_assembly_model0.0014610.0380180.9543180.006202
\n", "
" ], "text/plain": [ " Unnamed: 0 competition filtering neutral \\\n", "0 community_assembly_model 0.001461 0.038018 0.954318 \n", "\n", " pairwise_competition \n", "0 0.006202 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0alphaecological_strengthJmgenerationspeciation_prob_lambda
0estimate8794.2328012.1150044007.5037130.003458758.7426050.0008900.705315
1lower 0.0256796.5109870.0125952789.6019720.0010131103.9102210.0005100.315727
2upper 0.9759905.2109329.4431344962.3591660.009198725.2776890.0017490.983574
\n", "
" ], "text/plain": [ " Unnamed: 0 alpha ecological_strength J m \\\n", "0 estimate 8794.232801 2.115004 4007.503713 0.003458 \n", "1 lower 0.025 6796.510987 0.012595 2789.601972 0.001013 \n", "2 upper 0.975 9905.210932 9.443134 4962.359166 0.009198 \n", "\n", " generation speciation_prob _lambda \n", "0 758.742605 0.000890 0.705315 \n", "1 1103.910221 0.000510 0.315727 \n", "2 725.277689 0.001749 0.983574 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "snails_cl = pd.read_csv(\"inference_results/Galapagos_snails/est1.csv\")\n", "snails_proba = pd.read_csv(\"inference_results/Galapagos_snails/proba.csv\")\n", "snails_est = pd.read_csv(\"inference_results/Galapagos_snails/est2.csv\") \n", "display(snails_proba)\n", "display(snails_est)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0competitionfilteringneutralpairwise_competition
0community_assembly_model0.0022020.0333490.9631750.001274
\n", "
" ], "text/plain": [ " Unnamed: 0 competition filtering neutral \\\n", "0 community_assembly_model 0.002202 0.033349 0.963175 \n", "\n", " pairwise_competition \n", "0 0.001274 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0alphaecological_strengthJmgenerationspeciation_prob_lambda
0estimate8885.3235882.2786382478.0629690.003614802.6116290.0007490.858797
1lower 0.0257299.7523380.0133071231.3925800.0010501061.5342480.0005100.756145
2upper 0.9759905.7763309.4273664461.4556930.008980935.4347270.0014910.992805
\n", "
" ], "text/plain": [ " Unnamed: 0 alpha ecological_strength J m \\\n", "0 estimate 8885.323588 2.278638 2478.062969 0.003614 \n", "1 lower 0.025 7299.752338 0.013307 1231.392580 0.001050 \n", "2 upper 0.975 9905.776330 9.427366 4461.455693 0.008980 \n", "\n", " generation speciation_prob _lambda \n", "0 802.611629 0.000749 0.858797 \n", "1 1061.534248 0.000510 0.756145 \n", "2 935.434727 0.001491 0.992805 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "reu_weevils_cl = pd.read_csv(\"inference_results/Mascarene_weevils/est1_reunion.csv\")\n", "reu_weevils_proba = pd.read_csv(\"inference_results/Mascarene_weevils/proba_reunion.csv\")\n", "reu_weevils_est = pd.read_csv(\"inference_results/Mascarene_weevils/est2_reunion.csv\") \n", "display(reu_weevils_proba)\n", "display(reu_weevils_est)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0competitionfilteringneutralpairwise_competition
0community_assembly_model0.0021450.0272240.9680640.002567
\n", "
" ], "text/plain": [ " Unnamed: 0 competition filtering neutral \\\n", "0 community_assembly_model 0.002145 0.027224 0.968064 \n", "\n", " pairwise_competition \n", "0 0.002567 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0alphaecological_strengthJmgenerationspeciation_prob_lambda
0estimate8581.3115332.3897172501.9182340.003390717.2837910.0007520.876030
1lower 0.0256252.2000950.0124651245.9153990.0010581138.3066170.0005100.783117
2upper 0.9759868.8762979.4319874466.3988490.008520955.8003730.0014930.992157
\n", "
" ], "text/plain": [ " Unnamed: 0 alpha ecological_strength J m \\\n", "0 estimate 8581.311533 2.389717 2501.918234 0.003390 \n", "1 lower 0.025 6252.200095 0.012465 1245.915399 0.001058 \n", "2 upper 0.975 9868.876297 9.431987 4466.398849 0.008520 \n", "\n", " generation speciation_prob _lambda \n", "0 717.283791 0.000752 0.876030 \n", "1 1138.306617 0.000510 0.783117 \n", "2 955.800373 0.001493 0.992157 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "maur_weevils_cl = pd.read_csv(\"inference_results/Mascarene_weevils/est1_mauritius.csv\")\n", "maur_weevils_proba = pd.read_csv(\"inference_results/Mascarene_weevils/proba_mauritius.csv\")\n", "maur_weevils_est = pd.read_csv(\"inference_results/Mascarene_weevils/est2_mauritius.csv\") \n", "display(maur_weevils_proba)\n", "display(maur_weevils_est)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Everything is predicted as neutral with a >95% probability (which is supsicious and contrary to what was done in the MESS paper). How and why ?\n", "\n", "*Hyp:* Bad classification for pairwise competition in any cases because too inequals data ? -> Simulations can be more different within that class than between other classes of community assembly ?\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## NEXT : continous model selection ? 2D-trait ? New fitness function for envmt ?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 2 }