Data Visualization using Spline Functions

A two parameter family of 1 C rational cubic spline functions is presented for the graphical representation of shape preserving curve interpolation for shaped data. These parameters have a direct impact on the shape of the curve. Constraints are developed on one family of the parameters to visualize positive, monotone and convex data while other family of parameters can assume any positive values. The problem of visualization of constrained data is also addressed when the data is lying above a straight line and curve is required to lie on the same side of the line. The approximation order of the proposed rational cubic function is also investigated and is found to be   3 i O h .


Introduction
Shape control (see Gregory and Sarfraz (1990), Habib and Sakai (2008)), shape design (see Dejdumrong and Tongtar (2007)) and shape preservation (see Sarfraz (2003), Schmidt and Hess (1988), Schultz (1973)) are important areas for graphical presentation of data.In data visualization environment, a user is always interested in graphical representation of the data.Positive, monotone and convex are the basic shapes of data.Rate of dissemination of drugs in blood, population growth (see Butt and Brodlie (1993)) and half-life of a radioactive substance are always positive.Monotonicity is applied in the specification of Digital to Analog Converters (DACs), Analog to Digital Converters (ADCs) and sensors.These devices are used in control system applications where nonmonotonicity is unacceptable.Other applications of monotone data are erythrocyte sedimentation rate (E.S.R.) in cancer patients and uric acid level in patients suffering from gout (see Hussain and Hussain (2007)).Convexity has its applications in non-linear programming, designing of telecommunication system, engineering drawing, approximation theory etc.The data arising in an optimization problem may be convex (Brodlie and Butt (1991)).Due to these applications, development of data visualization schemes which preserve the shape of data, is a germane area of research.
The problem of data visualization of planar data has been discussed by a number of authors.Brodlie and Butt (1991) developed 1  C schemes to preserve the shape of convex data.The same authors in (Brodlie and Butt (1993)) developed a 1  C positivity preserving scheme for 2D data.The authors in (Brodlie and Butt, (1991), (1993)), each interval where the shape of data was lost, divided it into two subintervals by inserting an extra knot in such a way that the shape of data was preserved.The piecewise cubic interpolant was used to interpolate the data over each subinterval.Fahr and Kallay (1992) used a 1  C monotone rational B-spline of degree one to preserve the shape of monotone data.Goodman, Ong and Unsworth (1991) presented two interpolating schemes to visualize the shape of data lying on one side of the straight line using rational cubic function.The first scheme scaled weights by some scale factors and the second scheme adopted the method of insertion of a new interpolation point.Unlike, Butt and Brodlie (1991), (1993), Goodman, Ong and Unsworth (1991), the data visualization schemes for shape preserving curve data developed in this paper neither require the specification of interval in which the shape of data is lost nor scaling of weights.The schemes developed in this paper, assure an automated selection of parameters in each subinterval.Goodman (2002) provided a comprehensive survey of shape preserving interpolating algorithms for planar data.The rational functions used in Hussain and Hussain (2007), Sarfraz, Butt and Hussain (2001), Sarfraz (2003), have two free parameters which are constrained to visualize the shape of data.The data visualization schemes developed in this paper also has two parameters but only one is constrained to visualize the shape preserving curve data.Hussain and Sarfraz used rational cubic function in its most generalized form (four parameters) to preserve the shape of positive and monotone planar data in Hussain and Sarfraz (2008) and Hussain and Sarfraz (2009) respectively.On the other hand the schemes developed in this paper are visualizing the shape preserving curve data by developing constraints on a single parameter.Hence the scheme developed in this paper is computationally economical than Hussain and Hussain (2007), Hussain and Sarfraz (2008), (2009), Sarfraz, Butt and Hussain (2001), Sarfraz (2003).Lamberti and Manni (2001) used cubic Hermite in parametric form to preserve the shape of data.The step length was used as tension parameters to preserve the shape of planar functional data.The first order derivatives at the knots were estimated by a tri-diagonal system of equations which assured 2  C continuity at the knots.The data visualization schemes developed in this paper does not alter the step length to visualize the shape of data.Schmidt and Hess (1988) developed sufficient conditions on derivatives at the knots to assure positivity of interpolating cubic polynomial over the interval thus it is restricted to just data without derivatives, whereas, the schemes developed in this paper are applicable to both data and data with derivatives.
This paper has been devoted to a rational cubic spline scheme for visualization of shaped data.A two parameter family of 1  C rational cubic spline functions has been presented for shape preserving curve interpolation.The two parameter family has a direct impact on the shape of the curve.The data dependent constraints have been developed on one family of the parameters to introduce independent curve schemes to visualize positive, monotone and convex data.However, the other family of parameters has been left as free, it can assume any positive values to further refine the curve schemes if needed.The problem of visualization of constrained data is also addressed when the data is lying above a straight line and curve is required to lie on the same side of the line.Ann error analysis has also been the part of this study.The approximation order of rational cubic spline function has been has been investigated and is found to be   The remainder of the paper is organized as follows.In Section 2, the 1  C rational cubic spline function with two parameters has been introduced.Sections 3 and 4 discuss the problem of shape preservation of positive data and data lying above the straight line respectively.The problems of monotony and convexity preservation of data are discussed in Sections 5 and 6 respectively.Section 7 discusses the error of approximation.Finally, Section 8 concludes the paper.

