Rectangular Integration (a.k.a. The Midpoint Rule) – Conceptual Foundations and a Statistical Application in R
January 20, 2014 3 Comments
Continuing on the recently born series on numerical integration, this post will introduce rectangular integration. I will describe the concept behind rectangular integration, show a function in R for how to do it, and use it to check that the distribution actually integrates to 1 over its support set. This post follows from my previous post on trapezoidal integration.
Conceptual Background of Rectangular Integration (a.k.a. The Midpoint Rule)
Rectangular integration is a numerical integration technique that approximates the integral of a function with a rectangle. It uses rectangles to approximate the area under the curve. Here are its features:
- The rectangle’s width is determined by the interval of integration.
- One rectangle could span the width of the interval of integration and approximate the entire integral.
- Alternatively, the interval of integration could be sub-divided into smaller intervals of equal lengths, and rectangles would used to approximate the integral; each smaller rectangle has the width of the smaller interval.
- The rectangle’s height is the function’s value at the midpoint of its base.
- Within a fixed interval of integration, the approximation becomes more accurate as more rectangles are used; each rectangle becomes narrower, and the height of the rectangle better captures the values of the function within that interval.