# Inference Statistics for Neural Networks

Linear regression has been around for quite some time and has developed a set of statistics for measuring its performance like $p$-values, $R^2$, $F$-statistic, and so on, in order to catch internally inconsistent/poorly performing models. These statistics have been generalized to logistic regression and general GLM models.

However, when it comes to most machine learning packages, these statistics aren't included in favor of CV/OOS backtesting. In fact, most packages do not even bother to support these statistics at all. Why is that the case? Is there any software or even research in existence to support this kind of ability to do model selection?

It seems to me like these two different types of models are, many times, used for two different purposes. I will be paraphrasing from the first few chapters of Introduction to Statistical Learning.

On one hand, you have models for inference. These are often used to find support for or against theories. If Theory A argues X predicts Y, then traditionally we want to see that a coefficient $\hat{\beta}$ is "significant", $p < .05$, using test statistics like $t$ and $F$. These are less about model performance and more about theory. For example, many times we use arbitrary 1 - 7 point scales and contrived, laboratory settings. We do not really know how useful an effect size like $R^2$ might be, and we aren't really interested in predicting the future. We want results to be interpretable, as well, so we purposefully choose rigid parametric models that have assumptions like linearity.

On the other hand, you have models for prediction. These are often used more practically—to predict the future or categorize unseen data. We don't really care necessarily if one predictor is "significant". We just want our overall model to be able useful in predicting the future or categorizing unseen data, etc. It is less theory driven, so people use non-parametric, flexible models that are far harder to interpret theoretically. So we can measure performance—prediction—by seeing how far off our predictions are, which is where things like cross-validation and mean prediction standard error come into play.

In short, rigid models like linear regression and frequentist hypothesis testing using $p$-values and their related test statistics are more about drawing a theoretical inference from the data (e.g., the more prejudiced one is, the more they will discriminate against an outgroup member), so we just care that an effect is not zero (or, increasingly, is not a trivially small effect). Neural networks are more about making predictions from the data (e.g., how accurately can we predict discrimination from self-reported prejudice?), so we see how far off our predictions were (e.g., using cross-validation and looking for $MPSE$). Each type of statistic is used for a specific purpose.

• what if your hypothesis is that there is a difference between two classes of data and a neural network can find it, and you want to have a p-value on this claim? – rep_ho Jul 2 '17 at 23:07
• It seems like you could maybe bootstrap your sample when creating a neural network and get a bootstrapped 95% CI around the mean of the mean predicted squared errors. If the 95% CI does not include the error you would expect by chance, then you could "reject the null" that assumes the neural network is a worthless predictor? This seems uninformative to me, however. – Mark White Jul 25 '17 at 19:21

If the exact specification of the model is unknown (which is almost always the case), then they use criteria that allow choosing the best from some allowed models. The most common criterion is the Schwarz criterion and the Akaike criterion. Both criteria allow you to choose the best model from a variety of different specifications.

To add to previous answers, many of those frequentist statistics depend on the log-concavity of exponential family distributions to produce unique optima for the MLE/MAP problem. The non-convexity of most practical neural networks hinders frequentist analysis because the final model is not guaranteed to be globally optimal, and model size/complexity often hinders traditional Bayasian analysis. There is however variational Bayes. But even in this setting, the lack of separability of features makes it hard to evaluate the effect of any given input variables as you would have to look over a large (potentially infeasible) number of pathways effected by a single input, though you could definitely look at group means for categorical inputs.

On second look, I suppose you wouldn't have to look over all paths, but rather at all parameters associated with an input. However, the non-linear, non-additive properties means you can't really use non-zero status as an indicator of significance. Surely if all associated parameters in the first layer were (statisically) zero, that would be highly suggestive. But I doubt that would happen very often.

You could perhaps look at variability: presumably less variable weights signal importance of a particularly subtree for predictions. This only seems reasonable as a collective property on subgraphs though, and could maybe tell you about important interactions. I'm not familiar but I'm curious if the study of random graphs could be used here to identify clusters of associated inputs. Since the strength of a neural network is revealing non-linear interactions, this might be a much more fruitful type of interference.

• Would you elaborate on the "large number of pathways" part? – Daniel Parry Dec 6 '18 at 4:50