Differences
This shows you the differences between two versions of the page.
| — | en:ecovirt:roteiro:den_ind:di_ea_base [2022/09/19 16:35] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | BASE | ||
| + | |||
| + | |||
| + | ====== Density independent growth with environmental stochasticity ====== | ||
| + | {{: | ||
| + | |||
| + | In the [[en: | ||
| + | |||
| + | \begin{equation} | ||
| + | N_t=N_0 \lambda^t | ||
| + | \label{eq1} | ||
| + | \end{equation} | ||
| + | |||
| + | By doing this, we are assuming that the growth rate is the same at each generation, which is far from realistic. Resources and environmental conditions vary with time, which must make λ drift. If we accept this, calling λi the growth rate at each generation((i=1,2,3,…t)), our model becomes: | ||
| + | |||
| + | \begin{equation} | ||
| + | N_t=N_0 \lambda_1 \lambda_2 \lambda_3 \ldots \lambda_t | ||
| + | \label{eq2} | ||
| + | \end{equation} | ||
| + | |||
| + | We still have an average growth rate, that we can estimate by averaging the observed growth rates over the generations. Is the environmental conditions are nearly constant, the observed rates must be close to this average most of the time, which means that the λi should have a small variance((further in this tutorial we will define precisely what variance is. For now, think of it as a measure of how much the data varies)). If there is a lot of environmental variability, | ||
| + | |||
| + | |||
| + | ====== Simulating environmental stochasticity | ||
| + | |||
| + | How does environmental stochasticity affects the population size projections? | ||
| + | |||
| + | |||
| + | ====== Parâmetros ===== | ||
| + | |||
| + | The parameters of our model: | ||
| + | | ||
| + | |||
| + | ^Option ^ parameter^ | ||
| + | ^'' | ||
| + | ^'' | ||
| + | ^'' | ||
| + | ^'' | ||
| + | ^'' | ||
| + | ^'' | ||
| + | ^'' | ||
| + | |||
| + | |||
| + | ====== What's in the graph? ====== | ||
| + | |||
| + | Each colored line is the time projection of the size of one population, according to the model (???). Each population has the same mean growth rate and the same initial size. The projections are different, because at each time step a different growth rate is drafted independently for each population. | ||
| + | |||
| + | The drafts are made from a probability distribution called [[http:// | ||
| + | |||
| + | The black line shows a projection of a population under a constant growth rate equal to the average of the probability distribution. Although the model is discrete, we have represented the population projections with lines to facilitate the visualization of the trajectories over time. | ||
| + | |||
| + | ====== Becoming familiar with the simulations ====== | ||
| + | |||
| + | Our objective is to understand the effects of environmental stochasticity over the density independent discrete population growth. We should start by seeing just one population at a time. | ||
| + | |||
| + | - Change the value of '' | ||
| + | - Change the value of '' | ||
| + | - Change the value of '' | ||
| + | - Click '' | ||
| + | - Repeat the operation a couple of times and observe how the graph changes | ||
| + | - Now repeat it with more environmental stochasticity. To do this, increase the value of '' | ||
| + | |||
| + | Every time you click the '' | ||
| + | |||
| + | The numbers are drafted from the same probability distribution, | ||
| + | |||
| + | === Questions == | ||
| + | - What is necessary to simulate a constant environment in this tutorial? | ||
| + | - What is the behavior of the projections with no environmental stochasticity? | ||
| + | |||
| + | ====Averaging over several projections==== | ||
| + | |||
| + | A common way of dealing with variable processes is to the describe their average behavior. For example, [[http:// | ||
| + | |||
| + | In our simulations, | ||
| + | |||
| + | Let's assess this by predicting several independent populations, | ||
| + | |||
| + | < | ||
| + | # store the results in an object called " | ||
| + | |||
| + | tmax = 51 | ||
| + | npop = 1000 | ||
| + | N0 = 10 | ||
| + | lambda = 1.1 | ||
| + | varr = 0.03 | ||
| + | ext = FALSE | ||
| + | |||
| + | </ | ||
| + | |||
| + | You will see a graph with the independent evolution of 1000 populations over time following the model in (???), | ||
| + | |||
| + | By naming the object created, you have recorded the population size projections in the memory of the R environment, | ||
| + | |||
| + | |||
| + | ====== continuação modelagem ====== | ||
| + | |||
| + | |||
| + | < | ||
| + | ## Removes the two first columns (which have the time and deterministic solution) | ||
| + | sim1b <- sim1[, | ||
| + | |||
| + | ## Averages the population for each time | ||
| + | means=apply(sim1b, | ||
| + | |||
| + | ## What is the maximum time | ||
| + | time <- length(means)-1 | ||
| + | |||
| + | ## Plots the mean of the simulations | ||
| + | plot(0: | ||
| + | </ | ||
| + | |||
| + | |||
| + | Now click on '' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | The averages seem to have a geometric growth, just like the discrete growth model without stochasticity. Let's see this for the first five projected values. Copy the following lines in the '' | ||
| + | < | ||
| + | # Average of the projected populations from time t=0 to t=5 | ||
| + | means[1:6] | ||
| + | </ | ||
| + | |||
| + | The projected population for the average λ is: | ||
| + | |||
| + | < | ||
| + | 10*1.1^(0: | ||
| + | </ | ||
| + | |||
| + | We can also add the deterministic projection to the graph, by using the commands | ||
| + | |||
| + | < | ||
| + | points(0: | ||
| + | legend(" | ||
| + | pch=c(1, | ||
| + | </ | ||
| + | |||
| + | == Question == | ||
| + | |||
| + | Seeing the results you have reached with the model of discrete growth with environmental stochasticity, | ||
| + | |||
| + | Nt = N0t∏i=1λi | ||
| + | |||
| + | If we define the average of the values of λi as | ||
| + | |||
| + | ˉλ = E[λi] | ||
| + | |||
| + | Propose an equation for the expected value of the population size E[Nt] as a function of ˉλ. | ||
| + | |||
| + | |||
| + | ====== | ||
| + | [[http:// | ||
| + | |||
| + | Last section showed that even with environmental stochasticity, | ||
| + | |||
| + | That's a welcome result, but averages can be misleading, as would say the statistician who drowned in a pond with an average depth of 3 feet. The missing information is how much variability there is in the data. One way to measure it is the // | ||
| + | |||
| + | VAR[X] = E[(X−E[X])2] | ||
| + | |||
| + | Notice that the variance is the mean of the deviations from the mean. This deviation is squared because of some convenient mathematical properties((in order to see these properties and learn how to estimate the variance of a dataset, look [[http:// | ||
| + | |||
| + | There is an inconvenience in expressing the variability with squared deviations: the unit of variance is the square of the original units. If the mean is expressed in centimeters, | ||
| + | |||
| + | === Cute, but how do I apply this?=== | ||
| + | |||
| + | The expression above for the variance is a theoretical definition. In practice, we often don't know the theoretical expectations - but we can estimate them from a data set. If we suppose these data are a representative sample of the process we want to represent, in a sample of n measures we can estimate the variance as: | ||
| + | |||
| + | s2 = n∑i=1(xi−ˉx)2n−1 | ||
| + | |||
| + | Here ˉx is the estimator for the mean | ||
| + | |||
| + | ˉx = 1nn∑i=1xi | ||
| + | |||
| + | And n is the sample size (or the number of measures). The standard deviation is estimated as the square root of s2: | ||
| + | |||
| + | s = √n∑i=1(xi−ˉx)2n−1 | ||
| + | |||
| + | ===Standard deviation of the population projections=== | ||
| + | |||
| + | With this knowledge, we can assess how our population growth model with environmental stochasticity varies over time. Let's use the projections made in our last simulation, that should be still on the memory. To create a graph of the average and standard deviation as a function of time, copy and run the following commands in R: | ||
| + | |||
| + | < | ||
| + | ## computes the standard deviation for each time step | ||
| + | devs <- apply(sim1b, | ||
| + | ## Plots the means... | ||
| + | plot(0: | ||
| + | ## And superposes the standard deviations | ||
| + | points(0: | ||
| + | ## Adds a legend | ||
| + | legend(" | ||
| + | pch=c(1, | ||
| + | </ | ||
| + | |||
| + | The standard deviation also growths exponentially over time!! The growth can be even faster than the mean population growth, as happens with the simulation we used here. | ||
| + | |||
| + | Looking at the standard deviation as a measure of our uncertainties, | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Notice that the amplitude of the projections opens up like a funnel as time passes. That happens because the trajectories diverge with the multiplication of the variable rates, even with populations that started out with the same number of individuals. | ||
| + | |||
| + | ====== Extinction risk ====== | ||
| + | The variance and standard deviation are averages (of the deviation), and as such, may not fully characterize the structure of the data variability. Consider these two sets((these data are part of a group of datasets create by the statistician Francis Anscombe to illustrate some pitfalls of statistical measures. See more [[http:// | ||
| + | |||
| + | ^Set A^^^^^^^^^^^^ | ||
| + | |4|5|6|7|8|9|10|11|12|13|14|15| | ||
| + | |||
| + | ^set B^^^^^^^^^^^^ | ||
| + | |8|8|8|8|8|8|8|8|8|8|8|19| | ||
| + | |||
| + | For both sets, the mean is 9 and the variance is exactly 11. What eludes the statistical measures is the distribution of values around the mean, which is more // | ||
| + | |||
| + | Now look again at the population projection graphs from the last section and assess the symmetry of the distribution of values in respect to the mean, represented by the black line. To help you, the following R code makes histograms of the projections on times 5, 10, 20 and 30: | ||
| + | |||
| + | < | ||
| + | ## maximum value (to set the scale of the histogram) | ||
| + | sim1b.m <- (max(sim1b[c(6, | ||
| + | ## creates a new window with 4 graphs | ||
| + | par(mfrow=c(2, | ||
| + | ## creates the histograms | ||
| + | hist(sim1b[6, | ||
| + | breaks=seq(0, | ||
| + | hist(sim1b[11, | ||
| + | breaks=seq(0, | ||
| + | hist(sim1b[21, | ||
| + | breaks=seq(0, | ||
| + | hist(sim1b[31, | ||
| + | breaks=seq(0, | ||
| + | ## Returns the original parameters | ||
| + | par(mfrow=c(1, | ||
| + | </ | ||
| + | |||
| + | The projection distributions become more and more asymmetric as time passes. This happens because a few populations grow a lot, while most stay at small sizes. Depending on the mean and variance of the growth rate, several populations may even become smaller than the starting population size. | ||
| + | |||
| + | Even with a mean growth rate bigger than 1 (ˉλ>1), | ||
| + | |||
| + | Simulate with the folowing parameters: | ||
| + | |||
| + | < | ||
| + | # salve the results in an R object:' | ||
| + | tmax = 51 | ||
| + | npop = 1000 | ||
| + | N0 = 10 | ||
| + | lambda = 1.05 | ||
| + | varr = 0.2 | ||
| + | ext = FALSE | ||
| + | </ | ||
| + | |||
| + | The results will be stored on the R memory, in a new object called sim2. We can now figure out the proportion of the 1000 simulated populations that reached a higher size than N0=10 for every time step. To do this, copy the following commands in the '' | ||
| + | |||
| + | < | ||
| + | greaterN0 <- apply(sim2[, | ||
| + | function(x)sum(x> | ||
| + | plot(sim2[-1, | ||
| + | ylab=" | ||
| + | </ | ||
| + | |||
| + | The proportion of projections greater than N0 falls with passing time. This shows that the probability of a population to grow gets smaller, even if on average there is growth 8-O. | ||
| + | |||
| + | This seeming paradox can be explained by the strong asymmetry of the distributions: | ||
| + | |||
| + | ==Question== | ||
| + | |||
| + | Let's define a minimum population size, Nmin, under which we consider that the population is extinct((in other words: Nt<Nmin⟹Nt=0)). In the options window, the option '' | ||
| + | |||
| + | - What is the effect of environmental stochasticity on the extinction probability? | ||
| + | - For a fixed level of stochasticity, | ||
| + | - What is the consequence of these results to the conservation of endangered populations? | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | A good estimate of a probability of an event is the frequency in which it occurs after a large number of trials. So, use a large number of populations in our simulations. In some cases the graph may become very crowded with lines, but the number of extinctions is always below the X axis. | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== To learn more ====== | ||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||