These data and the description below are from the carData package:
We have “data on police treatment of individuals arrested in Toronto for simple possession of small quantities of marijuana. The data are part of a larger data set featured in a series of articles in the Toronto Star newspaper.”
One of the variables in the data set is the “number of police data bases (of previous arrests, previous convictions, parole status, etc.) on which the arrestee’s name appeared; a numeric vector.”
## released colour year age sex employed citizen checks
## 1 Yes White 2002 21 Male Yes Yes 3
## 2 No Black 1999 17 Male Yes Yes 3
## 3 Yes White 2000 24 Male Yes Yes 3
## 4 No Black 2000 46 Male Yes Yes 1
## 5 Yes Black 1999 27 Female Yes Yes 1
## 6 Yes Black 1998 16 Female Yes Yes 0
## [1] 5226 8
poisson_fit <- data.frame(
x = seq(from = 0, to = max(Arrests$checks)),
pmf = dpois(seq(from = 0, to = max(Arrests$checks)), lambda = mean(Arrests$checks))
)
ggplot(data = Arrests, mapping = aes(x = checks)) +
geom_histogram(binwidth = 1, mapping = aes(y = ..density..)) +
geom_point(data = poisson_fit, mapping = aes(x = x, y = pmf), color = "orange") +
geom_line(data = poisson_fit, mapping = aes(x = x, y = pmf), color = "orange") +
theme_bw()
\(E(X) = (1 - \pi) \lambda\)
\(Var(X) = \lambda (1 - \pi) (1 + \pi \lambda)\)
We didn’t have time for this in class, but as an exercise you might try finding the method of moments estimators of \(\pi\) and \(\lambda\).
The log likelihood is
\[\begin{align*} \ell(\pi, \lambda) &= \prod_{i: x_i = 0} P(X_i = 0) \prod_{i: x_i \neq 0}P(X_i = x_i) \\ &= \prod_{i: x_i = 0} \left\{ \pi + (1 - \pi) \exp(-\lambda) \right\} \prod_{i: x_i \neq 0} (1 - \pi) \frac{\lambda^{x_i} \exp(-\lambda)}{x_i!} \\ \end{align*}\]
The first and second derivatives are complicated. The functions below calculate the gradient vector and Hessian matrix.
loglik <- function(params, n0, n, sum_x) {
pi <- params[1]
lambda <- params[2]
term1 <- n0 * log(pi + (1 - pi) * exp(-lambda))
term2 <- (n - n0) * log(1 - pi)
term3 <- sum_x * log(lambda)
term4 <- -lambda * (n - n0)
return(term1 + term2 + term3 + term4)
}
calc_dl_dpi <- function(pi, lambda, n0, n, sum_x) {
term1 <- n0 * (1 - exp(-lambda)) / (pi + (1 - pi)*exp(-lambda))
term2 <- -1 * (n - n0) / (1 - pi)
return(
term1 + term2
)
}
calc_dl_dlambda <- function(pi, lambda, n0, n, sum_x) {
term1 <- -1 * n0 * (1 - pi) * exp(-lambda) / (pi + (1 - pi)*exp(-lambda))
term2 <- sum_x / lambda
term3 <- -(n - n0)
return(
term1 + term2 + term3
)
}
calc_grad <- function(pi, lambda, n0, n, sum_x) {
return(matrix(c(
calc_dl_dpi(pi, lambda, n0, n, sum_x),
calc_dl_dlambda(pi, lambda, n0, n, sum_x)
)))
}
calc_dl2_dpi2 <- function(pi, lambda, n0, n, sum_x) {
term1 <- -n0 * (1 - exp(lambda))^2 / (pi + (1 - pi)*exp(-lambda))^2
term2 <- -1 * (n - n0) / (1 - pi)^2
return(
term1 + term2
)
}
calc_dl2_dlambda2 <- function(pi, lambda, n0, n, sum_x) {
term1 <- n0 * (1 - pi)^2 / (pi * exp(lambda) + 1 - pi)^2
term2 <- n0 * (1 - pi) / (pi * exp(lambda) + 1 - pi)
term3 <- -1 * sum_x / lambda^2
return(
term1 + term2 + term3
)
}
calc_dl2_dpi_dlambda <- function(pi, lambda, n0, n, sum_x) {
term1 <- n0 * exp(lambda) / (pi * exp(lambda) + (1 - pi))^2
return(term1)
}
calc_hess <- function(pi, lambda, n0, n, sum_x) {
hess <- matrix(NA, nrow = 2, ncol = 2)
hess[1, 1] <- calc_dl2_dpi2(pi, lambda, n0, n, sum_x)
hess[2, 2] <- calc_dl2_dlambda2(pi, lambda, n0, n, sum_x)
hess[1, 2] <- hess[2, 1] <- calc_dl2_dpi_dlambda(pi, lambda, n0, n, sum_x)
return(hess)
}
We update the parameter vector \(\theta = \begin{bmatrix}\pi \\ \lambda \end{bmatrix}\) via:
\[\theta^{(i+1)} = \theta^{(i)} - H^{-1} \nabla \ell(\pi, \lambda | x_1, \ldots, x_n)\]
update_step <- function(pi, lambda, n0, n, sum_x) {
theta <- matrix(c(pi, lambda))
grad <- calc_grad(pi, lambda, n0, n, sum_x)
hess <- calc_hess(pi, lambda, n0, n, sum_x)
theta_new <- theta - solve(hess, grad)
return(theta_new)
}
I picked starting values for the parameters that were vaguely plausible:
pi <- mean(Arrests$checks == 0)
lambda <- mean(Arrests$checks)
n0 <- sum(Arrests$checks == 0)
n <- nrow(Arrests)
sum_x <- sum(Arrests$checks)
max_iter <- 1000
tol <- 1e-8
pi_history <- rep(NA, max_iter)
lambda_history <- rep(NA, max_iter)
loglikelihood_history <- rep(NA, max_iter)
i <- 1
last_change <- Inf
while(i <= max_iter && last_change > tol) {
new_params <- update_step(pi, lambda, n0, n, sum_x)
last_change <- max(abs(pi - new_params[1, 1]), abs(lambda - new_params[2, 1]))
pi_history[i] <- pi <- new_params[1, 1]
lambda_history[i] <- lambda <- new_params[2, 1]
loglikelihood_history[i] <- loglik(new_params, n0, n, sum_x)
print(paste0("iteration ", i, ": pi = ", pi, "; lambda = ", lambda, "; last change = ", last_change))
i <- i + 1
}
## [1] "iteration 1: pi = 0.345260608720573; lambda = 2.16018835955995; last change = 0.523755141037179"
## [1] "iteration 2: pi = 0.343570277642645; lambda = 2.33351737427344; last change = 0.173329014713486"
## [1] "iteration 3: pi = 0.342507862474759; lambda = 2.33304058377096; last change = 0.0010624151678863"
## [1] "iteration 4: pi = 0.341466506620181; lambda = 2.33215592391869; last change = 0.0010413558545776"
## [1] "iteration 5: pi = 0.340444640800363; lambda = 2.33131382013625; last change = 0.00102186581981772"
## [1] "iteration 6: pi = 0.339441892969725; lambda = 2.33048116856108; last change = 0.00100274783063814"
## [1] "iteration 7: pi = 0.338457819981116; lambda = 2.32966024503978; last change = 0.000984072988609086"
## [1] "iteration 8: pi = 0.337491997968711; lambda = 2.32885070951852; last change = 0.000965822012404915"
## [1] "iteration 9: pi = 0.336544015229371; lambda = 2.32805242003912; last change = 0.00094798273934027"
## [1] "iteration 10: pi = 0.33561347221402; lambda = 2.32726522224519; last change = 0.000930543015351171"
## [1] "iteration 11: pi = 0.334699981023487; lambda = 2.32648896520963; last change = 0.000913491190532523"
## [1] "iteration 12: pi = 0.333803164965484; lambda = 2.32572350016734; last change = 0.000896816058003236"
## [1] "iteration 13: pi = 0.332922658130052; lambda = 2.32496868055441; last change = 0.000880506835432282"
## [1] "iteration 14: pi = 0.33205810498536; lambda = 2.3242243619495; last change = 0.000864553144691582"
## [1] "iteration 15: pi = 0.331209159992478; lambda = 2.32349040202532; last change = 0.000848944992881739"
## [1] "iteration 16: pi = 0.330375487238073; lambda = 2.3227666605018; last change = 0.000833672754405101"
## [1] "iteration 17: pi = 0.329556760084037; lambda = 2.32205299910124; last change = 0.000818727154036247"
## [1] "iteration 18: pi = 0.328752660833113; lambda = 2.32134928150555; last change = 0.000804099250924062"
## [1] "iteration 19: pi = 0.327962880409646; lambda = 2.32065537331522; last change = 0.000789780423466724"
## [1] "iteration 20: pi = 0.327187118054642; lambda = 2.31997114201004; last change = 0.000775762355004261"
## [1] "iteration 21: pi = 0.326425081034365; lambda = 2.3192964569115; last change = 0.000762037020277495"
## [1] "iteration 22: pi = 0.325676484361758; lambda = 2.3186311891466; last change = 0.000748596672606128"
## [1] "iteration 23: pi = 0.324941050530016; lambda = 2.31797521161319; last change = 0.000735433831741905"
## [1] "iteration 24: pi = 0.324218509257661; lambda = 2.31732839894661; last change = 0.000722541272355159"
## [1] "iteration 25: pi = 0.323508597244544; lambda = 2.31669062748766; last change = 0.000709912013117264"
## [1] "iteration 26: pi = 0.322811057938201; lambda = 2.31606177525168; last change = 0.000697539306343031"
## [1] "iteration 27: pi = 0.322125641310042; lambda = 2.31544172189882; last change = 0.000685416628159241"
## [1] "iteration 28: pi = 0.321452103640872; lambda = 2.31483034870541; last change = 0.000673537669169832"
## [1] "iteration 29: pi = 0.320790207315285; lambda = 2.31422753853623; last change = 0.00066189632558683"
## [1] "iteration 30: pi = 0.320139720624483; lambda = 2.31363317581785; last change = 0.000650486690802143"
## [1] "iteration 31: pi = 0.31950041757711; lambda = 2.31304714651276; last change = 0.000639303047372752"
## [1] "iteration 32: pi = 0.318872077717712; lambda = 2.31246933809443; last change = 0.000628339859397975"
## [1] "iteration 33: pi = 0.318254485952448; lambda = 2.31189963952312; last change = 0.000617591765264547"
## [1] "iteration 34: pi = 0.317647432381707; lambda = 2.31133794122245; last change = 0.000607053570740756"
## [1] "iteration 35: pi = 0.317050712139308; lambda = 2.31078413505672; last change = 0.000596720242398818"
## [1] "iteration 36: pi = 0.31646412523796; lambda = 2.31023811430888; last change = 0.00058658690134844"
## [1] "iteration 37: pi = 0.315887476420696; lambda = 2.30969977365912; last change = 0.000576648817263437"
## [1] "iteration 38: pi = 0.315320575018009; lambda = 2.30916900916412; last change = 0.000566901402686948"
## [1] "iteration 39: pi = 0.314763234810411; lambda = 2.30864571823684; last change = 0.000557340207598567"
## [1] "iteration 40: pi = 0.31421527389618; lambda = 2.30812979962685; last change = 0.000547960914231038"
## [1] "iteration 41: pi = 0.313676514564058; lambda = 2.30762115340117; last change = 0.000538759332121663"
## [1] "iteration 42: pi = 0.313146783170671; lambda = 2.30711968092568; last change = 0.000529731393387523"
## [1] "iteration 43: pi = 0.312625910022459; lambda = 2.30662528484688; last change = 0.000520873148211587"
## [1] "iteration 44: pi = 0.312113729261929; lambda = 2.30613786907415; last change = 0.000512180760529835"
## [1] "iteration 45: pi = 0.311610078758021; lambda = 2.30565733876246; last change = 0.000503650503907993"
## [1] "iteration 46: pi = 0.311114800000422; lambda = 2.30518360029541; last change = 0.000495278757598916"
## [1] "iteration 47: pi = 0.310627737997651; lambda = 2.30471656126873; last change = 0.000487062002771488"
## [1] "iteration 48: pi = 0.310148741178749; lambda = 2.30425613047405; last change = 0.000478996818901511"
## [1] "iteration 49: pi = 0.309677661298432; lambda = 2.30380221788314; last change = 0.000471079880317637"
## [1] "iteration 50: pi = 0.309214353345538; lambda = 2.30335473463231; last change = 0.000463307952893732"
## [1] "iteration 51: pi = 0.308758675454657; lambda = 2.30291359300732; last change = 0.000455677890880857"
## [1] "iteration 52: pi = 0.308310488820785; lambda = 2.30247870642843; last change = 0.000448186633872083"
## [1] "iteration 53: pi = 0.307869657616892; lambda = 2.30204998943581; last change = 0.000440831203893211"
## [1] "iteration 54: pi = 0.307436048914278; lambda = 2.30162735767524; last change = 0.000433608702614108"
## [1] "iteration 55: pi = 0.307009532605604; lambda = 2.30121072788404; last change = 0.000426516308673741"
## [1] "iteration 56: pi = 0.306589981330489; lambda = 2.30080001787721; last change = 0.000419551275114671"
## [1] "iteration 57: pi = 0.306177270403568; lambda = 2.30039514653395; last change = 0.000412710926920967"
## [1] "iteration 58: pi = 0.305771277744913; lambda = 2.29999603378424; last change = 0.000405992658655152"
## [1] "iteration 59: pi = 0.305371883812724; lambda = 2.2996026005958; last change = 0.000399393932189018"
## [1] "iteration 60: pi = 0.304978971538199; lambda = 2.29921476896113; last change = 0.000392912274524759"
## [1] "iteration 61: pi = 0.304592426262498; lambda = 2.29883246188483; last change = 0.000386545275701478"
## [1] "iteration 62: pi = 0.304212135675714; lambda = 2.29845560337115; last change = 0.000380290586783405"
## [1] "iteration 63: pi = 0.303837989757788; lambda = 2.29808411841161; last change = 0.000374145917926449"
## [1] "iteration 64: pi = 0.303469880721269; lambda = 2.29771793297297; last change = 0.000368109036519071"
## [1] "iteration 65: pi = 0.303107702955875; lambda = 2.29735697398519; last change = 0.000362177765394156"
## [1] "iteration 66: pi = 0.302751352974766; lambda = 2.29700116932975; last change = 0.000356349981109116"
## [1] "iteration 67: pi = 0.302400729362475; lambda = 2.296650447828; last change = 0.000350721501757523"
## [1] "iteration 68: pi = 0.302055732724432; lambda = 2.2963047392297; last change = 0.000345708598295413"
## [1] "iteration 69: pi = 0.301716265638022; lambda = 2.2959639742018; last change = 0.000340765027897927"
## [1] "iteration 70: pi = 0.301382232605116; lambda = 2.29562808431725; last change = 0.000335889884551577"
## [1] "iteration 71: pi = 0.301053540006029; lambda = 2.29529700204403; last change = 0.000331082273221206"
## [1] "iteration 72: pi = 0.300730096054851; lambda = 2.29497066073431; last change = 0.000326341309722977"
## [1] "iteration 73: pi = 0.300411810756089; lambda = 2.29464899461373; last change = 0.000321666120574271"
## [1] "iteration 74: pi = 0.300098595862591; lambda = 2.29433193877087; last change = 0.000317055842863567"
## [1] "iteration 75: pi = 0.299790364834696; lambda = 2.29401942914675; last change = 0.000312509624115886"
## [1] "iteration 76: pi = 0.299487032800564; lambda = 2.29371140252458; last change = 0.000308026622168001"
## [1] "iteration 77: pi = 0.299188516517654; lambda = 2.29340779651955; last change = 0.000303606005038315"
## [1] "iteration 78: pi = 0.298894734335299; lambda = 2.29310854956874; last change = 0.000299246950809184"
## [1] "iteration 79: pi = 0.298605606158344; lambda = 2.29281360092123; last change = 0.000294948647504345"
## [1] "iteration 80: pi = 0.298321053411817; lambda = 2.29252289062826; last change = 0.000290710292971674"
## [1] "iteration 81: pi = 0.298040999006583; lambda = 2.29223635953349; last change = 0.000286531094771281"
## [1] "iteration 82: pi = 0.297765367305962; lambda = 2.29195394926343; last change = 0.00028241027005782"
## [1] "iteration 83: pi = 0.297494084093266; lambda = 2.29167560221795; last change = 0.0002783470454788"
## [1] "iteration 84: pi = 0.297227076540234; lambda = 2.29140126156089; last change = 0.000274340657059113"
## [1] "iteration 85: pi = 0.296964273176327; lambda = 2.2911308712108; last change = 0.000270390350097127"
## [1] "iteration 86: pi = 0.296705603858859; lambda = 2.29086437583173; last change = 0.000266495379063869"
## [1] "iteration 87: pi = 0.296450999743933; lambda = 2.29060172082424; last change = 0.000262655007495116"
## [1] "iteration 88: pi = 0.296200393258161; lambda = 2.29034285231634; last change = 0.000258868507897247"
## [1] "iteration 89: pi = 0.295953718071136; lambda = 2.2900877171547; last change = 0.000255135161643327"
## [1] "iteration 90: pi = 0.29571090906863; lambda = 2.28983626289582; last change = 0.000251454258874073"
## [1] "iteration 91: pi = 0.295471902326508; lambda = 2.28958843779741; last change = 0.000247825098411703"
## [1] "iteration 92: pi = 0.295236635085316; lambda = 2.28934419080976; last change = 0.000244246987652019"
## [1] "iteration 93: pi = 0.295005045725535; lambda = 2.28910347156728; last change = 0.000240719242481813"
## [1] "iteration 94: pi = 0.294777073743475; lambda = 2.2888662303801; last change = 0.000237241187179826"
## [1] "iteration 95: pi = 0.294552659727791; lambda = 2.28863241822577; last change = 0.000233812154330604"
## [1] "iteration 96: pi = 0.294331745336598; lambda = 2.28840198674103; last change = 0.000230431484733895"
## [1] "iteration 97: pi = 0.294114273275168; lambda = 2.28817488821372; last change = 0.000227098527311398"
## [1] "iteration 98: pi = 0.293900187274189; lambda = 2.28795107557469; last change = 0.00022381263902771"
## [1] "iteration 99: pi = 0.293689432068579; lambda = 2.2877305023899; last change = 0.000220573184795736"
## [1] "iteration 100: pi = 0.293481953376818; lambda = 2.2875131228525; last change = 0.000217379537396756"
## [1] "iteration 101: pi = 0.293277697880804; lambda = 2.28729889177511; last change = 0.000214231077392935"
## [1] "iteration 102: pi = 0.293076613206199; lambda = 2.28708776458206; last change = 0.00021112719304428"
## [1] "iteration 103: pi = 0.292878647903264; lambda = 2.28687969730184; last change = 0.000208067280228263"
## [1] "iteration 104: pi = 0.292683751428163; lambda = 2.28667464655948; last change = 0.000205050742352775"
## [1] "iteration 105: pi = 0.292491874124711; lambda = 2.2864725695692; last change = 0.000202076990282407"
## [1] "iteration 106: pi = 0.292302967206582; lambda = 2.28627342412695; last change = 0.000199145442249637"
## [1] "iteration 107: pi = 0.292116982739924; lambda = 2.28607716860317; last change = 0.00019625552378244"
## [1] "iteration 108: pi = 0.291933873626407; lambda = 2.28588376193555; last change = 0.000193406667622575"
## [1] "iteration 109: pi = 0.291753593586667; lambda = 2.2856931636219; last change = 0.000190598313648316"
## [1] "iteration 110: pi = 0.291576097144137; lambda = 2.2855053337131; last change = 0.000187829908795845"
## [1] "iteration 111: pi = 0.29140133960927; lambda = 2.28532023280612; last change = 0.000185100906984204"
## [1] "iteration 112: pi = 0.291229277064123; lambda = 2.28513782203708; last change = 0.000182410769040242"
## [1] "iteration 113: pi = 0.291059866347304; lambda = 2.28495806307446; last change = 0.000179758962619125"
## [1] "iteration 114: pi = 0.290893065039265; lambda = 2.28478091811232; last change = 0.000177144962137277"
## [1] "iteration 115: pi = 0.290728831447937; lambda = 2.28460634986363; last change = 0.000174568248690221"
## [1] "iteration 116: pi = 0.290567124594694; lambda = 2.28443432155365; last change = 0.000172028309985972"
## [1] "iteration 117: pi = 0.290407904200637; lambda = 2.28426479691338; last change = 0.000169524640267316"
## [1] "iteration 118: pi = 0.290251130673188; lambda = 2.28409774017313; last change = 0.00016705674024653"
## [1] "iteration 119: pi = 0.290096765092993; lambda = 2.28393311605611; last change = 0.000164624117024115"
## [1] "iteration 120: pi = 0.289944769201111; lambda = 2.28377088977208; last change = 0.000162226284027955"
## [1] "iteration 121: pi = 0.289795105386496; lambda = 2.28361102701114; last change = 0.000159862760938712"
## [1] "iteration 122: pi = 0.289647736673759; lambda = 2.28345349393752; last change = 0.000157533073617877"
## [1] "iteration 123: pi = 0.289502626711194; lambda = 2.28329825718348; last change = 0.000155236754043386"
## [1] "iteration 124: pi = 0.289359739759075; lambda = 2.28314528384324; last change = 0.00015297334023856"
## [1] "iteration 125: pi = 0.289219040678211; lambda = 2.28299454146703; last change = 0.000150742376206381"
## [1] "iteration 126: pi = 0.289080494918744; lambda = 2.28284599805518; last change = 0.000148543411857993"
## [1] "iteration 127: pi = 0.288944068509196; lambda = 2.28269962205223; last change = 0.000146376002950532"
## [1] "iteration 128: pi = 0.288809728045756; lambda = 2.28255538234121; last change = 0.000144239711018734"
## [1] "iteration 129: pi = 0.28867744068179; lambda = 2.2824132482379; last change = 0.000142134103309655"
## [1] "iteration 130: pi = 0.288547174117583; lambda = 2.28227318948518; last change = 0.000140058752717831"
## [1] "iteration 131: pi = 0.288418896590301; lambda = 2.28213517624746; last change = 0.000138013237720891"
## [1] "iteration 132: pi = 0.288292576864158; lambda = 2.28199917910514; last change = 0.000135997142315603"
## [1] "iteration 133: pi = 0.288168184220801; lambda = 2.28186516904919; last change = 0.000134010055951261"
## [1] "iteration 134: pi = 0.288045688449894; lambda = 2.28173311747572; last change = 0.000132051573475067"
## [1] "iteration 135: pi = 0.287925059839898; lambda = 2.28160299618066; last change = 0.000130121295059293"
## [1] "iteration 136: pi = 0.287806269169051; lambda = 2.28147477735451; last change = 0.000128218826148441"
## [1] "iteration 137: pi = 0.287689287696522; lambda = 2.28134843357712; last change = 0.000126343777389515"
## [1] "iteration 138: pi = 0.287574087153766; lambda = 2.28122393781254; last change = 0.000124495764582733"
## [1] "iteration 139: pi = 0.287460639736044; lambda = 2.28110126340393; last change = 0.000122674408607804"
## [1] "iteration 140: pi = 0.287348918094125; lambda = 2.28098038406856; last change = 0.000120879335373747"
## [1] "iteration 141: pi = 0.287238895326152; lambda = 2.2808612738928; last change = 0.000119110175758053"
## [1] "iteration 142: pi = 0.287130544969685; lambda = 2.28074390732725; last change = 0.000117366565544064"
## [1] "iteration 143: pi = 0.287023840993888; lambda = 2.28062825918189; last change = 0.000115648145367242"
## [1] "iteration 144: pi = 0.286918757791894; lambda = 2.28051430462123; last change = 0.000113954560656104"
## [1] "iteration 145: pi = 0.286815270173311; lambda = 2.28040201915966; last change = 0.000112285461574491"
## [1] "iteration 146: pi = 0.286713353356881; lambda = 2.28029137865669; last change = 0.000110640502963832"
## [1] "iteration 147: pi = 0.28661298296329; lambda = 2.2801823593124; last change = 0.000109019344292527"
## [1] "iteration 148: pi = 0.286514135008117; lambda = 2.28007493766281; last change = 0.00010742164959332"
## [1] "iteration 149: pi = 0.286416785894926; lambda = 2.27996909057539; last change = 0.000105847087411792"
## [1] "iteration 150: pi = 0.286320912408493; lambda = 2.27986479524464; last change = 0.000104295330753512"
## [1] "iteration 151: pi = 0.286226491708169; lambda = 2.27976202918762; last change = 0.000102766057024972"
## [1] "iteration 152: pi = 0.286133501321367; lambda = 2.27966077023963; last change = 0.00010125894798696"
## [1] "iteration 153: pi = 0.286041919137189; lambda = 2.27956099654994; last change = 9.97736896937162e-05"
## [1] "iteration 154: pi = 0.285951723400163; lambda = 2.27946268657749; last change = 9.83099724485292e-05"
## [1] "iteration 155: pi = 0.285862892704113; lambda = 2.27936581908674; last change = 9.68674907442235e-05"
## [1] "iteration 156: pi = 0.285775405986138; lambda = 2.27927037314353; last change = 9.54459432165322e-05"
## [1] "iteration 157: pi = 0.285689242520721; lambda = 2.27917632811093; last change = 9.40450325912501e-05"
## [1] "iteration 158: pi = 0.285604381913935; lambda = 2.2790836636453; last change = 9.26644656362718e-05"
## [1] "iteration 159: pi = 0.285520804097774; lambda = 2.27899235969219; last change = 9.1303953105637e-05"
## [1] "iteration 160: pi = 0.285438489324582; lambda = 2.2789023964825; last change = 8.99632096973413e-05"
## [1] "iteration 161: pi = 0.285357418161596; lambda = 2.2788137545285; last change = 8.86419539982697e-05"
## [1] "iteration 162: pi = 0.285277571485592; lambda = 2.27872641462006; last change = 8.73399084393434e-05"
## [1] "iteration 163: pi = 0.285198930477622; lambda = 2.27864035782081; last change = 8.6056799247558e-05"
## [1] "iteration 164: pi = 0.285121476617866; lambda = 2.27855556546442; last change = 8.47923563949138e-05"
## [1] "iteration 165: pi = 0.285045191680571; lambda = 2.27847201915086; last change = 8.3546313554006e-05"
## [1] "iteration 166: pi = 0.284970057729084; lambda = 2.27838970074281; last change = 8.23184080522843e-05"
## [1] "iteration 167: pi = 0.284896057110987; lambda = 2.27830859236198; last change = 8.1108380824535e-05"
## [1] "iteration 168: pi = 0.284823172453312; lambda = 2.27822867638562; last change = 7.99159763658075e-05"
## [1] "iteration 169: pi = 0.28475138665785; lambda = 2.27814993544293; last change = 7.8740942689226e-05"
## [1] "iteration 170: pi = 0.284680682896549; lambda = 2.27807235241165; last change = 7.75830312793602e-05"
## [1] "iteration 171: pi = 0.284611044606996; lambda = 2.2779959104146; last change = 7.64419970495922e-05"
## [1] "iteration 172: pi = 0.284542455487975; lambda = 2.27792059281631; last change = 7.53175982941556e-05"
## [1] "iteration 173: pi = 0.28447489949512; lambda = 2.27784638321965; last change = 7.42095966534961e-05"
## [1] "iteration 174: pi = 0.284408360836633; lambda = 2.27777326546259; last change = 7.31177570592045e-05"
## [1] "iteration 175: pi = 0.284342823969097; lambda = 2.27770122361489; last change = 7.20418477033746e-05"
## [1] "iteration 176: pi = 0.284278273593344; lambda = 2.2776302419749; last change = 7.09816399906416e-05"
## [1] "iteration 177: pi = 0.284214694650422; lambda = 2.2775603050664; last change = 6.99369084951051e-05"
## [1] "iteration 178: pi = 0.284152072317614; lambda = 2.27749139763548; last change = 6.8907430926135e-05"
## [1] "iteration 179: pi = 0.284090392004542; lambda = 2.2774235046474; last change = 6.78929880790768e-05"
## [1] "iteration 180: pi = 0.284029639349337; lambda = 2.27735661128359; last change = 6.68933638046099e-05"
## [1] "iteration 181: pi = 0.283969800214879; lambda = 2.27729070293864; last change = 6.59083449590092e-05"
## [1] "iteration 182: pi = 0.2839108606851; lambda = 2.27722576521726; last change = 6.49377213743918e-05"
## [1] "iteration 183: pi = 0.283852807061363; lambda = 2.27716178393145; last change = 6.39812858129751e-05"
## [1] "iteration 184: pi = 0.283795625858891; lambda = 2.27709874509752; last change = 6.30388339315502e-05"
## [1] "iteration 185: pi = 0.283739303803275; lambda = 2.27703663493327; last change = 6.21101642450661e-05"
## [1] "iteration 186: pi = 0.283683827827035; lambda = 2.27697543985519; last change = 6.11950780853299e-05"
## [1] "iteration 187: pi = 0.283629185066243; lambda = 2.27691514647562; last change = 6.02933795668115e-05"
## [1] "iteration 188: pi = 0.283575362857204; lambda = 2.27685574160007; last change = 5.94048755493404e-05"
## [1] "iteration 189: pi = 0.283522348733204; lambda = 2.27679721222447; last change = 5.85293756016902e-05"
## [1] "iteration 190: pi = 0.283470130421305; lambda = 2.2767395455325; last change = 5.76666919647195e-05"
## [1] "iteration 191: pi = 0.283418695839201; lambda = 2.27668272889299; last change = 5.68166395180647e-05"
## [1] "iteration 192: pi = 0.283368033092129; lambda = 2.27662674985724; last change = 5.59790357450574e-05"
## [1] "iteration 193: pi = 0.283318130469836; lambda = 2.27657159615655; last change = 5.51537006936442e-05"
## [1] "iteration 194: pi = 0.283268976443589; lambda = 2.2765172556996; last change = 5.43404569506301e-05"
## [1] "iteration 195: pi = 0.283220559663254; lambda = 2.27646371657; last change = 5.35391295977128e-05"
## [1] "iteration 196: pi = 0.283172868954409; lambda = 2.27641096702381; last change = 5.27495461879468e-05"
## [1] "iteration 197: pi = 0.283125893315517; lambda = 2.27635899548711; last change = 5.19715367048867e-05"
## [1] "iteration 198: pi = 0.283079621915143; lambda = 2.27630779055357; last change = 5.12049335372744e-05"
## [1] "iteration 199: pi = 0.283034044089225; lambda = 2.27625734098213; last change = 5.04495714368502e-05"
## [1] "iteration 200: pi = 0.282989149338381; lambda = 2.27620763569463; last change = 4.97052874979254e-05"
## [1] "iteration 201: pi = 0.282944927325277; lambda = 2.27615866377352; last change = 4.89719211178574e-05"
## [1] "iteration 202: pi = 0.282901367872026; lambda = 2.27611041445955; last change = 4.82493139690732e-05"
## [1] "iteration 203: pi = 0.282858460957641; lambda = 2.27606287714958; last change = 4.75373099693144e-05"
## [1] "iteration 204: pi = 0.282816196715527; lambda = 2.27601604139433; last change = 4.68357552465548e-05"
## [1] "iteration 205: pi = 0.282774565431017; lambda = 2.27596989689621; last change = 4.61444981172399e-05"
## [1] "iteration 206: pi = 0.282733557538951; lambda = 2.27592443350717; last change = 4.54633890476508e-05"
## [1] "iteration 207: pi = 0.282693163621293; lambda = 2.27587964122654; last change = 4.47922806308121e-05"
## [1] "iteration 208: pi = 0.282653374404792; lambda = 2.27583551019898; last change = 4.41310275567375e-05"
## [1] "iteration 209: pi = 0.28261418075868; lambda = 2.2757920307124; last change = 4.34794865804555e-05"
## [1] "iteration 210: pi = 0.28257557369241; lambda = 2.2757491931959; last change = 4.28375164962524e-05"
## [1] "iteration 211: pi = 0.282537544353431; lambda = 2.27570698821779; last change = 4.22049781145795e-05"
## [1] "iteration 212: pi = 0.282500084025004; lambda = 2.27566540648356; last change = 4.15817342243052e-05"
## [1] "iteration 213: pi = 0.282463184124047; lambda = 2.27562443883399; last change = 4.09676495740641e-05"
## [1] "iteration 214: pi = 0.282426836199028; lambda = 2.27558407624315; last change = 4.03625908411698e-05"
## [1] "iteration 215: pi = 0.282391031927879; lambda = 2.27554430981654; last change = 3.97664266085229e-05"
## [1] "iteration 216: pi = 0.282355763115957; lambda = 2.2755051307892; last change = 3.9179027335301e-05"
## [1] "iteration 217: pi = 0.282321021694034; lambda = 2.27546653052387; last change = 3.86002653307571e-05"
## [1] "iteration 218: pi = 0.282286799716318; lambda = 2.27542850050914; last change = 3.80300147351242e-05"
## [1] "iteration 219: pi = 0.282253089358512; lambda = 2.27539103235765; last change = 3.7468151484088e-05"
## [1] "iteration 220: pi = 0.282219882915902; lambda = 2.27535411780436; last change = 3.69145532945758e-05"
## [1] "iteration 221: pi = 0.282187172801475; lambda = 2.27531774870473; last change = 3.63690996310062e-05"
## [1] "iteration 222: pi = 0.282154951544078; lambda = 2.27528191703304; last change = 3.58316716888574e-05"
## [1] "iteration 223: pi = 0.28212321178659; lambda = 2.27524661488067; last change = 3.53021523653574e-05"
## [1] "iteration 224: pi = 0.282091946284142; lambda = 2.27521183445444; last change = 3.4780426238612e-05"
## [1] "iteration 225: pi = 0.282061147902356; lambda = 2.27517756807489; last change = 3.42663795427356e-05"
## [1] "iteration 226: pi = 0.282030809615614; lambda = 2.27514380817475; last change = 3.37599001460909e-05"
## [1] "iteration 227: pi = 0.282000924505358; lambda = 2.27511054729722; last change = 3.32608775290844e-05"
## [1] "iteration 228: pi = 0.28197148575842; lambda = 2.27507777809446; last change = 3.27692027588533e-05"
## [1] "iteration 229: pi = 0.281942486665368; lambda = 2.27504549332599; last change = 3.22847684723904e-05"
## [1] "iteration 230: pi = 0.281913920618898; lambda = 2.27501368585714; last change = 3.18074688467895e-05"
## [1] "iteration 231: pi = 0.281885781112233; lambda = 2.27498234865755; last change = 3.13371995868117e-05"
## [1] "iteration 232: pi = 0.281858061737558; lambda = 2.27495147479966; last change = 3.08738578964629e-05"
## [1] "iteration 233: pi = 0.281830756184483; lambda = 2.27492105745719; last change = 3.04173424630072e-05"
## [1] "iteration 234: pi = 0.281803858238524; lambda = 2.27489108990376; last change = 2.99675534320976e-05"
## [1] "iteration 235: pi = 0.281777361779611; lambda = 2.27486156551137; last change = 2.95243923900124e-05"
## [1] "iteration 236: pi = 0.281751260780625; lambda = 2.27483247774903; last change = 2.90877623427832e-05"
## [1] "iteration 237: pi = 0.281725549305949; lambda = 2.27480382018133; last change = 2.8657567697099e-05"
## [1] "iteration 238: pi = 0.281700221510052; lambda = 2.27477558646709; last change = 2.82337142381017e-05"
## [1] "iteration 239: pi = 0.281675271636092; lambda = 2.27474777035798; last change = 2.78161091125106e-05"
## [1] "iteration 240: pi = 0.28165069401454; lambda = 2.27472036569717; last change = 2.74046608099709e-05"
## [1] "iteration 241: pi = 0.281626483061828; lambda = 2.27469336641803; last change = 2.69992791412932e-05"
## [1] "iteration 242: pi = 0.28160263327902; lambda = 2.27466676654281; last change = 2.65998752224661e-05"
## [1] "iteration 243: pi = 0.2815791392505; lambda = 2.27464056018135; last change = 2.62063614537844e-05"
## [1] "iteration 244: pi = 0.281555995642688; lambda = 2.27461474152985; last change = 2.58186515060821e-05"
## [1] "iteration 245: pi = 0.281533197202769; lambda = 2.27458930486955; last change = 2.54366602976397e-05"
## [1] "iteration 246: pi = 0.281510738757448; lambda = 2.27456424456557; last change = 2.50603039795294e-05"
## [1] "iteration 247: pi = 0.281488615211722; lambda = 2.27453955506565; last change = 2.46894999178515e-05"
## [1] "iteration 248: pi = 0.281466821547672; lambda = 2.27451523089898; last change = 2.4324166676859e-05"
## [1] "iteration 249: pi = 0.281445352823278; lambda = 2.27449126667498; last change = 2.39642239994176e-05"
## [1] "iteration 250: pi = 0.281424204171246; lambda = 2.27446765708218; last change = 2.36095927950153e-05"
## [1] "iteration 251: pi = 0.281403370797859; lambda = 2.27444439688706; last change = 2.32601951184463e-05"
## [1] "iteration 252: pi = 0.281382847981846; lambda = 2.2744214809329; last change = 2.29159541578206e-05"
## [1] "iteration 253: pi = 0.281362631073264; lambda = 2.27439890413869; last change = 2.25767942123589e-05"
## [1] "iteration 254: pi = 0.281342715492407; lambda = 2.27437666149801; last change = 2.22426406866205e-05"
## [1] "iteration 255: pi = 0.281323096728723; lambda = 2.27435474807794; last change = 2.19134200629689e-05"
## [1] "iteration 256: pi = 0.281303770339752; lambda = 2.27433315901805; last change = 2.15890598962432e-05"
## [1] "iteration 257: pi = 0.281284731950086; lambda = 2.27431188952925; last change = 2.12694887919973e-05"
## [1] "iteration 258: pi = 0.281265977250331; lambda = 2.27429093489286; last change = 2.0954636394066e-05"
## [1] "iteration 259: pi = 0.281247501996104; lambda = 2.27427029045949; last change = 2.06444333703537e-05"
## [1] "iteration 260: pi = 0.281229302007033; lambda = 2.27424995164809; last change = 2.03388113986236e-05"
## [1] "iteration 261: pi = 0.281211373165775; lambda = 2.27422991394494; last change = 2.0037703147846e-05"
## [1] "iteration 262: pi = 0.281193711417052; lambda = 2.27421017290267; last change = 1.97410422693167e-05"
## [1] "iteration 263: pi = 0.281176312766703; lambda = 2.27419072413929; last change = 1.94487633797813e-05"
## [1] "iteration 264: pi = 0.281159173280747; lambda = 2.27417156333725; last change = 1.91608020490008e-05"
## [1] "iteration 265: pi = 0.281142289084463; lambda = 2.27415268624246; last change = 1.88770947846528e-05"
## [1] "iteration 266: pi = 0.281125656361487; lambda = 2.27413408866344; last change = 1.85975790203408e-05"
## [1] "iteration 267: pi = 0.281109271352914; lambda = 2.27411576647034; last change = 1.83221931013833e-05"
## [1] "iteration 268: pi = 0.28109313035643; lambda = 2.27409771559407; last change = 1.80508762710474e-05"
## [1] "iteration 269: pi = 0.281077229725438; lambda = 2.2740799320254; last change = 1.7783568662999e-05"
## [1] "iteration 270: pi = 0.281061565868217; lambda = 2.27406241181413; last change = 1.7520211276878e-05"
## [1] "iteration 271: pi = 0.281046135247079; lambda = 2.27404515106815; last change = 1.72607459809626e-05"
## [1] "iteration 272: pi = 0.281030934377548; lambda = 2.27402814595266; last change = 1.70051154868567e-05"
## [1] "iteration 273: pi = 0.281015959827548; lambda = 2.27401139268932; last change = 1.67532633450485e-05"
## [1] "iteration 274: pi = 0.281001208216604; lambda = 2.27399488755539; last change = 1.65051339289235e-05"
## [1] "iteration 275: pi = 0.28098667621506; lambda = 2.27397862688296; last change = 1.62606724267711e-05"
## [1] "iteration 276: pi = 0.280972360543301; lambda = 2.27396260705814; last change = 1.60198248235766e-05"
## [1] "iteration 277: pi = 0.280958257970995; lambda = 2.27394682452024; last change = 1.57825378979126e-05"
## [1] "iteration 278: pi = 0.28094436531634; lambda = 2.27393127576103; last change = 1.55487592041759e-05"
## [1] "iteration 279: pi = 0.28093067944533; lambda = 2.27391595732397; last change = 1.53184370628168e-05"
## [1] "iteration 280: pi = 0.280917197271025; lambda = 2.27390086580342; last change = 1.50915205527902e-05"
## [1] "iteration 281: pi = 0.280903915752838; lambda = 2.27388599784392; last change = 1.48679594937917e-05"
## [1] "iteration 282: pi = 0.280890831895831; lambda = 2.27387135013948; last change = 1.46477044435933e-05"
## [1] "iteration 283: pi = 0.280877942750021; lambda = 2.2738569194328; last change = 1.44307066820559e-05"
## [1] "iteration 284: pi = 0.280865245409698; lambda = 2.2738427025146; last change = 1.42169182000274e-05"
## [1] "iteration 285: pi = 0.280852737012752; lambda = 2.2738286962229; last change = 1.40062916949013e-05"
## [1] "iteration 286: pi = 0.280840414740016; lambda = 2.27381489744235; last change = 1.37987805519657e-05"
## [1] "iteration 287: pi = 0.280828275814609; lambda = 2.27380130310351; last change = 1.3594338846179e-05"
## [1] "iteration 288: pi = 0.2808163175013; lambda = 2.27378791018219; last change = 1.33929213159689e-05"
## [1] "iteration 289: pi = 0.280804537105872; lambda = 2.27377471569882; last change = 1.31944833712261e-05"
## [1] "iteration 290: pi = 0.280792931974505; lambda = 2.27376171671775; last change = 1.29989810702114e-05"
## [1] "iteration 291: pi = 0.280781499493163; lambda = 2.27374891034663; last change = 1.28063711168913e-05"
## [1] "iteration 292: pi = 0.280770237086992; lambda = 2.27373629373578; last change = 1.26166108507242e-05"
## [1] "iteration 293: pi = 0.280759142219723; lambda = 2.27372386407755; last change = 1.24296582333372e-05"
## [1] "iteration 294: pi = 0.280748212393094; lambda = 2.2737116186057; last change = 1.22454718489706e-05"
## [1] "iteration 295: pi = 0.280737445146273; lambda = 2.27369955459482; last change = 1.20640108809411e-05"
## [1] "iteration 296: pi = 0.280726838055289; lambda = 2.2736876693597; last change = 1.18852351187471e-05"
## [1] "iteration 297: pi = 0.28071638873248; lambda = 2.27367596025476; last change = 1.17091049376405e-05"
## [1] "iteration 298: pi = 0.280706094825939; lambda = 2.27366442467346; last change = 1.15355812959628e-05"
## [1] "iteration 299: pi = 0.280695954018979; lambda = 2.27365306004774; last change = 1.13646257253741e-05"
## [1] "iteration 300: pi = 0.280685964029595; lambda = 2.27364186384742; last change = 1.11962003188637e-05"
## [1] "iteration 301: pi = 0.280676122609946; lambda = 2.27363083357969; last change = 1.10302677320817e-05"
## [1] "iteration 302: pi = 0.280666427545835; lambda = 2.27361996678853; last change = 1.0866791161579e-05"
## [1] "iteration 303: pi = 0.280656876656204; lambda = 2.27360926105417; last change = 1.07057343523564e-05"
## [1] "iteration 304: pi = 0.280647467792633; lambda = 2.2735987139926; last change = 1.05470615752168e-05"
## [1] "iteration 305: pi = 0.280638198838846; lambda = 2.27358832325497; last change = 1.03907376285406e-05"
## [1] "iteration 306: pi = 0.280629067710228; lambda = 2.27357808652714; last change = 1.02367278285165e-05"
## [1] "iteration 307: pi = 0.280620072353348; lambda = 2.27356800152914; last change = 1.00849980007034e-05"
## [1] "iteration 308: pi = 0.280611210745487; lambda = 2.27355806601467; last change = 9.93551447248109e-06"
## [1] "iteration 309: pi = 0.280602480894176; lambda = 2.27354827777061; last change = 9.78824406416834e-06"
## [1] "iteration 310: pi = 0.280593880836742; lambda = 2.27353863461652; last change = 9.64315408902294e-06"
## [1] "iteration 311: pi = 0.280585408639856; lambda = 2.27352913440418; last change = 9.50021233592224e-06"
## [1] "iteration 312: pi = 0.280577062399092; lambda = 2.27351977501711; last change = 9.35938706980721e-06"
## [1] "iteration 313: pi = 0.280568840238494; lambda = 2.27351055437009; last change = 9.2206470219125e-06"
## [1] "iteration 314: pi = 0.280560740310143; lambda = 2.27350147040871; last change = 9.08396138266099e-06"
## [1] "iteration 315: pi = 0.280552760793741; lambda = 2.27349252110891; last change = 8.94929979766701e-06"
## [1] "iteration 316: pi = 0.280544899896188; lambda = 2.27348370447655; last change = 8.81663235619001e-06"
## [1] "iteration 317: pi = 0.28053715585118; lambda = 2.27347501854696; last change = 8.68592959157866e-06"
## [1] "iteration 318: pi = 0.280529526918802; lambda = 2.27346646138449; last change = 8.55716246572769e-06"
## [1] "iteration 319: pi = 0.280522011385129; lambda = 2.27345803108212; last change = 8.43030237263065e-06"
## [1] "iteration 320: pi = 0.280514607561842; lambda = 2.273449725761; last change = 8.30532112550131e-06"
## [1] "iteration 321: pi = 0.280507313785835; lambda = 2.27344154357004; last change = 8.18219095188866e-06"
## [1] "iteration 322: pi = 0.280500128418844; lambda = 2.27343348268556; last change = 8.06088448834785e-06"
## [1] "iteration 323: pi = 0.280493049847067; lambda = 2.27342554131078; last change = 7.94137477555523e-06"
## [1] "iteration 324: pi = 0.2804860764808; lambda = 2.27341771767553; last change = 7.82363525209107e-06"
## [1] "iteration 325: pi = 0.280479206754074; lambda = 2.27341001003579; last change = 7.70763974244915e-06"
## [1] "iteration 326: pi = 0.280472439124297; lambda = 2.27340241667332; last change = 7.59336246325404e-06"
## [1] "iteration 327: pi = 0.280465772071909; lambda = 2.27339493589531; last change = 7.48077800905023e-06"
## [1] "iteration 328: pi = 0.280459204100027; lambda = 2.27338756603397; last change = 7.3698613443085e-06"
## [1] "iteration 329: pi = 0.280452733734112; lambda = 2.27338030544616; last change = 7.26058780831096e-06"
## [1] "iteration 330: pi = 0.280446359521631; lambda = 2.27337315251306; last change = 7.1529331018283e-06"
## [1] "iteration 331: pi = 0.280440080031725; lambda = 2.27336610563978; last change = 7.04687328223486e-06"
## [1] "iteration 332: pi = 0.280433893854887; lambda = 2.27335916325502; last change = 6.9423847599559e-06"
## [1] "iteration 333: pi = 0.28042779960264; lambda = 2.27335232381072; last change = 6.83944429669125e-06"
## [1] "iteration 334: pi = 0.280421795907222; lambda = 2.27334558578173; last change = 6.73802899164855e-06"
## [1] "iteration 335: pi = 0.280415881421274; lambda = 2.27333894766544; last change = 6.63811628465183e-06"
## [1] "iteration 336: pi = 0.280410054817536; lambda = 2.27333240798149; last change = 6.53968394948024e-06"
## [1] "iteration 337: pi = 0.280404314788546; lambda = 2.27332596527141; last change = 6.44271008365394e-06"
## [1] "iteration 338: pi = 0.28039866004634; lambda = 2.2733196180983; last change = 6.34717311109867e-06"
## [1] "iteration 339: pi = 0.280393089322163; lambda = 2.27331336504653; last change = 6.25305177237578e-06"
## [1] "iteration 340: pi = 0.28038760136618; lambda = 2.27330720472141; last change = 6.16032512246178e-06"
## [1] "iteration 341: pi = 0.280382194947192; lambda = 2.27330113574888; last change = 6.06897252453109e-06"
## [1] "iteration 342: pi = 0.280376868852358; lambda = 2.27329515677523; last change = 5.97897364773559e-06"
## [1] "iteration 343: pi = 0.280371621886919; lambda = 2.27328926646677; last change = 5.89030845787875e-06"
## [1] "iteration 344: pi = 0.280366452873928; lambda = 2.27328346350955; last change = 5.80295722141244e-06"
## [1] "iteration 345: pi = 0.280361360653981; lambda = 2.27327774660906; last change = 5.71690049122608e-06"
## [1] "iteration 346: pi = 0.280356344084958; lambda = 2.27327211448995; last change = 5.63211911064343e-06"
## [1] "iteration 347: pi = 0.280351402041763; lambda = 2.27326656589575; last change = 5.54859420232034e-06"
## [1] "iteration 348: pi = 0.280346533416065; lambda = 2.27326109958858; last change = 5.46630717179752e-06"
## [1] "iteration 349: pi = 0.280341737116055; lambda = 2.27325571434888; last change = 5.38523969551008e-06"
## [1] "iteration 350: pi = 0.280337012066191; lambda = 2.27325040897516; last change = 5.30537372211981e-06"
## [1] "iteration 351: pi = 0.280332357206959; lambda = 2.27324518228369; last change = 5.22669146629795e-06"
## [1] "iteration 352: pi = 0.280327771494633; lambda = 2.27324003310829; last change = 5.14917540606064e-06"
## [1] "iteration 353: pi = 0.280323253901036; lambda = 2.27323496030001; last change = 5.07280827699574e-06"
## [1] "iteration 354: pi = 0.280318803413312; lambda = 2.27322996272694; last change = 4.99757307048654e-06"
## [1] "iteration 355: pi = 0.280314419033692; lambda = 2.27322503927391; last change = 4.92345302882669e-06"
## [1] "iteration 356: pi = 0.280310099779272; lambda = 2.27322018884227; last change = 4.85043164211163e-06"
## [1] "iteration 357: pi = 0.280305844681787; lambda = 2.27321541034963; last change = 4.77849264246544e-06"
## [1] "iteration 358: pi = 0.280301652787397; lambda = 2.27321070272962; last change = 4.7076200075935e-06"
## [1] "iteration 359: pi = 0.280297523156469; lambda = 2.27320606493168; last change = 4.63779794346308e-06"
## [1] "iteration 360: pi = 0.280293454863361; lambda = 2.27320149592078; last change = 4.56901089807005e-06"
## [1] "iteration 361: pi = 0.28028944699622; lambda = 2.27319699467724; last change = 4.50124354234305e-06"
## [1] "iteration 362: pi = 0.28028549865677; lambda = 2.27319256019646; last change = 4.4344807794694e-06"
## [1] "iteration 363: pi = 0.280281608960114; lambda = 2.27318819148873; last change = 4.36870772979603e-06"
## [1] "iteration 364: pi = 0.280277777034528; lambda = 2.27318388757899; last change = 4.3039097392672e-06"
## [1] "iteration 365: pi = 0.280274002021269; lambda = 2.27317964750662; last change = 4.24007236654589e-06"
## [1] "iteration 366: pi = 0.280270283074381; lambda = 2.27317547032524; last change = 4.17718138434608e-06"
## [1] "iteration 367: pi = 0.280266619360502; lambda = 2.27317135510246; last change = 4.11522277765641e-06"
## [1] "iteration 368: pi = 0.280263010058676; lambda = 2.27316730091972; last change = 4.05418273619063e-06"
## [1] "iteration 369: pi = 0.280259454360168; lambda = 2.27316330687207; last change = 3.99404765527578e-06"
## [1] "iteration 370: pi = 0.280255951468284; lambda = 2.27315937206794; last change = 3.93480413052316e-06"
## [1] "iteration 371: pi = 0.280252500598187; lambda = 2.27315549562898; last change = 3.87643895649603e-06"
## [1] "iteration 372: pi = 0.280249100976723; lambda = 2.27315167668986; last change = 3.81893912226872e-06"
## [1] "iteration 373: pi = 0.280245751842245; lambda = 2.27314791439805; last change = 3.76229181098253e-06"
## [1] "iteration 374: pi = 0.280242452444443; lambda = 2.27314420791366; last change = 3.70648439096399e-06"
## [1] "iteration 375: pi = 0.280239202044172; lambda = 2.27314055640923; last change = 3.65150442416251e-06"
## [1] "iteration 376: pi = 0.280235999913288; lambda = 2.27313695906958; last change = 3.597339649275e-06"
## [1] "iteration 377: pi = 0.280232845334484; lambda = 2.27313341509159; last change = 3.54397799195993e-06"
## [1] "iteration 378: pi = 0.280229737601124; lambda = 2.27312992368404; last change = 3.49140755240285e-06"
## [1] "iteration 379: pi = 0.280226676017091; lambda = 2.27312648406743; last change = 3.43961660931313e-06"
## [1] "iteration 380: pi = 0.280223659896621; lambda = 2.27312309547381; last change = 3.38859361503907e-06"
## [1] "iteration 381: pi = 0.280220688564159; lambda = 2.27311975714662; last change = 3.33832718979465e-06"
## [1] "iteration 382: pi = 0.280217761354197; lambda = 2.2731164683405; last change = 3.28880612476823e-06"
## [1] "iteration 383: pi = 0.280214877611131; lambda = 2.27311322832112; last change = 3.24001937679341e-06"
## [1] "iteration 384: pi = 0.280212036689107; lambda = 2.27311003636506; last change = 3.1919560643523e-06"
## [1] "iteration 385: pi = 0.280209237951884; lambda = 2.27310689175959; last change = 3.14460546979589e-06"
## [1] "iteration 386: pi = 0.280206480772683; lambda = 2.27310379380256; last change = 3.09795703046234e-06"
## [1] "iteration 387: pi = 0.280203764534049; lambda = 2.27310074180222; last change = 3.05200034222963e-06"
## [1] "iteration 388: pi = 0.280201088627712; lambda = 2.27309773507706; last change = 3.0067251559629e-06"
## [1] "iteration 389: pi = 0.28019845245445; lambda = 2.27309477295569; last change = 2.96212137040897e-06"
## [1] "iteration 390: pi = 0.280195855423953; lambda = 2.27309185477665; last change = 2.91817903885772e-06"
## [1] "iteration 391: pi = 0.280193296954693; lambda = 2.27308897988829; last change = 2.8748883553753e-06"
## [1] "iteration 392: pi = 0.280190776473788; lambda = 2.27308614764863; last change = 2.83223966679458e-06"
## [1] "iteration 393: pi = 0.28018829341688; lambda = 2.27308335742517; last change = 2.79022345583968e-06"
## [1] "iteration 394: pi = 0.280185847228001; lambda = 2.27308060859482; last change = 2.74883035045193e-06"
## [1] "iteration 395: pi = 0.280183437359453; lambda = 2.27307790054371; last change = 2.70805111624028e-06"
## [1] "iteration 396: pi = 0.280181063271681; lambda = 2.27307523266705; last change = 2.66787665381685e-06"
## [1] "iteration 397: pi = 0.280178724433157; lambda = 2.27307260436905; last change = 2.62829800057318e-06"
## [1] "iteration 398: pi = 0.280176420320254; lambda = 2.27307001506272; last change = 2.58930632712762e-06"
## [1] "iteration 399: pi = 0.280174150417132; lambda = 2.27306746416979; last change = 2.55089293066391e-06"
## [1] "iteration 400: pi = 0.28017191421562; lambda = 2.27306495112055; last change = 2.51304924203666e-06"
## [1] "iteration 401: pi = 0.280169711215106; lambda = 2.27306247535373; last change = 2.47576681688955e-06"
## [1] "iteration 402: pi = 0.280167540922419; lambda = 2.2730600363164; last change = 2.43903733521122e-06"
## [1] "iteration 403: pi = 0.280165402851721; lambda = 2.2730576334638; last change = 2.40285260177941e-06"
## [1] "iteration 404: pi = 0.280163296524397; lambda = 2.27305526625926; last change = 2.36720454083184e-06"
## [1] "iteration 405: pi = 0.280161221468948; lambda = 2.27305293417406; last change = 2.33208519784256e-06"
## [1] "iteration 406: pi = 0.280159177220884; lambda = 2.27305063668732; last change = 2.29748673552521e-06"
## [1] "iteration 407: pi = 0.280157163322623; lambda = 2.27304837328589; last change = 2.26340143161252e-06"
## [1] "iteration 408: pi = 0.280155179323382; lambda = 2.27304614346421; last change = 2.22982168018859e-06"
## [1] "iteration 409: pi = 0.28015322477908; lambda = 2.27304394672422; last change = 2.19673998680392e-06"
## [1] "iteration 410: pi = 0.280151299252239; lambda = 2.27304178257526; last change = 2.16414896714312e-06"
## [1] "iteration 411: pi = 0.280149402311883; lambda = 2.27303965053391; last change = 2.13204134746903e-06"
## [1] "iteration 412: pi = 0.280147533533441; lambda = 2.27303755012395; last change = 2.10040996195815e-06"
## [1] "iteration 413: pi = 0.280145692498655; lambda = 2.2730354808762; last change = 2.06924775048023e-06"
## [1] "iteration 414: pi = 0.280143878795484; lambda = 2.27303344232844; last change = 2.0385477563778e-06"
## [1] "iteration 415: pi = 0.280142092018008; lambda = 2.27303143402531; last change = 2.00830312824252e-06"
## [1] "iteration 416: pi = 0.280140331766345; lambda = 2.2730294555182; last change = 1.97850711458614e-06"
## [1] "iteration 417: pi = 0.280138597646552; lambda = 2.27302750636513; last change = 1.94915306384047e-06"
## [1] "iteration 418: pi = 0.280136889270544; lambda = 2.27302558613071; last change = 1.92023442391331e-06"
## [1] "iteration 419: pi = 0.280135206256003; lambda = 2.27302369438597; last change = 1.89174473863574e-06"
## [1] "iteration 420: pi = 0.28013354822629; lambda = 2.27302183070832; last change = 1.86367764865025e-06"
## [1] "iteration 421: pi = 0.280131914810369; lambda = 2.27301999468143; last change = 1.83602688874629e-06"
## [1] "iteration 422: pi = 0.280130305642713; lambda = 2.27301818589515; last change = 1.80878628475156e-06"
## [1] "iteration 423: pi = 0.280128720363229; lambda = 2.27301640394539; last change = 1.78194975619661e-06"
## [1] "iteration 424: pi = 0.280127158617176; lambda = 2.27301464843408; last change = 1.75551131054164e-06"
## [1] "iteration 425: pi = 0.280125620055082; lambda = 2.27301291896903; last change = 1.72946504806148e-06"
## [1] "iteration 426: pi = 0.280124104332672; lambda = 2.27301121516388; last change = 1.70380515029933e-06"
## [1] "iteration 427: pi = 0.280122611110782; lambda = 2.27300953663799; last change = 1.67852588983664e-06"
## [1] "iteration 428: pi = 0.280121140055291; lambda = 2.27300788301637; last change = 1.65362162229954e-06"
## [1] "iteration 429: pi = 0.280119690837042; lambda = 2.27300625392958; last change = 1.62908678724705e-06"
## [1] "iteration 430: pi = 0.280118263131769; lambda = 2.27300464901368; last change = 1.60491590728284e-06"
## [1] "iteration 431: pi = 0.280116856620024; lambda = 2.27300306791009; last change = 1.58110358361441e-06"
## [1] "iteration 432: pi = 0.280115470987103; lambda = 2.27300151026559; last change = 1.55764450138207e-06"
## [1] "iteration 433: pi = 0.280114105922983; lambda = 2.27299997573217; last change = 1.53453342166543e-06"
## [1] "iteration 434: pi = 0.280112761122242; lambda = 2.27299846396699; last change = 1.51176518325968e-06"
## [1] "iteration 435: pi = 0.280111436283999; lambda = 2.27299697463228; last change = 1.48933470311974e-06"
## [1] "iteration 436: pi = 0.280110131111843; lambda = 2.27299550739531; last change = 1.46723697236339e-06"
## [1] "iteration 437: pi = 0.280108845313764; lambda = 2.27299406192826; last change = 1.445467054495e-06"
## [1] "iteration 438: pi = 0.280107578602093; lambda = 2.27299263790817; last change = 1.42402009162268e-06"
## [1] "iteration 439: pi = 0.280106330693433; lambda = 2.27299123501687; last change = 1.40289129157978e-06"
## [1] "iteration 440: pi = 0.2801051013086; lambda = 2.27298985294094; last change = 1.38207593680661e-06"
## [1] "iteration 441: pi = 0.280103890172555; lambda = 2.27298849137156; last change = 1.36156937990961e-06"
## [1] "iteration 442: pi = 0.280102697014344; lambda = 2.27298715000452; last change = 1.34136704010857e-06"
## [1] "iteration 443: pi = 0.280101521567041; lambda = 2.27298582854011; last change = 1.32146440545711e-06"
## [1] "iteration 444: pi = 0.280100363567683; lambda = 2.27298452668308; last change = 1.3018570323986e-06"
## [1] "iteration 445: pi = 0.280099222757214; lambda = 2.27298324414254; last change = 1.28254054088117e-06"
## [1] "iteration 446: pi = 0.280098098880427; lambda = 2.27298198063192; last change = 1.26351061879859e-06"
## [1] "iteration 447: pi = 0.280096991685905; lambda = 2.27298073586891; last change = 1.2447630131085e-06"
## [1] "iteration 448: pi = 0.280095900925966; lambda = 2.27297950957537; last change = 1.22629353871417e-06"
## [1] "iteration 449: pi = 0.280094826356606; lambda = 2.2729783014773; last change = 1.20809807047095e-06"
## [1] "iteration 450: pi = 0.280093767737448; lambda = 2.27297711130475; last change = 1.19017254407439e-06"
## [1] "iteration 451: pi = 0.280092724831682; lambda = 2.2729759387918; last change = 1.17251295606025e-06"
## [1] "iteration 452: pi = 0.280091697406018; lambda = 2.27297478367644; last change = 1.15511536158408e-06"
## [1] "iteration 453: pi = 0.280090685230631; lambda = 2.27297364570056; last change = 1.13797587530939e-06"
## [1] "iteration 454: pi = 0.280089688079108; lambda = 2.27297252460989; last change = 1.12109067007538e-06"
## [1] "iteration 455: pi = 0.2800887057284; lambda = 2.27297142015392; last change = 1.10445597156783e-06"
## [1] "iteration 456: pi = 0.280087737958771; lambda = 2.27297033208585; last change = 1.08806806808914e-06"
## [1] "iteration 457: pi = 0.280086784553749; lambda = 2.27296926016256; last change = 1.07192329545924e-06"
## [1] "iteration 458: pi = 0.280085845300075; lambda = 2.27296820414451; last change = 1.05601805033828e-06"
## [1] "iteration 459: pi = 0.280084919987659; lambda = 2.27296716379573; last change = 1.04034877645987e-06"
## [1] "iteration 460: pi = 0.280084008409531; lambda = 2.27296613888375; last change = 1.02491197839782e-06"
## [1] "iteration 461: pi = 0.280083110361796; lambda = 2.27296512917955; last change = 1.00970420513491e-06"
## [1] "iteration 462: pi = 0.280082225643585; lambda = 2.27296413445749; last change = 9.94722058056396e-07"
## [1] "iteration 463: pi = 0.280081354057013; lambda = 2.27296315449529; last change = 9.79962194502804e-07"
## [1] "iteration 464: pi = 0.280080495407135; lambda = 2.27296218907398; last change = 9.65421314447212e-07"
## [1] "iteration 465: pi = 0.2800796495019; lambda = 2.27296123797781; last change = 9.51096169821142e-07"
## [1] "iteration 466: pi = 0.280078816152108; lambda = 2.27296030099425; last change = 9.36983562294103e-07"
## [1] "iteration 467: pi = 0.280077995171371; lambda = 2.27295937791391; last change = 9.23080337944526e-07"
## [1] "iteration 468: pi = 0.280077186376068; lambda = 2.27295846853052; last change = 9.09383390812479e-07"
## [1] "iteration 469: pi = 0.280076389585304; lambda = 2.27295757264086; last change = 8.95889662011484e-07"
## [1] "iteration 470: pi = 0.280075604620873; lambda = 2.27295669004472; last change = 8.82596134843538e-07"
## [1] "iteration 471: pi = 0.280074831307212; lambda = 2.27295582054488; last change = 8.69499844124988e-07"
## [1] "iteration 472: pi = 0.280074069471367; lambda = 2.27295496394702; last change = 8.56597858867048e-07"
## [1] "iteration 473: pi = 0.280073318942952; lambda = 2.27295412005972; last change = 8.43887299595281e-07"
## [1] "iteration 474: pi = 0.280072579554111; lambda = 2.27295328869439; last change = 8.31365327247369e-07"
## [1] "iteration 475: pi = 0.280071851139482; lambda = 2.27295246966525; last change = 8.19029141840844e-07"
## [1] "iteration 476: pi = 0.280071133536155; lambda = 2.27295166278926; last change = 8.06875989578515e-07"
## [1] "iteration 477: pi = 0.280070426583643; lambda = 2.2729508678861; last change = 7.94903154854865e-07"
## [1] "iteration 478: pi = 0.28006973012384; lambda = 2.27295008477814; last change = 7.83107962476493e-07"
## [1] "iteration 479: pi = 0.280069044000988; lambda = 2.27294931329036; last change = 7.71487777218027e-07"
## [1] "iteration 480: pi = 0.280068368061642; lambda = 2.27294855325036; last change = 7.60040002489859e-07"
## [1] "iteration 481: pi = 0.280067702154635; lambda = 2.27294780448828; last change = 7.48762081670407e-07"
## [1] "iteration 482: pi = 0.280067046131046; lambda = 2.27294706683679; last change = 7.37651494553404e-07"
## [1] "iteration 483: pi = 0.280066399844163; lambda = 2.27294634013103; last change = 7.26705758680168e-07"
## [1] "iteration 484: pi = 0.280065763149455; lambda = 2.2729456242086; last change = 7.15922428451421e-07"
## [1] "iteration 485: pi = 0.280065135904535; lambda = 2.2729449189095; last change = 7.05299095127288e-07"
## [1] "iteration 486: pi = 0.28006451796913; lambda = 2.27294422407612; last change = 6.94833385050941e-07"
## [1] "iteration 487: pi = 0.280063909205052; lambda = 2.27294353955316; last change = 6.84522959204514e-07"
## [1] "iteration 488: pi = 0.280063309476163; lambda = 2.27294286518765; last change = 6.74365514097275e-07"
## [1] "iteration 489: pi = 0.280062718648346; lambda = 2.27294220082886; last change = 6.6435878087745e-07"
## [1] "iteration 490: pi = 0.280062136589477; lambda = 2.27294154632834; last change = 6.54500523999957e-07"
## [1] "iteration 491: pi = 0.280061563169393; lambda = 2.2729409015398; last change = 6.44788539450047e-07"
## [1] "iteration 492: pi = 0.280060998259862; lambda = 2.27294026631914; last change = 6.35220657407842e-07"
## [1] "iteration 493: pi = 0.280060441734558; lambda = 2.2729396405244; last change = 6.25794741360153e-07"
## [1] "iteration 494: pi = 0.28005989346903; lambda = 2.27293902401572; last change = 6.16508684547767e-07"
## [1] "iteration 495: pi = 0.280059353340674; lambda = 2.27293841665531; last change = 6.07360411297719e-07"
## [1] "iteration 496: pi = 0.280058821228707; lambda = 2.27293781830743; last change = 5.98347877911465e-07"
## [1] "iteration 497: pi = 0.280058297014139; lambda = 2.27293722883836; last change = 5.89469071776705e-07"
## [1] "iteration 498: pi = 0.280057780579747; lambda = 2.27293664811635; last change = 5.80722006926493e-07"
## [1] "iteration 499: pi = 0.280057271810048; lambda = 2.27293607601162; last change = 5.72104731144663e-07"
## [1] "iteration 500: pi = 0.280056770591273; lambda = 2.2729355123963; last change = 5.63615316195865e-07"
## [1] "iteration 501: pi = 0.280056276811343; lambda = 2.27293495714444; last change = 5.5525186759553e-07"
## [1] "iteration 502: pi = 0.280055790359843; lambda = 2.27293441013192; last change = 5.47012514839906e-07"
## [1] "iteration 503: pi = 0.280055311127995; lambda = 2.2729338712365; last change = 5.38895418511487e-07"
## [1] "iteration 504: pi = 0.280054839008641; lambda = 2.27293334033774; last change = 5.30898763617671e-07"
## [1] "iteration 505: pi = 0.280054373896207; lambda = 2.27293281731698; last change = 5.230207622553e-07"
## [1] "iteration 506: pi = 0.280053915686693; lambda = 2.27293230205732; last change = 5.15259656275191e-07"
## [1] "iteration 507: pi = 0.280053464277638; lambda = 2.27293179444361; last change = 5.07613710620802e-07"
## [1] "iteration 508: pi = 0.280053019568104; lambda = 2.27293129436239; last change = 5.00081216436854e-07"
## [1] "iteration 509: pi = 0.280052581458653; lambda = 2.2729308017019; last change = 4.92660489737062e-07"
## [1] "iteration 510: pi = 0.280052149851321; lambda = 2.27293031635203; last change = 4.85349874512764e-07"
## [1] "iteration 511: pi = 0.280051724649598; lambda = 2.27292983820429; last change = 4.78147733851131e-07"
## [1] "iteration 512: pi = 0.28005130575841; lambda = 2.27292936715183; last change = 4.71052461925581e-07"
## [1] "iteration 513: pi = 0.28005089308409; lambda = 2.27292890308936; last change = 4.64062470673099e-07"
## [1] "iteration 514: pi = 0.280050486534365; lambda = 2.27292844591316; last change = 4.57176199120113e-07"
## [1] "iteration 515: pi = 0.28005008601833; lambda = 2.27292799552105; last change = 4.50392108053421e-07"
## [1] "iteration 516: pi = 0.280049691446431; lambda = 2.27292755181237; last change = 4.43708681796551e-07"
## [1] "iteration 517: pi = 0.280049302730441; lambda = 2.27292711468795; last change = 4.371244264334e-07"
## [1] "iteration 518: pi = 0.280048919783446; lambda = 2.27292668405008; last change = 4.30637870696415e-07"
## [1] "iteration 519: pi = 0.280048542519818; lambda = 2.27292625980251; last change = 4.24247565078417e-07"
## [1] "iteration 520: pi = 0.280048170855205; lambda = 2.27292584185043; last change = 4.17952081388506e-07"
## [1] "iteration 521: pi = 0.280047804706502; lambda = 2.27292543010042; last change = 4.11750014084333e-07"
## [1] "iteration 522: pi = 0.280047443991843; lambda = 2.27292502446044; last change = 4.05639973610761e-07"
## [1] "iteration 523: pi = 0.280047088630574; lambda = 2.27292462483984; last change = 3.9962059883436e-07"
## [1] "iteration 524: pi = 0.280046738543238; lambda = 2.2729242311493; last change = 3.9369054194438e-07"
## [1] "iteration 525: pi = 0.280046393651559; lambda = 2.27292384330082; last change = 3.87848478222708e-07"
## [1] "iteration 526: pi = 0.280046053878422; lambda = 2.27292346120772; last change = 3.82093102491154e-07"
## [1] "iteration 527: pi = 0.280045719147858; lambda = 2.27292308478459; last change = 3.76423129111458e-07"
## [1] "iteration 528: pi = 0.280045389385024; lambda = 2.2729227139473; last change = 3.70837288432568e-07"
## [1] "iteration 529: pi = 0.280045064516189; lambda = 2.27292234861297; last change = 3.6533433522834e-07"
## [1] "iteration 530: pi = 0.280044744468716; lambda = 2.27292198869993; last change = 3.59913037151216e-07"
## [1] "iteration 531: pi = 0.280044429171047; lambda = 2.27292163412774; last change = 3.54572185390367e-07"
## [1] "iteration 532: pi = 0.280044118552686; lambda = 2.27292128481716; last change = 3.49310583569462e-07"
## [1] "iteration 533: pi = 0.280043812544182; lambda = 2.2729209406901; last change = 3.4412705751663e-07"
## [1] "iteration 534: pi = 0.280043511077116; lambda = 2.27292060166966; last change = 3.39020447270855e-07"
## [1] "iteration 535: pi = 0.280043214084086; lambda = 2.27292026768004; last change = 3.33989614631491e-07"
## [1] "iteration 536: pi = 0.280042921498689; lambda = 2.27291993864661; last change = 3.29033431167858e-07"
## [1] "iteration 537: pi = 0.280042633255506; lambda = 2.27291961449582; last change = 3.24150792874178e-07"
## [1] "iteration 538: pi = 0.280042349290093; lambda = 2.27291929515521; last change = 3.19340605070551e-07"
## [1] "iteration 539: pi = 0.280042069538959; lambda = 2.27291898055342; last change = 3.1460179705789e-07"
## [1] "iteration 540: pi = 0.280041793939558; lambda = 2.27291867062011; last change = 3.09933304798449e-07"
## [1] "iteration 541: pi = 0.28004152243027; lambda = 2.27291836528602; last change = 3.05334089567566e-07"
## [1] "iteration 542: pi = 0.280041254950392; lambda = 2.2729180644829; last change = 3.00803120190096e-07"
## [1] "iteration 543: pi = 0.280040991440121; lambda = 2.27291776814352; last change = 2.96339385474909e-07"
## [1] "iteration 544: pi = 0.280040731840541; lambda = 2.27291747620163; last change = 2.91941887997638e-07"
## [1] "iteration 545: pi = 0.280040476093611; lambda = 2.27291718859198; last change = 2.87609643656594e-07"
## [1] "iteration 546: pi = 0.280040224142153; lambda = 2.2729169052503; last change = 2.83341686113658e-07"
## [1] "iteration 547: pi = 0.280039975929835; lambda = 2.27291662611324; last change = 2.79137058800671e-07"
## [1] "iteration 548: pi = 0.280039731401163; lambda = 2.27291635111841; last change = 2.74994826021668e-07"
## [1] "iteration 549: pi = 0.280039490501466; lambda = 2.27291608020436; last change = 2.70914057409755e-07"
## [1] "iteration 550: pi = 0.280039253176885; lambda = 2.27291581331051; last change = 2.66893844358407e-07"
## [1] "iteration 551: pi = 0.28003901937436; lambda = 2.27291555037722; last change = 2.62933287142886e-07"
## [1] "iteration 552: pi = 0.280038789041619; lambda = 2.27291529134572; last change = 2.59031500249307e-07"
## [1] "iteration 553: pi = 0.280038562127165; lambda = 2.27291503615811; last change = 2.55187611486463e-07"
## [1] "iteration 554: pi = 0.280038338580267; lambda = 2.27291478475735; last change = 2.51400763318088e-07"
## [1] "iteration 555: pi = 0.280038118350945; lambda = 2.27291453708724; last change = 2.47670107533793e-07"
## [1] "iteration 556: pi = 0.280037901389961; lambda = 2.27291429309243; last change = 2.43994811910397e-07"
## [1] "iteration 557: pi = 0.28003768764881; lambda = 2.27291405271838; last change = 2.40374053106507e-07"
## [1] "iteration 558: pi = 0.280037477079706; lambda = 2.27291381591135; last change = 2.36807024212027e-07"
## [1] "iteration 559: pi = 0.28003726963557; lambda = 2.27291358261843; last change = 2.33292924978201e-07"
## [1] "iteration 560: pi = 0.280037065270024; lambda = 2.27291335278745; last change = 2.2983097425211e-07"
## [1] "iteration 561: pi = 0.280036863937379; lambda = 2.27291312636706; last change = 2.26420393989457e-07"
## [1] "iteration 562: pi = 0.280036665592622; lambda = 2.27291290330664; last change = 2.23060423909516e-07"
## [1] "iteration 563: pi = 0.28003647019141; lambda = 2.27291268355632; last change = 2.19750313057432e-07"
## [1] "iteration 564: pi = 0.280036277690057; lambda = 2.272912467067; last change = 2.16489322024671e-07"
## [1] "iteration 565: pi = 0.280036088045526; lambda = 2.27291225379028; last change = 2.13276721172662e-07"
## [1] "iteration 566: pi = 0.280035901215418; lambda = 2.27291204367849; last change = 2.10111791076883e-07"
## [1] "iteration 567: pi = 0.280035717157964; lambda = 2.27291183668466; last change = 2.06993828300028e-07"
## [1] "iteration 568: pi = 0.280035535832015; lambda = 2.27291163276253; last change = 2.03922131625234e-07"
## [1] "iteration 569: pi = 0.280035357197032; lambda = 2.27291143186651; last change = 2.00896017599206e-07"
## [1] "iteration 570: pi = 0.280035181213079; lambda = 2.2729112339517; last change = 1.97914808097721e-07"
## [1] "iteration 571: pi = 0.280035007840812; lambda = 2.27291103897386; last change = 1.94977837875143e-07"
## [1] "iteration 572: pi = 0.28003483704147; lambda = 2.27291084688941; last change = 1.92084449679442e-07"
## [1] "iteration 573: pi = 0.280034668776868; lambda = 2.27291065765542; last change = 1.89233997804905e-07"
## [1] "iteration 574: pi = 0.280034503009389; lambda = 2.27291047122957; last change = 1.86425843207161e-07"
## [1] "iteration 575: pi = 0.280034339701973; lambda = 2.27291028757021; last change = 1.83659360608601e-07"
## [1] "iteration 576: pi = 0.28003417881811; lambda = 2.27291010663628; last change = 1.80933930504779e-07"
## [1] "iteration 577: pi = 0.280034020321832; lambda = 2.27290992838734; last change = 1.78248943605297e-07"
## [1] "iteration 578: pi = 0.280033864177706; lambda = 2.27290975278354; last change = 1.75603799501545e-07"
## [1] "iteration 579: pi = 0.280033710350823; lambda = 2.27290957978563; last change = 1.7299790888714e-07"
## [1] "iteration 580: pi = 0.280033558806793; lambda = 2.27290940935494; last change = 1.70430686008416e-07"
## [1] "iteration 581: pi = 0.280033409511736; lambda = 2.27290924145338; last change = 1.67901560210737e-07"
## [1] "iteration 582: pi = 0.280033262432277; lambda = 2.27290907604342; last change = 1.65409965280361e-07"
## [1] "iteration 583: pi = 0.280033117535533; lambda = 2.27290891308808; last change = 1.62955342553062e-07"
## [1] "iteration 584: pi = 0.280032974789111; lambda = 2.27290875255093; last change = 1.605371462432e-07"
## [1] "iteration 585: pi = 0.280032834161099; lambda = 2.2729085943961; last change = 1.58154833229673e-07"
## [1] "iteration 586: pi = 0.280032695620057; lambda = 2.27290843858822; last change = 1.55807872825875e-07"
## [1] "iteration 587: pi = 0.280032559135014; lambda = 2.27290828509248; last change = 1.5349573967427e-07"
## [1] "iteration 588: pi = 0.280032424675457; lambda = 2.27290813387457; last change = 1.51217917299107e-07"
## [1] "iteration 589: pi = 0.280032292211326; lambda = 2.27290798490067; last change = 1.48973896330062e-07"
## [1] "iteration 590: pi = 0.280032161713007; lambda = 2.2729078381375; last change = 1.46763174946329e-07"
## [1] "iteration 591: pi = 0.280032033151326; lambda = 2.27290769355224; last change = 1.44585259764796e-07"
## [1] "iteration 592: pi = 0.280031906497542; lambda = 2.27290755111257; last change = 1.42439663619598e-07"
## [1] "iteration 593: pi = 0.280031781723341; lambda = 2.27290741078667; last change = 1.40325906006211e-07"
## [1] "iteration 594: pi = 0.280031658800827; lambda = 2.27290727254315; last change = 1.38243516634162e-07"
## [1] "iteration 595: pi = 0.280031537702522; lambda = 2.27290713635112; last change = 1.36192027877513e-07"
## [1] "iteration 596: pi = 0.280031418401351; lambda = 2.27290700218014; last change = 1.34170982324378e-07"
## [1] "iteration 597: pi = 0.280031300870645; lambda = 2.27290687000021; last change = 1.3217992789194e-07"
## [1] "iteration 598: pi = 0.280031185084129; lambda = 2.27290673978179; last change = 1.30218419158723e-07"
## [1] "iteration 599: pi = 0.280031071015918; lambda = 2.27290661149577; last change = 1.28286018252766e-07"
## [1] "iteration 600: pi = 0.28003095864051; lambda = 2.27290648511348; last change = 1.26382294407534e-07"
## [1] "iteration 601: pi = 0.280030847932784; lambda = 2.27290636060666; last change = 1.24506819521031e-07"
## [1] "iteration 602: pi = 0.280030738867991; lambda = 2.27290623794748; last change = 1.22659176149398e-07"
## [1] "iteration 603: pi = 0.280030631421747; lambda = 2.27290611710853; last change = 1.20838950401492e-07"
## [1] "iteration 604: pi = 0.280030525570034; lambda = 2.2729059980628; last change = 1.19045735935686e-07"
## [1] "iteration 605: pi = 0.280030421289186; lambda = 2.27290588078366; last change = 1.1727913307169e-07"
## [1] "iteration 606: pi = 0.280030318555892; lambda = 2.27290576524492; last change = 1.15538744349664e-07"
## [1] "iteration 607: pi = 0.280030217347185; lambda = 2.27290565142074; last change = 1.13824182523814e-07"
## [1] "iteration 608: pi = 0.280030117640439; lambda = 2.27290553928567; last change = 1.12135064345154e-07"
## [1] "iteration 609: pi = 0.280030019413365; lambda = 2.27290542881466; last change = 1.10471011005586e-07"
## [1] "iteration 610: pi = 0.280029922644002; lambda = 2.27290531998301; last change = 1.088316525788e-07"
## [1] "iteration 611: pi = 0.280029827310718; lambda = 2.27290521276639; last change = 1.07216620470751e-07"
## [1] "iteration 612: pi = 0.280029733392201; lambda = 2.27290510714083; last change = 1.05625555413269e-07"
## [1] "iteration 613: pi = 0.280029640867455; lambda = 2.27290500308273; last change = 1.04058099914539e-07"
## [1] "iteration 614: pi = 0.280029549715796; lambda = 2.27290490056883; last change = 1.0251390625271e-07"
## [1] "iteration 615: pi = 0.280029459916846; lambda = 2.2729047995762; last change = 1.00992626705931e-07"
## [1] "iteration 616: pi = 0.28002937145053; lambda = 2.27290470008228; last change = 9.94939233223135e-08"
## [1] "iteration 617: pi = 0.280029284297072; lambda = 2.27290460206482; last change = 9.80174581499682e-08"
## [1] "iteration 618: pi = 0.280029198436988; lambda = 2.27290450550191; last change = 9.65629052274153e-08"
## [1] "iteration 619: pi = 0.280029113851083; lambda = 2.27290441037198; last change = 9.51299354845503e-08"
## [1] "iteration 620: pi = 0.280029030520449; lambda = 2.27290431665375; last change = 9.37182318416774e-08"
## [1] "iteration 621: pi = 0.280028948426457; lambda = 2.27290422432627; last change = 9.23274767750115e-08"
## [1] "iteration 622: pi = 0.280028867550754; lambda = 2.27290413336891; last change = 9.09573589780166e-08"
## [1] "iteration 623: pi = 0.28002878787526; lambda = 2.27290404376134; last change = 8.96075746936731e-08"
## [1] "iteration 624: pi = 0.280028709382164; lambda = 2.27290395548352; last change = 8.82778197208722e-08"
## [1] "iteration 625: pi = 0.280028632053919; lambda = 2.27290386851572; last change = 8.69677978521111e-08"
## [1] "iteration 626: pi = 0.280028555873237; lambda = 2.2729037828385; last change = 8.56772168766895e-08"
## [1] "iteration 627: pi = 0.280028480823088; lambda = 2.27290369843272; last change = 8.44057868043535e-08"
## [1] "iteration 628: pi = 0.280028406886695; lambda = 2.27290361527949; last change = 8.31532247502764e-08"
## [1] "iteration 629: pi = 0.280028334047529; lambda = 2.27290353336024; last change = 8.19192500500776e-08"
## [1] "iteration 630: pi = 0.280028262289307; lambda = 2.27290345265665; last change = 8.07035864802685e-08"
## [1] "iteration 631: pi = 0.280028191595988; lambda = 2.27290337315069; last change = 7.95059649227881e-08"
## [1] "iteration 632: pi = 0.280028121951767; lambda = 2.27290329482458; last change = 7.83261131509505e-08"
## [1] "iteration 633: pi = 0.280028053341076; lambda = 2.2729032176608; last change = 7.71637713725681e-08"
## [1] "iteration 634: pi = 0.280027985748576; lambda = 2.27290314164213; last change = 7.60186780190963e-08"
## [1] "iteration 635: pi = 0.280027919159159; lambda = 2.27290306675155; last change = 7.48905777392395e-08"
## [1] "iteration 636: pi = 0.280027853557936; lambda = 2.27290299297233; last change = 7.37792169580587e-08"
## [1] "iteration 637: pi = 0.280027788930244; lambda = 2.27290292028798; last change = 7.26843500942209e-08"
## [1] "iteration 638: pi = 0.280027725261634; lambda = 2.27290284868225; last change = 7.16057293459471e-08"
## [1] "iteration 639: pi = 0.280027662537874; lambda = 2.27290277813914; last change = 7.05431153491531e-08"
## [1] "iteration 640: pi = 0.280027600744942; lambda = 2.27290270864287; last change = 6.94962705161117e-08"
## [1] "iteration 641: pi = 0.280027539869024; lambda = 2.27290264017791; last change = 6.84649603677201e-08"
## [1] "iteration 642: pi = 0.280027479896511; lambda = 2.27290257272895; last change = 6.74489544216783e-08"
## [1] "iteration 643: pi = 0.280027420813996; lambda = 2.27290250628093; last change = 6.64480253043109e-08"
## [1] "iteration 644: pi = 0.280027362608272; lambda = 2.27290244081898; last change = 6.54619500828346e-08"
## [1] "iteration 645: pi = 0.280027305266327; lambda = 2.27290237632847; last change = 6.44905076008229e-08"
## [1] "iteration 646: pi = 0.280027248775342; lambda = 2.27290231279499; last change = 6.35334820309197e-08"
## [1] "iteration 647: pi = 0.280027193122688; lambda = 2.27290225020433; last change = 6.25906566575907e-08"
## [1] "iteration 648: pi = 0.280027138295925; lambda = 2.27290218854251; last change = 6.16618240911748e-08"
## [1] "iteration 649: pi = 0.280027084282796; lambda = 2.27290212779573; last change = 6.07467751656543e-08"
## [1] "iteration 650: pi = 0.280027031071226; lambda = 2.27290206795043; last change = 5.98453038236357e-08"
## [1] "iteration 651: pi = 0.280026978649321; lambda = 2.27290200899322; last change = 5.89572111131531e-08"
## [1] "iteration 652: pi = 0.280026927005361; lambda = 2.27290195091092; last change = 5.8082297194062e-08"
## [1] "iteration 653: pi = 0.280026876127801; lambda = 2.27290189369055; last change = 5.72203666671101e-08"
## [1] "iteration 654: pi = 0.280026826005268; lambda = 2.27290183731933; last change = 5.63712272416694e-08"
## [1] "iteration 655: pi = 0.280026776626558; lambda = 2.27290178178464; last change = 5.55346884034691e-08"
## [1] "iteration 656: pi = 0.28002672798063; lambda = 2.27290172707407; last change = 5.47105640791301e-08"
## [1] "iteration 657: pi = 0.280026680056612; lambda = 2.2729016731754; last change = 5.3898669083452e-08"
## [1] "iteration 658: pi = 0.28002663284379; lambda = 2.27290162007658; last change = 5.30988226721263e-08"
## [1] "iteration 659: pi = 0.280026586331609; lambda = 2.27290156776574; last change = 5.23108454331123e-08"
## [1] "iteration 660: pi = 0.280026540509671; lambda = 2.27290151623117; last change = 5.15345615070828e-08"
## [1] "iteration 661: pi = 0.280026495367734; lambda = 2.27290146546138; last change = 5.07697981433353e-08"
## [1] "iteration 662: pi = 0.280026450895706; lambda = 2.27290141544499; last change = 5.00163830352562e-08"
## [1] "iteration 663: pi = 0.280026407083645; lambda = 2.27290136617084; last change = 4.92741487612136e-08"
## [1] "iteration 664: pi = 0.280026363921757; lambda = 2.27290131762792; last change = 4.85429287877537e-08"
## [1] "iteration 665: pi = 0.280026321400394; lambda = 2.27290126980536; last change = 4.7822559245958e-08"
## [1] "iteration 666: pi = 0.280026279510051; lambda = 2.27290122269247; last change = 4.71128820400679e-08"
## [1] "iteration 667: pi = 0.280026238241362; lambda = 2.27290117627874; last change = 4.64137337452541e-08"
## [1] "iteration 668: pi = 0.280026197585102; lambda = 2.27290113055378; last change = 4.57249615948285e-08"
## [1] "iteration 669: pi = 0.280026157532183; lambda = 2.27290108550737; last change = 4.5046411045746e-08"
## [1] "iteration 670: pi = 0.280026118073651; lambda = 2.27290104112944; last change = 4.43779297754077e-08"
## [1] "iteration 671: pi = 0.280026079200685; lambda = 2.27290099741007; last change = 4.37193681257497e-08"
## [1] "iteration 672: pi = 0.280026040904595; lambda = 2.27290095433949; last change = 4.30705804355114e-08"
## [1] "iteration 673: pi = 0.280026003176821; lambda = 2.27290091190807; last change = 4.24314197111642e-08"
## [1] "iteration 674: pi = 0.280025966008928; lambda = 2.27290087010633; last change = 4.18017438441609e-08"
## [1] "iteration 675: pi = 0.280025929392608; lambda = 2.27290082892491; last change = 4.11814129464005e-08"
## [1] "iteration 676: pi = 0.280025893319675; lambda = 2.27290078835463; last change = 4.05702875738712e-08"
## [1] "iteration 677: pi = 0.280025857782066; lambda = 2.27290074838639; last change = 3.99682300589177e-08"
## [1] "iteration 678: pi = 0.280025822771836; lambda = 2.27290070901129; last change = 3.93751085070448e-08"
## [1] "iteration 679: pi = 0.280025788281158; lambda = 2.2729006702205; last change = 3.87907874710436e-08"
## [1] "iteration 680: pi = 0.280025754302323; lambda = 2.27290063200536; last change = 3.82151386091323e-08"
## [1] "iteration 681: pi = 0.280025720827735; lambda = 2.27290059435733; last change = 3.76480313590832e-08"
## [1] "iteration 682: pi = 0.28002568784991; lambda = 2.27290055726799; last change = 3.70893404877393e-08"
## [1] "iteration 683: pi = 0.280025655361477; lambda = 2.27290052072905; last change = 3.6538940317854e-08"
## [1] "iteration 684: pi = 0.280025623355173; lambda = 2.27290048473234; last change = 3.59967073926271e-08"
## [1] "iteration 685: pi = 0.280025591823842; lambda = 2.27290044926982; last change = 3.5462522252061e-08"
## [1] "iteration 686: pi = 0.280025560760438; lambda = 2.27290041433356; last change = 3.49362632157124e-08"
## [1] "iteration 687: pi = 0.280025530158014; lambda = 2.27290037991574; last change = 3.44178143762974e-08"
## [1] "iteration 688: pi = 0.280025500009731; lambda = 2.27290034600868; last change = 3.39070593824431e-08"
## [1] "iteration 689: pi = 0.280025470308849; lambda = 2.2729003126048; last change = 3.34038827709549e-08"
## [1] "iteration 690: pi = 0.280025441048728; lambda = 2.27290027969662; last change = 3.29081744077087e-08"
## [1] "iteration 691: pi = 0.280025412222827; lambda = 2.2729002472768; last change = 3.24198223822236e-08"
## [1] "iteration 692: pi = 0.280025383824703; lambda = 2.27290021533809; last change = 3.19387161162865e-08"
## [1] "iteration 693: pi = 0.280025355848007; lambda = 2.27290018387334; last change = 3.14647499166654e-08"
## [1] "iteration 694: pi = 0.280025328286486; lambda = 2.27290015287552; last change = 3.0997817646039e-08"
## [1] "iteration 695: pi = 0.280025301133978; lambda = 2.2729001223377; last change = 3.05378149434432e-08"
## [1] "iteration 696: pi = 0.280025274384412; lambda = 2.27290009225307; last change = 3.00846374479136e-08"
## [1] "iteration 697: pi = 0.280025248031811; lambda = 2.27290006261488; last change = 2.96381856834671e-08"
## [1] "iteration 698: pi = 0.280025222070282; lambda = 2.27290003341652; last change = 2.91983592859424e-08"
## [1] "iteration 699: pi = 0.280025196494022; lambda = 2.27290000465146; last change = 2.87650596675348e-08"
## [1] "iteration 700: pi = 0.280025171297313; lambda = 2.27289997631327; last change = 2.83381895727075e-08"
## [1] "iteration 701: pi = 0.280025146474524; lambda = 2.27289994839562; last change = 2.79176552986371e-08"
## [1] "iteration 702: pi = 0.280025122020104; lambda = 2.27289992089226; last change = 2.75033604779651e-08"
## [1] "iteration 703: pi = 0.280025097928588; lambda = 2.27289989379704; last change = 2.70952145164927e-08"
## [1] "iteration 704: pi = 0.28002507419459; lambda = 2.27289986710392; last change = 2.66931254877534e-08"
## [1] "iteration 705: pi = 0.280025050812804; lambda = 2.27289984080691; last change = 2.62970023534592e-08"
## [1] "iteration 706: pi = 0.280025027778004; lambda = 2.27289981490016; last change = 2.59067585162143e-08"
## [1] "iteration 707: pi = 0.280025005085039; lambda = 2.27289978937785; last change = 2.5522306046355e-08"
## [1] "iteration 708: pi = 0.280024982728838; lambda = 2.27289976423429; last change = 2.51435583464854e-08"
## [1] "iteration 709: pi = 0.280024960704403; lambda = 2.27289973946386; last change = 2.47704305955665e-08"
## [1] "iteration 710: pi = 0.28002493900681; lambda = 2.27289971506102; last change = 2.44028410811836e-08"
## [1] "iteration 711: pi = 0.280024917631209; lambda = 2.27289969102031; last change = 2.40407058704761e-08"
## [1] "iteration 712: pi = 0.280024896572821; lambda = 2.27289966733637; last change = 2.3683944583297e-08"
## [1] "iteration 713: pi = 0.28002487582694; lambda = 2.27289964400389; last change = 2.33324786158562e-08"
## [1] "iteration 714: pi = 0.280024855388927; lambda = 2.27289962101766; last change = 2.29862275880066e-08"
## [1] "iteration 715: pi = 0.280024835254214; lambda = 2.27289959837255; last change = 2.26451137841366e-08"
## [1] "iteration 716: pi = 0.280024815418299; lambda = 2.27289957606348; last change = 2.23090639295265e-08"
## [1] "iteration 717: pi = 0.280024795876749; lambda = 2.27289955408548; last change = 2.19780003085646e-08"
## [1] "iteration 718: pi = 0.280024776625195; lambda = 2.27289953243364; last change = 2.1651849202442e-08"
## [1] "iteration 719: pi = 0.280024757659334; lambda = 2.2728995111031; last change = 2.13305386687068e-08"
## [1] "iteration 720: pi = 0.280024738974925; lambda = 2.2728994900891; last change = 2.10139958767286e-08"
## [1] "iteration 721: pi = 0.280024720567793; lambda = 2.27289946938695; last change = 2.07021506604121e-08"
## [1] "iteration 722: pi = 0.280024702433822; lambda = 2.27289944899202; last change = 2.03949332977515e-08"
## [1] "iteration 723: pi = 0.280024684568958; lambda = 2.27289942889974; last change = 2.00922749549193e-08"
## [1] "iteration 724: pi = 0.280024666969209; lambda = 2.27289940910563; last change = 1.97941090185338e-08"
## [1] "iteration 725: pi = 0.28002464963064; lambda = 2.27289938960527; last change = 1.95003653225001e-08"
## [1] "iteration 726: pi = 0.280024632549374; lambda = 2.27289937039428; last change = 1.92109830265963e-08"
## [1] "iteration 727: pi = 0.280024615721594; lambda = 2.27289935146839; last change = 1.89258941851733e-08"
## [1] "iteration 728: pi = 0.280024599143537; lambda = 2.27289933282335; last change = 1.86450361816526e-08"
## [1] "iteration 729: pi = 0.280024582811498; lambda = 2.27289931445501; last change = 1.83683455112771e-08"
## [1] "iteration 730: pi = 0.280024566721827; lambda = 2.27289929635925; last change = 1.80957622220035e-08"
## [1] "iteration 731: pi = 0.280024550870925; lambda = 2.27289927853202; last change = 1.7827223253164e-08"
## [1] "iteration 732: pi = 0.28002453525525; lambda = 2.27289926096935; last change = 1.75626686527153e-08"
## [1] "iteration 733: pi = 0.280024519871311; lambda = 2.27289924366731; last change = 1.73020415772385e-08"
## [1] "iteration 734: pi = 0.28002450471567; lambda = 2.27289922662203; last change = 1.70452802983334e-08"
## [1] "iteration 735: pi = 0.280024489784937; lambda = 2.2728992098297; last change = 1.67923310812057e-08"
## [1] "iteration 736: pi = 0.280024475075776; lambda = 2.27289919328657; last change = 1.65431344179012e-08"
## [1] "iteration 737: pi = 0.280024460584898; lambda = 2.27289917698893; last change = 1.62976370177148e-08"
## [1] "iteration 738: pi = 0.280024446309065; lambda = 2.27289916093315; last change = 1.60557811490492e-08"
## [1] "iteration 739: pi = 0.280024432245084; lambda = 2.27289914511563; last change = 1.58175152975559e-08"
## [1] "iteration 740: pi = 0.280024418389812; lambda = 2.27289912953285; last change = 1.55827848402623e-08"
## [1] "iteration 741: pi = 0.280024404740152; lambda = 2.27289911418131; last change = 1.53515387069092e-08"
## [1] "iteration 742: pi = 0.280024391293052; lambda = 2.27289909905759; last change = 1.51237231627022e-08"
## [1] "iteration 743: pi = 0.280024378045506; lambda = 2.2728990841583; last change = 1.48992889137389e-08"
## [1] "iteration 744: pi = 0.280024364994554; lambda = 2.27289906948011; last change = 1.46781853338496e-08"
## [1] "iteration 745: pi = 0.280024352137277; lambda = 2.27289905501975; last change = 1.44603626850426e-08"
## [1] "iteration 746: pi = 0.280024339470802; lambda = 2.27289904077398; last change = 1.42457721175049e-08"
## [1] "iteration 747: pi = 0.280024326992296; lambda = 2.27289902673961; last change = 1.40343670018694e-08"
## [1] "iteration 748: pi = 0.280024314698971; lambda = 2.27289901291351; last change = 1.3826098044234e-08"
## [1] "iteration 749: pi = 0.280024302588078; lambda = 2.27289899929259; last change = 1.36209203915882e-08"
## [1] "iteration 750: pi = 0.28002429065691; lambda = 2.2728989858738; last change = 1.34187874145653e-08"
## [1] "iteration 751: pi = 0.280024278902801; lambda = 2.27289897265415; last change = 1.32196542601548e-08"
## [1] "iteration 752: pi = 0.280024267323121; lambda = 2.27289895963068; last change = 1.30234756312575e-08"
## [1] "iteration 753: pi = 0.280024255915284; lambda = 2.27289894680047; last change = 1.28302093393984e-08"
## [1] "iteration 754: pi = 0.280024244676738; lambda = 2.27289893416066; last change = 1.26398100874781e-08"
## [1] "iteration 755: pi = 0.280024233604972; lambda = 2.27289892170842; last change = 1.24522365752e-08"
## [1] "iteration 756: pi = 0.28002422269751; lambda = 2.27289890944097; last change = 1.22674466140893e-08"
## [1] "iteration 757: pi = 0.280024211951914; lambda = 2.27289889735557; last change = 1.20853989038494e-08"
## [1] "iteration 758: pi = 0.280024201365783; lambda = 2.27289888544952; last change = 1.19060534764515e-08"
## [1] "iteration 759: pi = 0.280024190936749; lambda = 2.27289887372015; last change = 1.17293685875097e-08"
## [1] "iteration 760: pi = 0.280024180662481; lambda = 2.27289886216485; last change = 1.15553060453522e-08"
## [1] "iteration 761: pi = 0.280024170540683; lambda = 2.27289885078102; last change = 1.13838263260391e-08"
## [1] "iteration 762: pi = 0.280024160569092; lambda = 2.27289883956613; last change = 1.12148916819876e-08"
## [1] "iteration 763: pi = 0.280024150745479; lambda = 2.27289882851766; last change = 1.10484639215258e-08"
## [1] "iteration 764: pi = 0.280024141067648; lambda = 2.27289881763316; last change = 1.088450574116e-08"
## [1] "iteration 765: pi = 0.280024131533435; lambda = 2.27289880691018; last change = 1.07229811696641e-08"
## [1] "iteration 766: pi = 0.280024122140709; lambda = 2.27289879634632; last change = 1.05638533476338e-08"
## [1] "iteration 767: pi = 0.280024112887371; lambda = 2.27289878593924; last change = 1.04070858597538e-08"
## [1] "iteration 768: pi = 0.280024103771352; lambda = 2.27289877568659; last change = 1.02526471756903e-08"
## [1] "iteration 769: pi = 0.280024094790614; lambda = 2.27289876558609; last change = 1.01004977715036e-08"
## [1] "iteration 770: pi = 0.28002408594315; lambda = 2.27289875563548; last change = 9.95060789321656e-09"
Here are plots of the distribution estimates at each step of the Newton optimization procedure:
zip_pm <- function(x, pi, lambda) {
return(
ifelse(x == 0, pi, 0) + (1 - pi)*dpois(x, lambda)
)
}
zinf_fit <- purrr::map_dfr(
seq_len(i - 1),
function(i) {
data.frame(
x = seq(from = 0, to = max(Arrests$checks)),
pmf = zip_pm(seq(from = 0, to = max(Arrests$checks)), pi_history[i], lambda_history[i]),
iteration = i
)
}
)
ggplot(data = Arrests, mapping = aes(x = checks, y = ..density..)) +
geom_histogram(binwidth = 1) +
geom_point(data = zinf_fit, mapping = aes(x = x, y = pmf, group = iteration, color = iteration)) +
geom_line(data = zinf_fit, mapping = aes(x = x, y = pmf, group = iteration, color = iteration)) +
scale_color_gradientn(colors = c("blue", "purple", "orange"), values = c(0, 0.05, 1)) +
theme_bw()
Here’s a plot of the Taylor-series approximation to the log-likelihood used at the first iteration:
Here’s a 3d plot of the likelihood function (orange and green) and the Taylor approximation at the starting point (purple and pink):