So far, we have considered linear, polynomial, rational, and exponential functions. From our high school math, we might recall something about trigonometric functions; since we will not use them in the following, we leave them aside. A natural way to build quite complicated, but hopefully useful, functions is function composition. Given functions g and h, we may build the composite function:

The idea is that, given x, we compute z = h(x), and then g(z). Strictly speaking, the notation we have used is a bit sloppy as it refers to values taken by the function. The proper notation for denoting the composition of g and h, when we want to refer to the function itself, should be

This notation makes it clear that h maps an input argument into a result, which is in turn mapped by g into another result; the composite mapping is function f.
Some care is needed in checking the domain on which a composite function makes sense. As we have already noted, the function

is defined only for −1 ≤ x ≤ 1.
Example 2.10 (Gaussian function) By composing the functions

we obtain function

Figure 2.12 illustrates the two building blocks and the resulting function. This function has a classical bell shape and plays a prominent role in probability and statistics, which make quite some use of normal, or Gaussian, probability distributions.
There are two simple function compositions that are quite common and have a natural interpretation. Given a function f(x), let us consider functions

for β > 0. Function g is actually just function f shifted to the right by an amount α, if α > 0; if α < 0, then the function is shifted to the left. Dividing the independent variable x by β > 0 has the effect of changing of scale, i.e., stretching or shrinking the function graph horizontally, depending on whether β > 1 or β < 1.

Fig. 2.12 Composition of two functions.

Fig. 2.13 Scaling and shifting the bell-shaped function of Eq. (2.9).
Example 2.11 (Shifting and scaling) Consider again the bell-shaped function (2.8) and apply the following transformation

where exp(·) is just an alternative notation for the exponential function. The parameter μ governs the amount (and direction) of shifting, whereas σ changes the scale, making the graph more or less dispersed. This is illustrated in Fig. 2.13. The first plot illustrates the function for μ = 0 and σ = 4. For that value of μ, the graph is symmetric with respect to the origin. If we set μ = 5 the graph is shifted by five units to the right. If we further set σ = 1, the effect is compressing the horizontal scale by a factor 4, thus reducing dispersion.
Leave a Reply