2
$\begingroup$

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

The original form of data tabulated given as below

enter image description here

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.

Thank you for your time.

$\endgroup$
  • $\begingroup$ What exactly is your question? Do you have a particular set of hypotheses? $\endgroup$ – JimB Apr 2 '20 at 16:26
  • $\begingroup$ @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. $\endgroup$ – step-by-step Apr 2 '20 at 16:51
2
$\begingroup$

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"}]

Predicted count vs 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.

$\endgroup$
  • 1
    $\begingroup$ Thank you. It would be useful in another way around $\endgroup$ – step-by-step Apr 3 '20 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.