Navigation Bar (see also links at bottom of page) Home Page Contacts News SiteIndex Training Support Prices Research Software

 

Frequently Asked Questions:
RAMAS Stage

 

Mountain StreamHow do I...?

Miscellaneous

RAMAS Stage is misbehaving


 

Q. How much data do I need to use RAMAS Stage?

        You can often get a rough idea of a population's future if you know something about its reproduction, migration, survival, and current size. RAMAS Stage will be most useful if you have structured information about them for different age, size, or stage classes. If you know something about the variability in the vital rates, then RAMAS Stage can estimate risks of population decline and chances of recovery. It is often the case that a single literature paper of the demography of a species will be sufficient to make reasonable guesses about the model structure and most of the parameter values.

Q. What's so bad about lambda?

        Well, it's not bad exactly; it's just that it's a poor summary of a population's robustness. It's well known that lambda is derived from a linearized model of population growth. That means that it cannot reflect any density dependence that may be present in your model. What's more, it cannot reflect the stochasticity of any of the vital rates. As a consequence, lambda cannot reliably predict the long-term population dynamics because it ignores density dependence and stochasticity which have a dominating influence on the long term dynamics.

        Several people have suggested that lambda is like a speedometer in the sense that it gives a good summary of the current state of the population's growth or decline. This is wrong however, because lambda doesn't really give you a good prediction of the short-term dynamics either, unless the initial abundance distribution is close to stable structure and the effect of stochasticity is moderately small. If you really want to know what's going to happen to the population, you're probably much better off focusing on the risk of decline, the persistence time, or the chance of recovery. RAMAS Stage computes all of these summaries (as well as lambda) very conveniently for you.

Q. Why don't I get positive integers for population sizes?

        If you have negative values for abundances your model of mortality or migration probably subtracts more individuals than were in the population to begin with. The POS and PRO functions will be useful in preventing this. If you have fractional abundances, you probably haven't fully modeled demographic stochasticity.

Q. How do I model demographic stochasticity?

        Many population modelers assume demographic stochasticity is negligible unless the population is smaller than twenty or so individuals. This is not always true however, and it is often worthwhile to pay careful attention to this issue.

        In modeling demographic stochasticity, there are several things to keep in mind. First, be sure to start with initial abundances for all the stages that are integers. You can't have 0.4 of an individual. Second, make sure that you treat survivorship as a random process at the level of each individual. You can use the BIN function to do this. Wherever you might multiply the population size and a survival rate, instead use a function such as

bin( [survival], [population] )

where survival represents the survival rate and population represents the population size. The BIN function return a random integral deviate selected from a binomial distribution. This function yields the number from the original population that survive if each individual has the stated probability of surviving. For instance, if there are 25 individuals in a stage and their survival rate is 0.3, the expression bin(0.3,25) will yield random integers between 0 and 25, the bulk of which are between 5 and 9. The mean of the number of survivors is 7.5, which of course is 0.3 times 25. Transitions among stages and migration out of the population can also be handled with the BIN function in a similar way.

        You also need to ensure that the numbers entering the population by reproduction are in integer units too. The POI function is often useful for this purpose. It produces integral random deviates from the Poisson distribution which is often a good model of reproduction. For instance, the number of recruits may be computed as

poi( [mothers] * [fecundity] )

where mothers is the number of reproductive individuals and fecundity is their annual rate of reproduction. If there are 10 mothers and their fecundity is 0.25, the POI function will yield integers like 0, 1, 2, 3, 4..., whose mean value is 10*0.25=2.5.

        Finally, even if you correctly account for demographic stochasticity, and every trajectory consists of integer numbers, remember that the trajectory summary result will average the values from different trajectories and can yield a non-integral number. Set the number of replications to one to check that only integers are produced. Just be sure to reset it to a big number when you're done though. Monte Carlo simulation requires lots of runs.

Q. Can I model males and females separately?

        Yes, it's just more cumbersome. You can keep separate stages for males and females of each developmental class. Reproduction will generally be limited by mating so you would probably want to introduce some parameter of the form

min( [maturemales] , [maturefemales] )

to represent the number of breeding pairs. If there is a harem or lek structure, then you might add a multiplier to one of the arguments.

Q. How do I do Bierzychudek-style matrix-selection modeling?

        The first thing to do is set up a driver variable that will be used to select which matrix will be used in a particular time step. Suppose its name is CHOOSE. It should be a uniform distribution with both mean and variance set to 1. Once each time step a random deviate for this driver will be generated. When the value of CHOOSE is one or greater, we'll be using one matrix and when it's less we'll use the other. We can effect this by replacing every nonzero element in the transition matrix with a function like

if1( [CHOOSE], A, B )

where A is the matrix element in the first matrix and B is the element in the second matrix. The IF1 function returns the second parameter as its value if its first parameter is one or larger and the third parameter otherwise. If the two matrices have uneven probabilities, modify the mean of the driver CHOOSE.

