lm.bp{bivpois} |
R Documentation |
Produces a
"list" object which gives details regarding the fit of a bivariate
Poisson regression model of the form
(Xi,Yi)
~ BP( ë1i, ë2i,
ë3i )
with |
log(ë1) = w1 â1 |
log(ë2) = w2 â2 |
log(ë3) = w3 â3 |
where
Ø
i =1, 2, … , n; n is the sample size
Ø
ë1 = ( ë11,
ë12, … , ë1n )T, ë2 = ( ë21, ë22, … , ë2n )T and ë3 = ( ë31, ë32, … , ë3n )T are vectors
of length n with the estimated lambda for each observation
Ø
w1, w2 are n´p data matrices containing
explanatory variables for ë1 and ë2 .
Ø
w3 are n´p2 data matrix containing explanatory variables for ë3.
Ø
â1 â2 â3 Parameter vectors used
in the linear predictors of ë1 ë2 and ë3
lm.bp( x, y, formula1=y1y2~., formula2=y3~1, data, zeroL3=FALSE, maxit=300, pres=1e-8, print.details=FALSE )
x, y |
names (character
objects) of response vectors. |
data |
Data frame containing
the variables in the model. |
formula1=y1y2~.
|
Formula type argument
specifying the terms used for the linear predictors of ë1
and ë2 . The default value fits a model with all
explanatory variables of the data frame specified in data argument, having different non-equal effects on ë1
and ë2. For details on using formulas see bpformulas.html . |
formula2=y3~1 |
Formula type argument
specifying the terms used for the linear predictor of ë3. The default value fits a model with constant
covariance term. |
zeroL3=FALSE |
Logical argument
controlling whether ë3 should be set equal
to zero (therefore fits a double Poisson model). |
maxit=300 |
Maximum number of EM
steps. Default value is 300 iterations. |
Pres
=1e-8 |
Precision used in
stopping the EM algorithm. The algorithm stops when the relative
log-likelihood difference is lower than the value of pres. |
print.details=FALSE |
Argument for
controlling the printing details during the iterations of the EM algorithm.
The default is to print only the iteration number, the loglikelihood and its
relative difference from the previous iteration. If print.details=TRUE then the model parameters
â1, â2 and â3 are additionally printed. |
A list object returned
with the following variables.
beta |
Estimates of the model
parameters for â1, â2 and â3 . When a factor is used then its
default set of constraints is used. |
Beta1,beta2,
beta3 |
Vectors â1, â2 and â3 containing the coefficients
involved in the linear predictors
of ë1
, ë2 and ë3 respectively. When zeroL3=TRUE then this beta3 is not calculated. |
lambda1,
lambda2 |
Vectors of length n
containing the estimated ë1 and ë2 for each observation |
lambda3 |
vector containing the
values of ë3. If zeroL3=TRUE then lambda3 is equal
to zero and is not calculated. |
fitted1,
fitted2 |
Vectors of length n containing the fitted values for
x and y. For the bivariate Poisson model
the fitted values are given by ë1+ë3
and ë2+ë3 respectively. |
loglikelihood |
Maximized
log-likelihood of the fitted model. This is given in a vector form (one value
per iteration).With this vector we can monitor the log-likelihood improvement
and how EM algorithm works. |
AIC,
BIC |
AIC and BIC of the
model. Values are also provided for the double Poisson model and the
saturated model. |
parameters |
Number of parameters |
iterations |
Number of iterations |
See bpformulas.html for help concerning the formulas
objects above.
1.
Karlis, D. and Ntzoufras, I. (2004). Bivariate Poisson and Diagonal
Inflated Bivariate Poisson Regression Models in S. (submitted). Technical
Report, Athens University of Economics and Business, Athens, Greece.
2.
Karlis, D. and Ntzoufras, I. (2003). Analysis of Sports Data Using
Bivariate Poisson Models. Journal of the Royal Statistical Society, D,
(Statistician), 52, 381 – 393.
1.
Dimitris Karlis, Department of Statistics, Athens University of
Economics and Business, Athens, Greece, e-mail: karlis@aueb.gr
.
2.
Ioannis Ntzoufras, Department of Statistics, Athens University of
Economics and Business, Athens, Greece, e-mail: ntzoufras@aueb.gr .
pbivpois
, simple.bp
, lm.dibp
.
# Fit Double and Bivariate Poisson models ()
#
# Model 2: DblPoisson(l1, l2)
ex1.m2<-lm.bp('x','y', y1y2~noncommon, data=ex1.sim, zeroL3=T )
# Model 3: BivPoisson(l1, l2, l3); same as simple.bp(ex1.sim$x, ex1.sim$y)
ex1.m3<-lm.bp('x','y', y1y2~noncommon, data=ex1.sim )
# Model 4: DblPoisson (l1=Full, l2=Full)
ex1.m4<-lm.bp('x','y', y1y2~., data=ex1.sim, zeroL3=T )
# Model 5: BivPoisson(l1=full, l2=full, l3=constant)
ex1.m5<-lm.bp('x','y', y1y2~., data=ex1.sim)
# Model 6: DblPois(l1,l2)
ex1.m6<-lm.bp('x','y', y1y2~noncommon+z1:noncommon+z3+I(z5*l2), data=ex1.sim, zeroL3=T)
# Model 7: BivPois(l1,l2,l3=constant)
ex1.m7<-lm.bp('x','y', y1y2~noncommon+z1:noncommon+z3+I(z5*l2), data=ex1.sim)
# Model 8: BivPoisson(l1=full, l2=full, l3=full)
ex1.m8<-lm.bp('x','y', y1y2~., y3~., data=ex1.sim)
# Model 9: BivPoisson(l1=full, l2=full, l3=z1+z2+z3+z4)
ex1.m9<-lm.bp('x','y', y1y2~., y3~z1+z2+z3+z4, data=ex1.sim)
# Model 10: BivPoisson(l1, l2, l3=full)
ex1.m10<-lm.bp('x','y',y1y2~noncommon+z1:noncommon+z3+I(z5*l2), y3~., data=ex1.sim)
# Model 11: BivPoisson(l1, l2, l3= z1+z2+z3+z4)
ex1.m11<-lm.bp('x','y',y1y2~noncommon+z1:noncommon+z3+I(z5*l2),
y3~z1+z2+z3+z4, data=ex1.sim)