class: title-slide, middle <style type="text/css"> .title-slide { background-image: url('assets/img/bg.jpg'); background-color: #23373B; background-size: contain; border: 0px; background-position: 600px 0; line-height: 1; } </style> # Day 2. Probabilities. <hr width="65%" align="left" size="0.3" color="orange"></hr> ## Problem to solve <hr width="65%" align="left" size="0.3" color="orange" style="margin-bottom:40px;" alt="@Martin Sanchez"></hr> .instructors[ **ECL707/807** - Dominique Gravel ] <img src="assets/img/logo.png" width="25%" style="margin-top:20px;"></img> <img src="assets/img/Bios2_reverse.png" width="23%" style="margin-top:20px;margin-left:35px"></img> --- # Invasive species on insular habitats Documenting the invasion process is a notorious challenge because ecologists only have part of the information : they know which species succeed at the invasion but they do not have information about the failures. It is therefore very challenging to test hypotheses about the role of certain traits on the establishment probability. Many hypotheses like the ennemy release and the propagule pressure have been proposed to explain the success of invasive plants and animals, but testing them remains a challenge. We'll work together to find a solution to this famous problem. There is now considerable information about the body size distribution of mammals and birds across the world. Body size is a fundamental trait related to reproductive rate, dispersal, trophic position and so on. You will find a dataset in the github repository with a list of bird and mammal species along with their body mass. You will also find a boolean telling you if it is invasive or not in New Zealand. That's all the information you have. --- # Objective The objective is to evaluate if selection of body size influences the establishment success of invasive species in New Zealand. In other words, we need to evaluate if the local distribution of invasive species body size is a random draw from the global pool of mammals and birds or if it is a biased draw. --- # Assumption We need to ackowledge one important assumption : potential invaders are picked at random from the global pool of mammals, irrespective of their body size. --- # What to do 1. Use Bayes theorem to find out what is the probability distribution of body size of invading species. Start with abstract probability functions (e.g. `\(P(T)\)`) to represent the trait distribution in the global pool) to write down your equation. 2. Consider different candidate functions to relate the establishment probability given body size 3. Write down R functions for the different components of the model 4. Play with different functions and parameter values to try to find the underlying model --- # Trick You will have to solve an integral at some point in the process (the denominator of Bayes theorem). There are different ways to do it, you can either : - Use calculus to solve the problem (will depend on the functions you choose) - Discretize the functions to integrate and take the sum - Use the base function **integrate** to do it for you