User Tools

Site Tools


en:ecovirt:roteiro:den_ind:di_tdr_passo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:ecovirt:roteiro:den_ind:di_tdr_passo [2022/09/15 13:54]
adalardo [Média do Crescimento Populacional]
en:ecovirt:roteiro:den_ind:di_tdr_passo [2022/09/15 13:59] (current)
adalardo [Desafio]
Line 115: Line 115:
  
 The graph represents the singing sparrow count in the city of Darrtown, OH, USA. The graph represents the singing sparrow count in the city of Darrtown, OH, USA.
-Download the data from the file {{pardal.txt|}} on your computer.+Download the data from the file {{:​ecovirt:​roteiro:​den_ind:​pardal.txt|}} on your computer.
 </​box>​ </​box>​
  
Line 145: Line 145:
 </​code>​ </​code>​
   * Which of the two means seems to fit the observed data better? Why?   * Which of the two means seems to fit the observed data better? Why?
-==== Crescimento Discreto ​====+==== Discrete Time Growth ​====
  
-Abaixo tem o código de uma função ​base para projeção do crescimento de uma populaçãoque pode ser usada como estrutura básica para outras funções que iremos desenvolver no cursoNo casoé uma funcão com argumentosnúmero de indivíduos no tempo 0 (N0), taxa de crescimento populacional ​(lamb) ​e o tempo máximo ​(tmax) ​de projeção da população +Below is the code of a base function for projecting the growth of populationwhich can be used as a basic structure for other functions that we will develop in the courseIn this caseit is a function with argumentsnumber of individuals at time 0 (N0), population growth rate (lamb) ​and maximum time (tmax) ​of population projection.
 <​code>​ <​code>​
 cresc.geom= function(No=100,​ lamb=1.04, tmax=10) cresc.geom= function(No=100,​ lamb=1.04, tmax=10)
 { {
-resulta ​<- rep(NA,​tmax) +result ​<- rep(NA,​tmax) 
-resulta[1] <- No +result[1] <- No 
- for (i in 2:tmax) +for (i in 2:tmax) 
-+
- tam=resulta[i-1]*lamb +tam=result[i-1]*lamb 
- resulta[i]=tam +result[i]=tam 
-+
-return(resulta)+return(result)
 } }
  
 </​code>​ </​code>​
-Ao copiar esse código na  área de trabalho do R, um novo objeto é criadode nome //​cresc.geom//​. ​Ele é um objeto da classe função que você pode usá-lo digitando o seu nome e especificando seus argumentoscomo no exemplo a seguir:+By copying this code to the desktopa new object is creatednamed //​cresc.geom//​. ​It is an object of the function class that you can use it by typing its name and specifying its argumentsas in the following example:
  
-<​code>​  +<​code>​ 
-resultado ​<- cresc.geom(No=10,​ lamb=0.98, tmax=100)+result ​<- cresc.geom(No=10,​ lamb=0.98, tmax=100)
 </​code>​ </​code>​
  
-Note que o resultado da funçãonesse casoserá guardado no objeto ​//resultado//. Para fazer um gráfico dos resultados pode utilizar o código abaixo:+Note that the result of the functionin this casewill be stored in the object ​//result//. To graph the results you can use the code below:
  
-  plot(1:​length(resultado), resultado  +  plot(1:​length(result), result
- +===== Environmental Stochasticity ​===== 
- +Environmental fluctuations can have an effect on the instantaneous population growth rateIn a simple waywe can imagine that this variation works like a noise in //​r//, ​as if the population on average had ratebut at each realization it could be somewhat different due to conditions external to itself. The implementation of this environmental stochasticity in continuous models is little more complicatedbut we can imagine it as realizations in some small time interval
- +For discrete growth, the construction of simulations with environmental stochasticity is more intuitiveat each realization the Lambda ​is affected by the environmental variationLet's do it.
-===== Estocasticidade Ambiental ​===== +
-Flutuações ambientais podem exercer efeito na taxa de crescimento instantâneo da populaçãoDe uma forma simplespodemos imaginar que essa variação funcione como um ruído no //​r//, ​como se população em média tivesse uma taxamas cada realização ela pudesse ser um tanto diferente devido a condições externas a ela própria. A implementação dessa estocasticidade ambiental em modelos contínuos é um pouco mais complicadamas podemos imaginá-la como realizações em algum intervalo pequeno de tempo.  +
-Para um crescimento discreto ​construção de simulações com estocasticidade ambiental é mais intuitivoa cada realização o Lambda ​é afetado pela variação ambientalVamos fazê-la.+
  
 <​code>​ <​code>​
Line 194: Line 191:
 matplot(0:​5,​ Nt, type="​l",​ lty=2:7) matplot(0:​5,​ Nt, type="​l",​ lty=2:7)
 </​code>​ </​code>​
 +==== Challenge ====
  
-==== Desafio ====+It is possible to adapt our previous discrete growth function so that it can also model populations with environmental stochasticity!
  
-É possível adaptar a nossas função anterior de crescimento discreto para que possa também modelar populações com estocasticidade ambiental! +<box 70% green |Tips
- +The first step is always to think about what arguments we will need 
-<box 70% green |Dicas+In this casewe only have one more argument ​o **//​lamb.dp//​** : the standard deviation of //​lambda//​. ​The rest remains the sameremember that if **//​lamb.dp//​** ​is 0, our population is deterministicThat isthe same function can be used to simulate both scenarios.
-O primeiro passo sempre e pensar quais argumentos vamos precisar +
-Nesse casotemos apenas mais um argumento ​o **//​lamb.dp//​** : o desvio padrão de //​lambda//​. ​O resto continua o mesmolembre-se que se o **//​lamb.dp//​** ​for 0, nosso população é determinísticaOu sejaa mesma função pode se prestar para simular ambos cenários.+
  
  
 </​box>​ </​box>​
  
-{{tag>​R ​uma_população crescimento_exponencial tempo_discreto tempo_contínuo ​ estocasticidade_ambiental}}+{{tag>​R ​a_population exponential_growth discrete_time continuous_time stochasticity_environmental}} 
en/ecovirt/roteiro/den_ind/di_tdr_passo.1663260870.txt.gz · Last modified: 2022/09/15 13:54 by adalardo