Description Usage Arguments Details Value Author(s) References Examples
A function in similar format to glm
which provides a
linear form regressing on the parameters lambda and mu.
1 2 |
lamFormula |
an object of class |
nuFormula |
an object of class |
data |
an optional |
lamStart |
optional vector of starting values for the coefficients of the λ regression. |
nuStart |
optional vector of starting values for the coefficients of the ν regression. |
sumTo |
an integer for the summation term in the density (default 100). |
method |
optimisation method passed to |
... |
further arguments to be passed to |
A log link is used for regression of the model parameters λ and ν, that is:
log(λ) = β X
log(ν) = ζ Y
where: β is the vector of coefficients for the parameter λ, ζ is the vector of coefficients for the parameter ν, X is the model matrix for the parameter λ, and Y is the model matrix for the parameter ν.
The parameter vectors are calculated via maximum likelihood using the
general optimisation function optim
. A Poisson model will
be fit using glm.fit
and (unless starting values are
supplied) the coefficients will be used as starting values for the
parameter vector β.
Several S3 functions have been implemented for model analysis
print
, coef
, extractAIC
,
logLik
, predict
, and summary
,
An object of class 'Comp' which is a list with all the components needed for the relevant S3 class methods.
Jeffrey Pollock <jeffpollock9@gmail.com>
A Flexible Regression Model for Count Data, by Sellers & Shmueli, http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1127359
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Call:
glm.comp(lamFormula = y ~ ., data = data)
Beta:
(Intercept) x1 x2 x3
-0.5530372 0.2782162 0.7864904 0.2165911
Zeta:
(Intercept)
-0.03438994
Degrees of Freedom: 4999 Total (i.e. Null); 4995 Residual
AIC: 15486.82
Log-Likelihood: -7738.409
Call:
glm.comp(lamFormula = y ~ ., data = data)
Beta:
Estimate Std.Error t.value p.value
(Intercept) -0.553037 0.031370 -17.6297 < 2.2e-16 ***
x1 0.278216 0.062496 4.4517 8.703e-06 ***
x2 0.786490 0.021145 37.1948 < 2.2e-16 ***
x3 0.216591 0.022510 9.6220 < 2.2e-16 ***
Zeta:
Estimate Std.Error t.value p.value
(Intercept) -0.034390 0.027128 -1.2677 0.205
AIC: 15486.82
Log-Likelihood: -7738.409
$beta
(Intercept) x1 x2 x3
-0.5530372 0.2782162 0.7864904 0.2165911
$zeta
(Intercept)
-0.03438994
lambda nu
[1,] 0.5470368 0.9661947
[2,] 1.9518960 0.9661947
[3,] 0.4764250 0.9661947
[4,] 3.1808341 0.9661947
[5,] 2.7352346 0.9661947
[6,] 0.6359565 0.9661947
[1] 15486.82
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.