Hi everyone,

I would like to create stochastic population models for an undergraduate
course.

The goal would be to have students run models, record, results, change
parameters, and make inferences on changing the effects.

I understand how to draw from distributions, I hit a knowledge wall with
loops.

Here's what I have for a logistic model to predict N_t (not dN/dt)

K <- rnorm(100, 10000, 400) # fluctuating environment
r <- rnorm(100, 1, 2) # variable reproductive potential
t <- 50
N0 <- 10 # start with 10 individuals

for (i in 1:t) { N[,i+1] <- (N0*K)/(N0+((K-N0)^exp(-r*t)))}
plot(t, Nt)

This doesn't work but I think I'm getting close.

Any help would be much appreciated.

Thanks,

Jeff

-- 
********************************************************
Jeffrey A. Stratford, PhD
Department of Biology and Health Sciences
Wilkes University, PA 18766 USA
570-332-2942
http://web.wilkes.edu/jeffrey.stratford/
********************************************************

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to