/* ** count9.e ** ** Poisson regression model with unobserved dependent variables ** ** data are randomly generated. */ library count; #include count.ext; countset; rndseed 3145367; n = 50; o = ones(n,1); x1 = rndu(n,2); x2 = rndu(n,1); x3 = rndu(n,1); b1 = { 1, 1.2, .5 }; b2 = { .2, .2 }; b3 = { .2, .2 }; lam1 = exp((o~x1)*b1); lam2 = exp((o~x2)*b2); lam3 = exp((o~x3)*b3); u = rndp(n,1,lam3); y1 = rndp(n,1,lam1) + u; y2 = rndp(n,1,lam2) + u; data = y1~y2~x1~x2~x3; output file = count9.out reset; __output = 5; _max_GradStep = 1e-3; /* ** Uncommenting the following line ** causes the iterations to terminate ** earlier. At the default setting ** the computation of the H-S covariance ** matrix of the parameters fails. */ _max_GradTol = 1e-4; call countprt(supreme2(data,1,2,3|4,5,6)); output off;