Q. How can I model catastrophes?

        You can model catastrophes in a variety of ways. For instance, suppose you want to model an event that on average happens four times in a century. This means it has a 4% chance of happening in any given year. Define a new driver called, say, catastrophe, whose distribution is uniform on [0,1]. Then for each variable whose value you want to change under the catastrophe, introduce a parameter whose value is

if1( [catastrophe]+0.04, catXXXX, normalXXXX )

where 0.04 is the probability that a catastrophe occurs in a single time step, catXXXX is the new value you want it to take on during a catastrophe, normalXXXX is the ordinary value it should take on at all other times. The IF1 function returns the second parameter as its value if its first parameter is one or larger and the third parameter otherwise.

Q. How can I model cross-correlations among vital rates?

        You can always construct the vital rates in a way the incorporates the dependencies among them by defining them in terms of intermediate parameters that depend on the driver variables (which are themselves truely independent of one another).

        It's more often convenient to model the cross-correlations among vital rates as perfect correlation. The variation in population trajectories is largest when the correlation among vital rates is the greatest possible. Therefore, using perfect correlation allows you to make conservative estimates of extinction risks and time to extinction.

        It is very easy to make variables with perfect correlation. For instance, suppose we have a three-stage model (juveniles, subadults, and adults) and want to use normal distributions to represent fecundities of the two older stages. Make a driver variable with the name RNORM and give it a mean of zero and a variance of one. Then define two parameters

pos( SAfecmean + SAfecsd * [RNORM] )

pos( Afecmean + Afecsd * [RNORM] )

where SAfecmean and SAfecsd are the mean and standard deviation respectively for subadult fecundity, and Afecmean and Afecsd are the corresponding values for adult fecundity. These two parameters have the appropriate distributions, means and variances for fecundities of the two reproductive stages and are perfectly correlated.

Q. How can I represent unique events during the simulated time period?

        The artful use of the if1, del and tim functions will allow you to model something that happens only once at a particular time step during the simulation. For instance, suppose your simulation has 20 annual time steps and the unique event should occur at year 12. The expression

if1( del(12 - tim), [specialvalue], [normalvalue] )

will yield the special value in the twelfth year of the simulation, and the normal value in all other years. This kind of expression would be useful for studying the impact of some special event such as the recovery from a planned harvest or culling of a unusual size.

