[R-sig-eco] stochastic annual survival rate
Ben Bolker
bbolker at gmail.com
Sat Nov 12 02:38:45 CET 2011
FrogWave <thefrenchstick at ...> writes:
> I want to simulate the trajectories over time of animal populations for
> which I know the annual survival rate, S, estimated in the field from
> several years of data. I want to look at the effect of various levels of
> environmental stochasticity, defined as independent year-to-year variations
> in the survival rate. What I did is to add a normally distributed random
> variable of mean 0 to the logit of S, and back-transformed (see below), but
> I realised than doing so leads to a lower geometric mean (i.e. the annual
> survival rate) and that the difference increases with the level of
> stochasticity . So how can I include stochasticity without changing the
> geometric mean? Any insight would be very appreciated.
>
> logit <- function(x)
> return( log( x / (1-x) ))
> invlogit <- function(x)
> return( exp(x) / (1 + exp(x)))
>
> S = 0.92 # annual survival rate
> sdS = 0.4 # standard error of S on the logit scale
> nS = 100000 # number of samples
> Svar = invlogit( logit(S) + rnorm(nS, 0, sdS)) # stochastic survival rate
>
> gmeanS = exp( mean( log(Svar) )) # geometric mean of S
> gmeanS # geometric mean of stochastic survival rate less than 0.92...
It's not possible, I think. You can try to *correct* for it
(i.e., for a specified variance and a desired geometric mean,
increase the arithmetic mean), but you can't include stochasticity
without changing the GM -- it's a fact of life (or mathematics).
For the log-normal equivalent, it's fairly easy to do this analytically.
For a geometric mean of exp(logmu) and a standard deviation on
the log scale of sdS, the arithmetic mean of the log-normal is
AM = exp(logmu+sdS^2/2). The mode and the median of the log-normal
are unchanged by transformation (and by noise). Hence I think you
can get what you want in the LN case by increasing your logmu by
sdS^2/2 (this is a little fuzzy, it's late, there may be an error,
but I'm going to send it off anyway).
For the logit-normal I'm not sure whether there's an equivalent
analytical trick.
Ben Bolker
More information about the R-sig-ecology
mailing list