# Is there an R package which uses neural networks to explicitly model count data?

Ripley's nnet package, for example, allows you to model count data using a multi nomial setting but is there a package which preserves the complete information relating to a count? For example, whereas an ordinal multinomial model preserves the ordering of the integers that make up the count, a fully developed model of count data as a GLM such as Poisson or Negative Binomial Regression includes how large the integer counts are in relation to each other.

Another phrasing might be, 'What kind of models come closest to combining the advantages of neural networks, in terms of, as an example, easily modelling non-linearity in the predictors, and count data GLMs, which are good at taking into account that the data is in fact a count?'

• What do you mean by complete information in this case? – Jan van der Vegt Jul 14 '16 at 7:22
• Hi Jan, I have made an attempt at more completely explaining what I mean. – Robert de Graaf Jul 15 '16 at 6:41
• Then I did understand it correctly, I will write a half answer now – Jan van der Vegt Jul 15 '16 at 6:44
• Would u please share your answer with me? – Aki Apr 5 '17 at 2:19

## 1 Answer

I skimmed over a paper recently that aims to use Neural Networks as Poisson regression. The method they propose is basically a standard Multi-Layer Perceptron where they use a different loss function, namely:

$$E = -\sum_{n=1}^N[-t_n + y_nlog(t_n)]$$

This is a version without regularization to prevent the overfitting, they use regular weight decay.

They mention that they wrote it in R and Matlab but I don't have a clue if it's available online somewhere, but any neural network package where you can pass your own loss function should suffice.

http://www.mathstat.dal.ca/~hgu/Neural%20Comput%20&%20Applic.pdf