Q. How can I estimate lifespan?

        Strictly speaking, life span may not be defined for a stage-structured model. You see, a stage can be composed of individuals of different ages and each age class can be sprinkled over several stages. This is, in fact, the whole idea behind stages in the first place. Unless you went to an individual-based or at least an age and stage model such as Law (1983) suggested, it's not always clear that the information you need to make such age-based estimates exists within the modeling framework you've designed. Caswell (1989, p. 110ff) points out that several age-based statistics can be computed from a stage-based model so long as there is at least one stage though which all individuals must pass (such as a seed stage).

        The average life span of an individual is calculable as the mean length of all the different pathways (i.e., sequence of stage memberships) an individual might take in its life, weighted by the chance that it actually takes that path. When the model has self-loops (non-zero diagnonals), an individual could in principle stay forever in that stage and never die. So long as every diagonal is smaller than one, however, the chance of staying forever in a stage is sufficiently small that the average life span will converge to a finite expectation.

        You can estimate life span by doing the following simulation within RAMAS Stage. Set all the initial abundances to zero except for a single individual in the newborn or seed stage. Set the number of iterations to a big number like 1000. Remove all reproduction from the transition matrix, so it is composed of pure survival rates (which must have column sums less than one). Make a tally of all the stages and set its low threshold to zero (or a tiny number if you're not modeling demographic stochasticity). Run a simulation for a number of time steps much longer than you expect the life span to be and examine the time to quasi-extinction for the tally. The value at the 0.5 frequency is the median life span.

        If you're modeling demographic stochasticity, each of these survival rates will be a binomial function with the number of trials equal to one and probability equal to the survival rate. So, if survival rate is sij, use in its stead the expression bin(sij,1).

Q. How can I erase all the parameters of the model?

        Load the file CLEAR.STG.

        If this file is missing, corrupted, or contains parameters of a model, then quit RAMAS Stage, and delete the file STAGE.FN, and invoke RAMAS Stage again. This time there should be no parameters. Save this empty file as CLEAR.STG.

Q. Why can't I see risk results?

        The risk results are only available if there is stochasticity (noise or randomness) in the population dynamics. If the vital rates are constant probabilities, the population trajectories will all be the same and will show no variation. If the risk curves are vertical lines, this means that there is no variation or virtually no variation in the results.

        If you're sure that you have incorporated stochasticity into the model, check whether the density dependence may have erased the variability.

Q. In the network diagram, why is there an arrow coming in from the upper, left-hand corner to a stage?

        The arrows represent the influences on the stage's abundance. If the stage's replacement function refers to an undefined driver, parameter or stage, the network graph will indicate the error by drawing an arrow `from nowhere'. Check the replacement function for that stage and correct the reference.

        If you have a very complex model with recursive definitions and long variable names, RAMAS Stage can sometimes get confused and might draw an arrow from the corner even though everything is well defined. Shortening the names of things will fix the problem.

Q. The RAMAS Stage program crashed. What happened?

        RAMAS Stage most often crashes because of an exponential growth model that yields an exploding population. When such models are run for a long period of time, they imply Carl Sagan-esque numbers of individuals that eventually overflow the computer's ability to count that high. Try setting the duration of the simulation to one or two time steps and look at how the abundance is changing. Reducing fecundity or survival rates can moderate the exponential growth, but usually some form of density dependence is required to keep it in check over long periods of time.

        We could have written RAMAS Stage so that it intercepted such conditions and prevented program crashes, but this would have involved making many calculation checks at every step of the simulation and would have made the program run much more slowly.

Q. RAMAS Stage ran out of memory when trying to run. What should I do?

        You can reduce the memory requirements by decreasing the number of tallies, shortening the duration of the simulation, making the frequency of tallies a larger number, or reducing the number of replications.

Q. Why does it beep at me when entering the replacement function?

        It doesn't understand what you're trying to say. Did you remember put brackets (either [] or {}) around all driver, stage and parameter names? Are they spelled correctly? Do the stages you're trying to reference exist yet? It's best to name all the stages first (just enter the name, press F5, and repeat) and then go back and enter their replacement functions.

Q. Why won't it save the model to a disk file?

        Make sure you're using a valid filename and that the disk has enough room for the file. DOS only allows 8 characters in the filename and 3 characters in the extension.

Q. Why is my population dying?

Populations generally decline because (i) reproduction is too little, (ii) mortality is too large. Sometimes a decline could be due to (iii) emigration overwhelming immigration.

        If a deterministic model exhibits balanced population dynamics and a constant population size over time, adding stochasticity (noise) to the vital rates will result in a declining population. This is a general property of the multiplicative nature of population dynamics.

Q. Why is my population exploding?

        Populations explode because reproduction is too large compared to the mortality and emigration rates. You may need to introduce density dependence to restrain the growth. It often helps to reduce the duration on the General window (the number of time steps the simulation is run).

Q. What is the order of evaluation in RAMAS Stage?

        You generally don't have to worry about the order in which stage abundances are evaluated. In the replacement functions, a stage name inside of square brackets always refers to its abundance in the previous time step. This means you can update the stages in any order you like and get the correct results.

        However, there can be special circumstances in which the order of evaluation may be important. RAMAS Stage uses the following sequence.

  1. Initialize stage abundances
  2. Set indexes of summary arrays to starting positions
  3. For every summary, initialize variables to remember the smallest and largest values observed along the trajectory
  4. For time from 1 to duration
    Repeat
    1. Update the drivers (from first to last)
    2. Update the parameters (from first to last)
    3. Update the stages (from first to last)
    4. Let the clock tick to the next time step
    5. Update the tallies (from first to last)

Q. What other functions are available?

        There are a few undocumented functions that can be used in replacement expressions in RAMAS Stage. They're undocumented because they probably shouldn't be used in most population models. Nevertheless they can be useful for special purposes.

if1(a,b,c)
returns b if a>=1 and c otherwise
ifn(a,b,c)
returns b if a<1 and c otherwise
tle(a,b,c,d)
returns c if a<=b and d otherwise
tge(a,b,c,d)
returns c if a>=b and d otherwise
del(a)
returns 1 if a=0 and 0 otherwise
tol(a)
returns 1 if abs(a)<1e-6 and 0 otherwise
sgn(a)
returns 1 if a>=0 and -1 otherwise
tim
returns the current time step
fix(a)
evaluates and returns its argument at the beginning of a trajectory, but returns the same value for each time step thereafter
rsd(a)
sets the random number seed used by RAMAS/stage to one of 52 fixed seeds, or if its argument is zero, restores the original random number seed
ssd
returns the value of the random number seed

Q. How can I get the numerical values of stable distribution and the reproductive value vectors?

        Use a text editor such as EDIT (that comes with DOS) to add the following line at the end of the file STAGE.CFG

ECHO=LIST

        This will cause the analysis results to be directed to the listing specified in the Output window. If listing is specified as CON, the numbers will be displayed on the screen, it is PRN, then they will be printed to the attached printer, otherwise they will be saved in the specified file.

        We made this a bit cumbersome to do to remind you that the numerical values in the stable stage and reproductive value distributions are very rarely of interest because they take no account of any stochasticity or density dependence in the model.

        To revert to displaying the analysis results as graphs, delete the line you added to STAGE.CFG, or change it to

::ECHO=LIST

Q. How do I reference RAMAS Stage?

        The suggested citation to RAMAS Stage software or documentation is:

Ferson, S. 1993. RAMAS Stage: generalized stage-based modeling for population dynamics. Applied Biomathematics, Setauket, NY.

We'd appreciate receiving preprints or reports of any applications you make with the software. Please send them to Scott Ferson, Applied Biomathematics, 100 North Country Road, Setauket, NY 11733 USA.


 

Return to RAMAS Stage description

Return to Technical support


  Top of Page
Software · Prices · Training · What's New · Forum
  Research · Support · Index · Contact Us · Home
   
©1999 by Applied Biomathematics

webmaster@ramas.com
Date modified: 3-27-00