The integral as a limit of sums
The topic Matrix calculus gave us gradients of losses such as and softmax cross-entropy in a few lines. But a loss is an average over data. When the data come from a distribution, that average is an integral, taken over as many variables as a data point has coordinates. This topic learns to compute such integrals.
Start in the plane. Cut a rectangle into small cells of area , pick a point in each, and add up. As the cells shrink, the sum tends to the double integral:
If , this is the volume under the graph of over , just as a 1-D integral is an area under a curve.
In probability, is a joint density . It is non-negative, its integral over the whole plane is , and the probability that the random point lands in a region is
A density is not a probability. A cell of area near has probability about , so itself may exceed . The uniform density on the rectangle equals : the rectangle has area and the total must be .
The running example of this topic is the density
Outside the square . Points near the corner are more likely than points near the origin. That it really integrates to we will check once we can compute double integrals.