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
joint estimation of two poisson equations
3 messages · Owen Powell, Tirthankar Chakravarty
You should probably try the -bivpois- package: http://cran.r-project.org/web/packages/bivpois/index.html A very good discussion of multivariate Poissons, negative binomials etc. can be found in Chapter 7 of Rainer Winkelmann's book "Econometric Analysis of Count Data" (Springer 2008). Most of the likelihoods involved are fairly straightforward. T
On Mon, Apr 13, 2009 at 9:32 AM, Owen Powell <opowell at gmail.com> wrote:
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
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
To every ?-consistent recursive class ? of formulae there correspond recursive class signs r, such that neither v Gen r nor Neg(v Gen r) belongs to Flg(?) (where v is the free variable of r).
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090413/cb45e933/attachment-0001.pl>