

Y_i is the number of bicyclists on day i. Y = the vector of bicyclist counts seen on days 1 through n. Let us start with defining some variables: We need to detail out this strategy, so let’s dig deeper. Given the values of a set of regression variables for a given day, we will use the NB model to predict the bicyclist count on the Brooklyn bridge on that day. Our regression goal is to predict the number of bicyclists crossing the Brooklyn bridge on any given day. The counts were measured daily from 01 April 2017 to 31 October 2017.ĭaily bicyclist counts on the Brooklyn bridge (Background: The Brooklyn bridge as seen from Manhattan island) The following table contains counts of bicyclists traveling across various NYC bridges. Lastly, we’ll examine if the NB model’s performance is really superior to the Poisson model’s performance.

We’ll do all of this using the Python statsmodels library. We’ll configure the NB model, train it on the data set, and make some predictions on the test data set.We’ll formulate the regression strategy using the NB model as our regression model.We’ll define our regression goal on this data set.We’ll get introduced to a real world data set of counts which we’ll use in the rest of this section.
#Logistic regression xlstat how to#
In the rest of the section, we’ll learn about the NB model and see how to use it on the bicyclist counts data set. The Negative Binomial (NB) regression model is one such model that does not make the variance = mean assumption about the data. In such cases, one needs to use a regression model that will not make the equi-dispersion assumptioni.e.not assume that variance=mean. Often, the variance is greater than the mean, a property called over-dispersion, and sometimes the variance is less than the mean, called under-dispersion. This rather strict criterion is often not satisfied by real world data. The low performance of the model was because the data did not obey the variance = mean criterion required of it by the Poisson regression model. Training summary for the Poisson regression model showing unacceptably high values for deviance and Pearson chi-squared statistics (Image by Author)