Rational Cubic Spline
Let     , , 0,1, 2,..., be the given set of data points defined over the interval

 
, a b , where A piecewise rational cubic function with two parameters is defined over each subinterval where . The piecewise rational cubic function (1) will be 1 C if it satisfies the following interpolatory conditions   (1) i S x denotes the derivative with respect to x and i d denotes the derivative values estimated or given.The 1 C continuity conditions defined in (2) asserts the following values of unknowns i A , 0,1, 2, 3 i  : These values of i A , 0,1, 2, 3 i  reformulate the rational cubic function (1) to the following where  , the rational cubic spline (3) reduces to cubic Hermite spline.The parameters i  and i  can assume any real value but in this paper, for the ease of manipulation these are assumed positive real number.

Some Observations
The parameters i  and i  involved in the definition rational cubic function have a direct impact on the shape of curve.The mathematical and graphical illustration of this impact is described as: The increase of either of the parameter i  and i  reduces the rational cubic spline to a linear interpolant, which is mathematically expressed as: Same observation is made if we increase both the parameters i  and i  simultaneously.
To illustrate this impact the rational cubic spline (3) is reformulated as: where    From (4), the following observation is made: Hence, the individual or simultaneous increase of the value of these parameters reduces the rational cubic function (3) in the interval . These observations are implemented on the data set x f  taken from Hussain and Sarfraz (2009) and demonstrated graphically in Figure 1-4.

Positive Curve Data Visualization
be the positive data defined over the interval   , a b .The necessary condition for the positivity of data is The piecewise rational cubic spline (3) preserves positivity if Using the result developed by Schmidt and Hess (1988), cubic polynomial   , For the rational cubic spline (3), we have This leads to the following conditions: Further ] with     1 , 0 Positivity of

 
i p  can be assured from either ( 6) or ( 7), but the simplicity of computation in ( 6) justify it as a rational choice.The whole discussion can be summarized as follows: Theorem 3.1.The piecewise rational cubic interpolant   S x , defined over the interval the following sufficient conditions are satisfied 0 The above constraints can be rearranged as:

Demonstration
In this Section we shall illustrate the positivity preserving scheme developed in Section 3 through numerical examples.
Example 3.1.Consider the positive data set of Hussain and Sarfraz (2008) shown in Table 1. Figure 5 is produced from the positive data in Table 1 using cubic Hermite spline which looses the shape of data.Positive curve in Figure 6 is produced from the positive data set in Table 1 using the positive data visualization scheme developed in Section 3. The values of derivatives and parameters are provided in Table 2.     3. The negative curve in Figure 7 through positive data taken in Table 3 is produced using cubic Hermite spline which looses the shape of data.The curve in Figure 8 is produced through positive data in Table 3 using the scheme developed in Section 3. It is seen that the positive shape of the data is preserved.Figure 9 and Figure 10 provides the clooser view of Figure 8.

Constrained Curve Data Visualization
Let     , , 0,1, 2,..., be the given set of data points lying above the straight line The curve will lie above the straight line if the rational cubic function (3) satisfies the following condition For each subinterval , the above relation can be expressed as where   is the parametric equation of straight line with i i a mx c   and  and after some rearrangement, (9) reduces to We know that 0 0 B  and 3 0 B  are true from the necessary condition (8).
The above discussion can be summarized as follows: the following sufficient conditions are satisfied The above constraints can be rearranged as:

