Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Source file: http://ctfs.si.edu/ctfsdev/CTFSRPackageNew/files/tutorials/abundFitModelFluctuation in Abundance of Tree Species
Population Changes
FLUCTUATION IN ABUNDANCE OF TREE SPECIES
R. CONDIT
Date: August 13, 2012.
The question addressed here is how much abundances of all the tree species in a plotfluctuate from census to census. At one extreme, abundances are stabilized, and populations do notchange. In contrast, there may be environmental drivers favoring some species and not others, so that somespecies show marked (ie, more than neutral) increases and others decreases. In between the two extremes isa community in which no external drivers affect abundances but populations fluctuate due to demographicstochasticity: a neutral forest.
The test of these models hinges on a histogram of the rate of population change of every species in theforest. Define λ =, the ratio of a future population N1to the current N0, and r = little.r =logλ.In a highly stabilized community, λ ≈ 1 for every species, and r = 0, whereas in a forest withenvironmental fluctionas, λ may be distributed widely but ought to be centered close to 1.The neutral community would fall in between, with λ varying a small amount due to chancealone.
The distribution of λ and r under neutrality can be predicted mathematically, assumingdeaths are binomially distributed across individuals and a Poisson distribution of births whosemean matches the death rate. Because of this statistical model of neutral fluctuations, anyenvironmentally caused variation can be estimated precisely. In a conceptual sense, it meanssubtracting the predicted neutral variance of λ from the observed variance of λ; what’s left is theenvironmental variances. The neutral prediction depends on the mortality rate, which is also fitted bythe model. The following demonstrates an R program for running this model with forest plotabundances.
The model allows various functional forms for the distribution of population growth. The example belowis based on a power probability distribution, where p(x) ∼x + 1k(k < −1). The exponent k describes howbroad the distribution, with more extreme k (ie, more negative) meaning a narrower distribution. Indeed,frac1k is close to the standard deviation of the distribution of r. The power distribution, though, allows kon the negative size of x to differ from k for x positive. It is thus an asymmetric power distribution.
1. Formatting data
The calculations start with the full plot dataframes described athttp://ctfs.arnarb.harvard.edu/Public/CTFSRPackage/help/RoutputFull.pdf. The BCI data canbe downloaded from http://ctfs.arnarb.harvard.edu/bci/RAnalyticalTablesafter filling out therequest form http://ctfs.arnarb.harvard.edu/webatlas/datasets/bci/. Assume for the followingexample that dataframes for three censues are loaded, bci.full1, bci.full2, and bci.full3. A species table,such as bci.spptable, is also needed. The species table has a column IDlevel that indicateswhich taxa are neither valid species nor valid morphospecies – cases where a species codeincludes a mixture of unknown species. The typical example of these mixtures are unidentifiedtrees, with codes such as UNID or uniden. They must be excluded from the analysis, sincechanges in abundance of those species codes do not represent population fluctuations of aspecies.
[1] 4 3 2
> head(bci.full1)
treeID stemID tag StemTag sp quadrat gx gy MeasureID CensusID dbh pom hom ExactDate DFstatus codes nostems date status agb 1 1 1 -05599 swars1 4007 800.2 152.2 1 1 90 1.3 1.3 1981-06-12 alive <NA> 1 7833.000 A 0.0426371077 2 2 1 -22851 hybapr 0718 151.5 378.8 2 1 35 1.3 1.3 1982-07-01 alive L 1 8217.000 A 0.0028894861 3 3 1 -24362 aegipa 0417 95.2 357.5 3 1 10 1.3 1.3 1982-07-02 alive <NA> 1 8218.000 A 0.0001466688 4 4 NA -26589 <NA> beilpe 0007 11.7 151.1 NA NA NA <NA> NA <NA> prior <NA> NA 8237.215 P 0.0000000000 5 5 NA -26590 <NA> faraoc 0004 7.7 96.2 NA NA NA <NA> NA <NA> prior <NA> NA 8233.467 P 0.0000000000 6 6 NA -26703 <NA> hybapr 0210 50.1 215.4 NA NA NA <NA> NA <NA> prior <NA> NA 8234.400 P 0.0000000000
> head(bci.full2)
treeID stemID tag StemTag sp quadrat gx gy MeasureID CensusID dbh pom hom ExactDate DFstatus codes nostems date status agb 1 1 1 -05599 swars1 4007 800.2 152.2 1 2 94 1.3 1.3 1985-06-28 alive Z 1 9310 A 0.0478479558 2 2 1 -22851 hybapr 0718 151.5 378.8 2 2 NA <NA> NA 1985-03-06 dead D,MC 1 9196 D 0.0000000000 3 3 1 -24362 aegipa 0417 95.2 357.5 3 2 15 1.3 1.3 1985-02-06 alive <NA> 1 9168 A 0.0003618661 4 4 1 -26589 beilpe 0007 11.7 151.1 4 2 10 1.3 1.3 1985-01-11 alive Z 1 9142 A 0.0001132402 5 5 1 -26590 faraoc 0004 7.7 96.2 5 2 10 1.3 1.3 1985-01-08 alive Z 1 9139 A 0.0001313070 6 6 1 -26703 hybapr 0210 50.1 215.4 6 2 10 1.3 1.3 1985-01-23 alive Z 1 9154 A 0.0001496468
> head(bci.full3)
treeID stemID tag StemTag sp quadrat gx gy MeasureID CensusID dbh pom hom ExactDate DFstatus codes nostems date status agb 1 1 1 -05599 swars1 4007 800.2 152.2 1 3 NA <NA> NA 1990-10-20 dead D,N 1 11250 D 0 2 2 NA -22851 <NA> hybapr 0718 151.5 378.8 NA NA NA <NA> NA <NA> dead <NA> NA 11135 D 0 3 3 1 -24362 aegipa 0417 95.2 357.5 2 3 NA <NA> NA 1990-04-06 dead D,N 1 11053 D 0 4 4 1 -26589 beilpe 0007 11.7 151.1 3 3 NA <NA> NA 1990-02-23 dead D,N 1 11011 D 0 5 5 1 -26590 faraoc 0004 7.7 96.2 4 3 NA <NA> NA 1990-02-16 dead D,N 1 11004 D 0 6 6 1 -26703 hybapr 0210 50.1 215.4 5 3 NA <NA> NA 1990-03-07 dead D,N 1 11023 D 0
> head(bci.spptable)
sp Latin Genus Species Family speciesID authority IDlevel syn subsp acac1 acac1 Acacia sp.1 Acacia sp.1 Fabaceae-mimosoideae 5 genus <NA> acacme acacme Acacia melanoceras Acacia melanoceras Fabaceae-mimosoideae 4 Beurl. species <NA> acacri acacri Acacia riparia Acacia riparia Fabaceae-mimosoideae 1192 Kunth species <NA> acaldi acaldi Acalypha diversifolia Acalypha diversifolia Euphorbiaceae 6 Jacq. species <NA> acalma acalma Acalypha macrostachya Acalypha macrostachya Euphorbiaceae 7 Jacq. species <NA> ade1tr ade1tr Adelia triloba Adelia triloba Euphorbiaceae 12 (Müll.Arg.) Hemsl. species <NA>
2. Running the model of environmental variance
A function in the CTFSRPackage (topic population change) called model.littleR.Gibbs runs the model toestimate leftover environmental variance over two census intervals. To run with your own data,simply replace census1 and census2 with your own R Analytical Tables for a CTFS plot. Thefitting procedure requires a Bayesian parameter-search, which must run at least 1000 steps. Irecommend here running the model once for 1200 steps, as in the example below in order to exploreresults. In order to get really solid parameter estimates, a run of 10,000 steps should be set.Ddepending on your computer, 1000 steps should take about 3 minutes and 10,000 steps 30 minutes.Note that mindbh needs to be set. The example below assumes dbh is in mm, and is set to10.
The result, saved object as mod, is a Bayesian model object including the estimated parameters and theirconfidence, plus the complete parameter search. The element of the list mean has the fitted parameters.The first two describe the estimated distribution of mortality rates:
hyperMu = mean of the log(mortality) rate across species;
hyperSD = standard deviation of the log(mortality) rate across species.
The next three parameters describe the distribution of population growth rates, as defined byr =logλ:
hyperR = mean of r across species, generally very close to 0;
hyperSDlow = inverse of the exponent of the power distribution for x < 0; its negative issimilar in magnitude to the median population population change of those species decliningin abundance;
hyperSDup = IBID for the positive half of x; its negative is similar in magnitude to themedian population population change of those species increasing in abundance.
Upper and lower confidence limits for the five parameters are returned in the components upper andlower.
There is another function in the same topic of the CTFSRPackage called graph.abundmodelthat creates a graphical view of the fitted model. Pass it the name of the model object andnothing more and it will show a histogram of observed rates of population change r (open circlesfor all species, blue circles for abundant species), along with the fit to the histogram (greenline).
The green curve is the estimated variation in in abundance due to the environment: what is left overafter stochastic demography is accounted for. The points, which give the observed histogram, includestochastic plus environmental, thus should be broader than the green curve.
The x-limits of the graph can be adjusted using the argument xrange. In addition, confidence limits canbe added by setting conf=50, or any other positive number (the number of lines to draw). The confidencelines are based on all the steps in the Bayesian sampling and reflect confidence in the fittedmodel.
There is a wrapper function fitSeveralAbundModel that can handle any number of census datasets. Itsimply fits the abundance model for each pair of censuses, then for the first and last census, saving all intoone big list, plus it repeats all the models for larger trees, setting mindbh to 10 times the submitted value.It’s only purpose is to finish a series of models from one plot in a single model run. Since it takes about 30minutes per census, you might leave it running overnight. The following code saves the results to an R dataobject in the folder abunddist.