# Create a 3x3 PPM
A <- matrix(c(0,1,2,0.5,0.1,0,0,0.6,0.6), byrow=TRUE, ncol=3)
A
# Create an initial stage structure
initial <- c(1,3,2)
initial
# Calculate the convergence time of the 3 stage-biased
# populations within 0.1% of lambda-max
convergence.time(A, accuracy=1e-3)
# Calculate the convergence time of the projection of initial and A
# to within 0.001% of lambda-max
convergence.time(A, vector=initial, accuracy=1e-5)
Run the code above in your browser using DataLab