Mathematical statistics uses techniques from various branches of math to prove definitively that statements regarding statistics are true. We will see how to use calculus to determine the values mentioned above of both the maximum value of the chi-square distribution, which corresponds to its mode, as well as find the inflection points of the distribution.
Before doing this, we will discuss the features of maxima and inflection points in general. We will also examine a method to calculate a maximum the inflection points.
How to Calculate a Mode with Calculus
For a discrete set of data, the mode is the most frequently occurring value. On a histogram of the data, this would be represented by the highest bar. Once we know the highest bar, we look at the data value that corresponds to the base for this bar. This is the mode for our data set.
The same idea is used in working with a continuous distribution. This time to find the mode, we look for the highest peak in the distribution. For a graph of this distribution, the height of the peak is a y value. This y value is called a maximum for our graph because the value is greater than any other y value. The mode is the value along the horizontal axis that corresponds to this maximum y-value.
Although we can simply look at a graph of a distribution to find the mode, there are some problems with this method. Our accuracy is only as good as our graph, and we are likely to have to estimate. Also, there may be difficulties in graphing our function.
An alternate method that requires no graphing is to use calculus. The method we will use is as follows:
- Start with the probability density function f (x) for our distribution.
- Calculate the first and second derivatives of this function: f '(x) and f"(x)
- Set this first derivative equal to zero f '(x) = 0.
- Solve for x.
- Plug the value(s) from the previous step into the second derivative and evaluate. If the result is negative, then we have a local maximum at the value x.
- Evaluate our function f (x) at all of the points x from the previous step.
- Evaluate the probability density function on any endpoints of its support. So if the function has domain given by the closed interval a,b, then evaluate the function at the endpoints a and b.
- The largest value in steps 6 and 7 will be the absolute maximum of the function. The x value where this maximum occurs is the mode of the distribution.
Mode of the Chi-Square Distribution
Now we go through the steps above to calculate the mode of the chi-square distribution with r degrees of freedom. We start with the probability density function f(x) that is displayed in the image in this article.
f (x) = K xr/2-1e-x/2
Here K is a constant that involves the gamma function and a power of 2. We do not need to know the specifics (however we can refer to the formula in the image for these).
The first derivative of this function is given by using the product rule as well as the chain rule:
f '( x ) = K (r/2 - 1)xr/2-2e-x/2 - (K / 2) xr/2-1e-x/2
We set this derivative equal to zero, and factor the expression on the right-hand side:
0 = K xr/2-1e-x/2 (r/2 - 1)x-1 - 1/2
Since the constant K, the exponential function and xr/2-1 are all nonzero, we can divide both sides of the equation by these expressions. We then have:
0 = (r/2 - 1)x-1 - 1/2
Multiply both sides of the equation by 2:
0 = (r - 2)x-1 - 1
Thus 1 = (r - 2)x-1 and we conclude by having x = r - 2. This is the point along the horizontal axis where the mode occurs. It indicates the x value of the peak of our chi-square distribution.
How to Find an Inflection Point with Calculus
Another feature of a curve deals with the way that it curves. Portions of a curve can be concave up, like an upper case U. Curves can also be concave down, and shaped like an intersection symbol ∩. Where the curve changes from concave down to concave up, or vice versa we have an inflection point.
The second derivative of a function detects the concavity of the graph of the function. If the second derivative is positive, then the curve is concave up. If the second derivative is negative, then the curve is concave down. When the second derivative is equal to zero and the graph of the function changes concavity, we have an inflection point.
In order to find the inflection points of a graph we:
- Calculate the second derivative of our function f "(x).
- Set this second derivative equal to zero.
- Solve the equation from the previous step for x.
Inflection Points for the Chi-Square Distribution
Now we see how to work through the above steps for the chi-square distribution. We begin by differentiating. From the above work, we saw that the first derivative for our function is:
f '(x) = K (r / 2 - 1) xr/2-2e-x/2 - (K / 2) xr/2-1e-x/2
We differentiate again, using the product rule twice. We have:
f"( x ) = K (r / 2 - 1) (r / 2 - 2)xr/2-3e-x/2 - (K / 2)(r / 2 - 1)xr/2-2e-x/2 + (K / 4) xr/2-1e-x/2 - (K / 2)(r / 2 - 1) xr/2-2e-x/2
We set this equal to zero and divide both sides by Ke-x/2
0= (r/2 - 1)(r/2 - 2)xr/2-3 - (1 / 2)(r/2 - 1)xr/2-2 + (1/ 4) xr/2-1 - (1/ 2)(r/2 - 1) xr/2-2
By combining like terms we have:
(r/2 - 1)(r/2 - 2)xr/2-3 - (r/2 - 1)xr/2-2 + (1/ 4) xr/2-1
Multiply both sides by 4x3 - r/2, this gives us:
0 = (r - 2)(r - 4) - (2r - 4)x + x2.
The quadratic formula can now be used to solve for x.
x = (2r - 4) +/- (2r - 4)2 - 4 (r - 2)(r - 4) 1/2/2
We expand the terms that are taken to the 1/2 power and see the following:
(4r2 -16r + 16) - 4 (r2 -6r + 8) = 8r - 16 = 4(2r - 4)
This means that:
x = (2r - 4) +/- (4(2r - 4) 1/2/2 = (r - 2) +/- 2r - 41/2
From this we see that there are two inflection points. Moreover, these points are symmetric about the mode of the distribution as (r - 2) is halfway between the two inflection points.
We see how both of these features are related to the number of degrees of freedom. We can use this information to help in the sketching of a chi-square distribution. We can also compare this distribution with others, such as the normal distribution. We can see that the inflection points for a chi-square distribution occur in different places than the inflection points for the normal distribution.