Demonstration
In this Section we shall illustrate the constrained data preserving scheme developed in Section 4 through numerical examples.5.This data set is lying above the straight line 1 2 x y   .Figure 11 is produced from the data set in Table 5 using cubic Hermite spline which looses the shape of data.Figure 12 is produced from the data set in Table 5 using data visualization scheme developed in Section 4. It is observable from the Figure 12 that the curve is lying above the straight line 1 2 x y   .

Table 5. Positive data set above the line 1 2
x y   .Kvasov (2000) shown in Table 7.
This data set is lying above the straight line 1 2 x y   .Figure 13 is produced from the data set in Table 7 using cubic Hermite spline which looses the shape of data.Curve lying above the straight line 1 2 x y   , in Figure 14, is produced from the data visualization scheme developed in Section 4.

Table 7. Positive data set above the line 1 2
x y   .Table 8.Numerical results for Figure 14.

Monotone Curve Data Visualization
Let     , , 0,1, 2,..., i i x f i n  be the monotone data defined over the interval   , a b such that The piecewise rational cubic function (3) preserves monotony if

 
(1) . Obviously, 0 0 C  and 4 0 C  are always true from the necessary condition of monotonicity (10).Now, 1 0 The above can be summarized as: Theorem 5.1.The piecewise rational cubic interpolant   S x , defined over the interval the following sufficient conditions are satisfied 0 , , The above constraints can be rearranged as: , ,

Demonstration
In this Section we shall illustrate the monotone data preserving scheme developed in Section 5 through numerical examples.
Example 5.1.Consider a monotone data set taken in Table 9. Non-monotone curve in Figure 15 from the monotone of Table 9 is produced using cubic Hermite.The monotone curve (from the same data set) is produced in Figure 16 using data visualization scheme developed in Section 4. The values of derivatives at the knots and parameters are provided in Table 10.Table 10.Numerical results for Figure 16.11.This data has been taken from Kvasov (2000) with slight modification.Figure 17 is produced from the data set in Table 11 using cubic Hermite spline which looses the monotone shape of data.The monotone curve in Figure 18 is produced using the monotone data visualization scheme developed in Section 5. Its numerical results are shown in Table 12.

Convex Curve Data Visualization
Let     , , x f i n  be the convex data defined over the interval   , a b such that The piecewise rational cubic function (3) preserves convexity if

 
(2) (2) 0 3 where The above can be summarized as: , is convex if the following sufficient conditions are satisfied The above constraints can be rearranged as:

Demonstration
In this Section we shall illustrate the convex data preserving scheme developed in Section 6 through numerical examples.
Example 6.1.Consider a convex data set taken in Table 13. Figure 19 is produced from the convex data set in Table 13 using cubic Hermite spline which looses the shape of data.Figure 20 is produced from the same data set using the convex data visualization scheme developed in Section 6.It is seen in Figure 20 that the convex shape of data is preserved.The values of derivatives at knots and parameters in the interval are provided in Table 14.
Table 13.A convex data set.15.This data has been taken from Yahaya, Hussain and Ali (2006).Figure 21 is produced from the convex data set in Table 15 using cubic Hermite spline which looses the shape of data.The convex curve in Figure 22 is produced using convex data visualization scheme developed in Section 6.

Error Estimation of Interpolation
In this Section, the error of interpolation is estimated when the function being interpolated is     3 0 , n f x C x x  , using the rational cubic function (3).Keeping in view the locality of interpolation scheme developed in Section 2, the error is investigated in an arbitrary subinterval . The Peano Kernel Theorem (see Schultz (1973)) is used to estimate the error adopting the approach of Duan et al. (2007).
The error in each subinterval is defined as: The absolute value of the error in each subinterval is: where , , , , , .

Theorem 4 . 1 . 1 ,
The piecewise rational cubic interpolant   S x , defined over the interval   , a b , in (3), preserves the shape of data that lies above the straight line if in each subinterval 

Example 4 . 1 .
Consider the positive data set ofHussain and Sarfraz (2008) shown in Table

Example 5 . 2 .
Consider another monotone data set shown in Table

Remark 7 . 2 .
For equal values of parameters   cubic Hermite.Thus the optimal error coefficient i c for cubic Hermite can be obtained by substituting i i

Table 1 .
Positive data set.
Example 3.2.Another positive data set is considered in Table

Table 3 .
Positive data set.

Table 9 .
A monotone data set.