# Count based hypothesis test for inhomogeneous Poisson process

I am intended to fit the following data using InhomogeneousPoissonProcess[] in v12.0.

The original form of data tabulated given as below

Such a table contains counts by the hour and day of the week, arriving phone calls associated with a call center which is open from 8 am-9 pm daily, for an example,

Days = ToString /@ {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday};

counts = {{42, 47, 79, 101, 83, 74, 79, 105, 88, 94, 84, 51, 68}, {63,
144, 133, 163, 140, 104, 137, 145, 163, 150, 113, 91, 79}, {75,
129, 148, 144, 134, 128, 132, 135, 150, 119, 102, 66, 58}, {76,
115, 97, 127, 98, 120, 130, 130, 124, 97, 92, 51, 77}, {57, 108,
184, 134, 131, 109, 129, 135, 118, 108, 94, 77, 69}, {72, 134,
139, 129, 123, 114, 106, 156, 145, 123, 102, 67, 68}, {56, 91, 93,
96, 77, 83, 86, 109, 127, 95, 81, 68, 45}}; (*Arrival counts to a call center*)

{995, 1625, 1520, 1334, 1453, 1478, 1107} (*Total per day*)
{441, 768, 873, 894, 786, 732, 799, 915, 915, 786, 668, 471, 464} (*Total per hour*)


Before modeling, I wanted to create a mathematical model (hypothesis test) using, which assumes that the daily arrivals to a call center occur according to the inhomogeneous Poisson process.

I tried to find similar but could find in neither here InhomogeneousPoissonProcess or there Hypothesis Tests guides.

EDIT: My question is, to validate the assumptions of Inhomogeneous PP given such data set. I have not made any set of hypotheses, but only hinted to have a hypothesis based on mean and variance relationship.

Please help me to set up hypothesis tests for NHPP models based on count events using such tools.

• What exactly is your question? Do you have a particular set of hypotheses?
– JimB
Apr 2, 2020 at 16:26
• @JimB I have edited the question. But sorry I am not sure what hypothesis and test statistics should be set for NHPP models. Any way out will be helpful. Apr 2, 2020 at 16:51

If you are testing hypotheses, then you really need to specify those. But I wonder if rather than hypothesis testing, it would be more appropriate to consider "estimation". (Although you really only have a sample size of particular week so I'm not sure if you intend to examine hypotheses for just that particular week or if you expect to extrapolate to some larger collection of weeks.)

Just to help specify what you might want to do with the data, consider fitting a model where the counts have a Poisson distribution but with the log of the mean being a constant plus a day effect and plus an hour effect.

counts = {{42, 47, 79, 101, 83, 74, 79, 105, 88, 94, 84, 51, 68}, {63,
144, 133, 163, 140, 104, 137, 145, 163, 150, 113, 91, 79}, {75,
129, 148, 144, 134, 128, 132, 135, 150, 119, 102, 66, 58}, {76,
115, 97, 127, 98, 120, 130, 130, 124, 97, 92, 51, 77}, {57, 108,
184, 134, 131, 109, 129, 135, 118, 108, 94, 77, 69}, {72, 134,
139, 129, 123, 114, 106, 156, 145, 123, 102, 67, 68}, {56, 91, 93,
96, 77, 83, 86, 109, 127, 95, 81, 68, 45}};
data = Flatten[Table[{day, hour, counts[[day, hour]]}, {day, 7}, {hour, 13}], 1]

glm = GeneralizedLinearModelFit[data, {day, hour}, {day, hour},
NominalVariables -> All, ExponentialFamily -> "Poisson"];


One can plot the response against the predicted value:

ListPlot[Transpose[{glm["PredictedResponse"], glm["Response"]}],
AxesLabel -> {"Predicted count", "Observed count"}]


The estimated overdispersion factor is greater than one which suggests that the above model with the Poisson variability is not an adequate summary:

glm["ResidualDeviance"]/glm["ResidualDegreesOfFreedom"]
(* 1.77233 *)


That might give you a start. For general questions about what all of the summary statistics mean you should ask such questions at CrossValidated.

• Thank you. It would be useful in another way around Apr 3, 2020 at 6:30