[R] joint estimation of two poisson equations
tirthankar.chakravarty at gmail.com
Mon Apr 13 10:49:18 CEST 2009
You should probably try the -bivpois- package:
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.
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.
> # CODE FOR "sur" OPTION
> rm(list = ls())
> 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)
> # ERROR FROM REPLACING "sur" WITH "poisson"
> Error in switch(mode(x), `NULL` = structure(NULL, class = "formula"), :
> invalid formula
> Owen Powell
> R-help at r-project.org mailing list
> 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).
More information about the R-help