Actuarial Notes

Neural Network

Study guides: ATPA, Exam MAS-II, Exam F1PC, Exam F2FIE

A Neural Network is a statistical learning model that predicts a response through layers of units, each applying a non-linear activation function to a weighted combination of the layer before it. It is trained on data and learns the structure of the data automatically, by an iterative fit much like a GLM's.

With one hidden layer of K units and a quantitative response, the prediction for predictors X_1, \ldots, X_p is

f(X) = \beta_0 + \sum_{k=1}^{K}\beta_k\, g\!\left(w_{k0} + \sum_{j=1}^{p} w_{kj}X_j\right)

  • g is the activation function.
  • w_{kj} is the weight from predictor X_j to hidden unit k, and w_{k0} is the unit's bias.
  • \beta_0, \ldots, \beta_K are the output weights.

The most common activation is the ReLU (rectified linear unit), g(z) = \max(0, z). The weights are estimated by backpropagation, gradient descent on a loss function.

A network has two ReLU hidden units, with weights w_ = 0.5, w_ = 1.0, w_ = -1.0 and w_ = -0.5, w_ = 0.8, w_ = 0.6, and output weights \beta_0 = 1.0, \beta_1 = 2.0, \beta_2 = 1.5. What does it predict for X_1 = 1 and X_2 = 2?

  • Unit 1's input is 0.5 + 1.0(1) - 1.0(2) = -0.5, so its activation is \max(0, -0.5) = 0.
  • Unit 2's input is -0.5 + 0.8(1) + 0.6(2) = 1.5, so its activation is 1.5.
  • The prediction is 1.0 + 2.0(0) + 1.5(1.5) = 3.25.

Neural networks for classification

For a binary response, the output passes through the sigmoid 1/(1 + e^{-z}), so the network predicts a probability. A classification threshold turns the probability into a class. The threshold weighs the cost of false positives against that of false negatives, and the ROC curve shows the trade at every threshold.

A fraud network outputs \hat = 0.82 for a new claim. What does this mean, and is the claim flagged at a threshold of 0.5?

  • The network estimates an 82% probability that the claim is fraudulent.
  • 0.82 is above the threshold, so the claim is flagged for investigation.

Deep neural networks

A deep network has several hidden layers, each taking the activations of the layer below as its inputs. Later layers represent features of features. The many weights make overfitting likely, so a network is fitted with regularization, such as a penalty on the weights or dropout, and judged on test error.

Practice questions

Actuarial Notes