[R] joint estimation of two poisson equations

Owen Powell opowell at gmail.com
Mon Apr 13 10:32:23 CEST 2009


Dear list members,

Is there a package somewhere for jointly estimating two poisson processes?

I think the closest I've come is using the "SUR" option in the Zelig
package (see below), but when I try the "poisson" option instead of
the "SUR" optioin I get an error (error given below, and indeed,
reading the documentation of the Zelig package, I get the impression
"poisson" was not meant to handle a system of equations).

I think I could do it myself by constructing the likelihood function
and then applying ML, but I'd prefer to avoid doing that unless it's
entirely necessary.

I'll post my solution to the list when I've worked it out.

Regards,

~Owen

# CODE FOR "sur" OPTION
rm(list = ls())
library(Zelig)

y1 = c(1,2,3,4)
y2 = c(0,2,0,2)
x = c(2,3,4,8)
d = data.frame(cbind(y1, y2, x))

eq1 = y1 ~ x
eq2 = y2 ~ x
eqSystem = list (eq1, eq2)

system_out = zelig(formula = eqSystem, model = "sur", data = d)
summary(system_out)

-----------------------------------------------------------------

# ERROR FROM REPLACING "sur" WITH "poisson"
Error in switch(mode(x), `NULL` = structure(NULL, class = "formula"),  :
  invalid formula

--
Owen Powell
http://center.uvt.nl/phd_stud/powell




More information about the R-help mailing list