4. Process Modeling
4.8. Some Useful Functions for Process Modeling
4.8.1. Univariate Functions

## Rational Functions

 Rational Functions A rational function is simply the ratio of two polynomial functions, $$y = \frac{a_{n}x^{n} + a_{n-1}x^{n-1} + ... + a_{2}x^{2} + a_{1}x + a_{0}} {b_{m}x^{m} + b_{m-1}x^{m-1} + ... + b_{2}x^{2} + b_{1}x + b_{0}} \, ,$$ with $$n$$ denoting a non-negative integer that defines the degree of the numerator and $$m$$ denoting a non-negative integer that defines the degree of the denominator. When fitting rational function models, the constant term in the denominator is usually set to 1. Rational functions are typically identified by the degrees of the numerator and denominator. For example, a quadratic for the numerator and a cubic for the denominator is identified as a quadratic/cubic rational function. Rational Function Models A rational function model is a generalization of the polynomial model. Rational function models contain polynomial models as a subset (i.e., the case when the denominator is a constant). If modeling via polynomial models is inadequate due to any of the limitations above, you should consider a rational function model. Note that fitting rational function models is also referred to as the Pade approximation. Advantages Rational function models have the following advantages. Rational function models have a moderately simple form. Rational function models are a closed family. As with polynomial models, this means that rational function models are not dependent on the underlying metric. Rational function models can take on an extremely wide range of shapes, accommodating a much wider range of shapes than does the polynomial family. Rational function models have better interpolatory properties than polynomial models. Rational functions are typically smoother and less oscillatory than polynomial models. Rational functions have excellent extrapolatory powers. Rational functions can typically be tailored to model the function not only within the domain of the data, but also so as to be in agreement with theoretical/asymptotic behavior outside the domain of interest. Rational function models have excellent asymptotic properties. Rational functions can be either finite or infinite for finite values, or finite or infinite for infinite $$x$$ values. Thus, rational functions can easily be incorporated into a rational function model. Rational function models can often be used to model complicated structure with a fairly low degree in both the numerator and denominator. This in turn means that fewer coefficients will be required compared to the polynomial model. Rational function models are moderately easy to handle computationally. Although they are nonlinear models, rational function models are a particularly easy nonlinear models to fit. Disadvantages Rational function models have the following disadvantages. The properties of the rational function family are not as well known to engineers and scientists as are those of the polynomial family. The literature on the rational function family is also more limited. Because the properties of the family are often not well understood, it can be difficult to answer the following modeling question: Given that data has a certain shape, what values should be chosen for the degree of the numerator and the degree on the denominator? Unconstrained rational function fitting can, at times, result in undesired nusiance asymptotes (vertically) due to roots in the denominator polynomial. The range of $$x$$ values affected by the function "blowing up" may be quite narrow, but such asymptotes, when they occur, are a nuisance for local interpolation in the neighborhood of the asymptote point. These asymptotes are easy to detect by a simple plot of the fitted function over the range of the data. Such asymptotes should not discourage you from considering rational function models as a choice for empirical modeling. These nuisance asymptotes occur occasionally and unpredictably, but the gain in flexibility of shapes is well worth the chance that they may occur. General Properties of Rational Functions The following are general properties of rational functions. If the numerator and denominator are of the same degree ($$n=m$$), then $$y = a_n / b_m$$ is a horizontal asymptote of the function. If the degree of the denominator is greater than the degree of the numerator, then $$y=0$$ is a horizontal asymptote. If the degree of the denominator is less than the degree of the numerator, then there are no horizontal asymptotes. When $$x$$ is equal to a root of the denominator polynomial, the denominator is zero and there is a vertical asymptote. The exception is the case when the root of the denominator is also a root of the numerator. However, for this case we can cancel a factor from both the numerator and denominator (and we effectively have a lower-degree rational function). Starting Values for Rational Function Models One common difficulty in fitting nonlinear models is finding adequate starting values. A major advantage of rational function models is the ability to compute starting values using a linear least squares fit. To do this, choose $$p$$ points from the data set, with $$p$$ denoting the number of parameters in the rational model. For example, given the linear/quadratic model, $$\frac{A_0 + A_1x} {1 + B_1x + B_2x^{2}} \, ,$$ we need to select four representative points. We then perform a linear fit on the model, $$y = A_0 + A_1x + ... + A_{p_n}x^{p_n} - B_1xy - ... - B_{p_d}x^{p_d}y \, .$$ Here, $$p_n$$ and $$p_d$$ are the degrees of the numerator and denominator, respectively, and the $$x$$ and $$y$$ contain the subset of points, not the full data set. The estimated coefficients from this fit made using the linear least squares algorithm are used as the starting values for fitting the nonlinear model to the full data set. Note: This type of fit, with the response variable appearing on both sides of the function, should only be used to obtain starting values for the nonlinear fit. The statistical properties of models like this are not well understood. The subset of points should be selected over the range of the data. It is not critical which points are selected, although you should avoid points that are obvious outliers. Example The thermal expansion of copper case study contains an example of fitting a rational function model. Specific Rational Functions