function(r = 0, mu = rep(0.5, times = 100)) { #program input.initial.distribution() # #Computes stable age distribution corresonding to growth rate r #and mortality schedule defined by forces of mortality mu. # # #Calculate initial stable age distribution using # #argument growth rate r and initial forces # sr <- exp( - mu) #survival ratios names(sr) <- 0:(length(sr) - 1) # csr <- c(1, cumprod(sr))[1:length(sr)] #cumulative survival ratios names(csr) <- 0:(length(csr) - 1) # ages <- 1:length(mu) - 0.5 # stable.ad <- exp( - r * ages) * csr # # # #(for debugging) # #list(mu = mu, sr = sr, csr = csr, ages = ages, rterm = exp( - r * ages), ad = ad) # # write.ascii(compute.stable.ad) stable.ad }