Description Usage Arguments Value Author(s) Source References Examples

View source: R/stoch.projection.R

Simulates stochastic growth by projection using whole matrix selection techniques in an independently and identically distributed (iid) environment from a set of 2 or more projection matrices

1 2 |

`matrices` |
a |

`n0` |
initial population vector |

`tmax` |
number of time steps or projection intervals to predict future population size |

`nreps` |
number of iterations |

`prob` |
a vector of probability weights used by |

`nmax` |
a maximum number of individuals beyond which population projections cannot exceed. Default is no density dependence |

`sumweight` |
A vector of ones and zeros used to omit stage classes when checking density threshold. Default is to sum across all stage classes |

`verbose` |
Print comments at start of iteration 1, 100, 200, 300, etc. |

A matrix listing final population sizes by stage class with one iteration per row.

Chris Stubben

converted Matlab code from Box 7.3 in Morris and Doak (2002) with nmax option added to introduce simple density dependence

Morris, W. F., and D. F. Doak. 2002. Quantitative conservation biology: Theory and practice of population viability analysis. Sinauer, Sunderland, Massachusetts, USA.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ```
data(hudsonia)
n<-c(4264, 3,30,16,25,5)
names(n)<-c("seed", "seedlings", "tiny", "small", "medium" , "large")
### use equal and unequal probabilities for matrix selection
x.eq<-stoch.projection(hudsonia, n, nreps=1000)
x.uneq<-stoch.projection(hudsonia, n, nreps=1000, prob=c(.2,.2,.2,.4))
hist(apply(x.eq, 1, sum), xlim=c(0,5000), ylim=c(0,200), col="green",
breaks=seq(0,5000, 100), xlab="Final population size at t=50", main='')
par(new=TRUE)
## use transparency for overlapping distributions - may not work on all systems
hist(apply(x.uneq, 1, sum), xlim=c(0,5000), ylim=c(0,200), col = rgb(0, 0, 1, 0.2),
xaxt='n', yaxt='n', ylab='', xlab='',
breaks=seq(0,10000, 100), main='')
legend(2500,200, c("equal", "unequal"),fill=c("green", rgb(0, 0, 1, 0.2)))
title(paste("Projection of stochastic growth for Hudsonia
using equal and unequal probabilities"), cex.main=1)
## initial pop size
sum(n)
abline(v=sum(n), lty=3)
``` |

popbio documentation built on May 4, 2018, 1:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.