function(level = 0, slope = 1) { #program compute.mu() # #Compute mu values for Brass General mltf with given parameters #mortality from non-HIV-related causes. # #Known bug: output at older ages will be messed up if alpha/beta are such #that Lx values are zero for oldest ages. # Lx <- brass.general.mltf(level, slope)[, "Lx"] #compute Lx using brass.general.mltf() program SR <- Lx[2:length(Lx)]/Lx[1:(length(Lx) - 1)] #compute survival ratios L_(x+1)/L_x mu <- - log(SR) mu <- mu[1:aa] #truncate if necessary to get right number of elements mu[length(mu)] <- 99 # put last element of mu equal to 99 to kill everyone off names(mu) <- 1:aa - 0.5 mu.b <- -2 * log(Lx[1]) #pseudo-mu for survival of births to end of year of birth write.ascii(compute.mu) list(mu = mu, mu.b = mu.b) }