Curve Fitting Using Conic by Evolutionary Computing

: Problem statement: A direct method, such as least squares technique is usually used to solve problems involving matching a curve or a surface to a set of data points. The solution obtained by this direct method is precise or very good in approximation, but computationally not very efficient. Thus, in this study, we propose an indirect approach using Particle Swarm Optimization (PSO) technique as an alternative. Approach: As a case study, we use conic curve which satisfy C 0 continuity to be fitted to a given set of data points. PSO, a soft computing method is employed to optimize the control points and weights which are then used in conic equations. Results: Best fitted conic curve that represents all the given data points is then obtained. Conclusion: We use an indirect technique of soft computing methods, i.e., PSO to fit a curve to a given data set. We believe that other types of soft computing based heuristic procedures may also be used to solve related problems or to find its effectiveness.


INTRODUCTION
Curve fitting is the process of constructing a curve, or mathematical function that has the best fit to a series of data points, possibly subject to certain constraints. Curve fitting can involve either interpolation, where an exact fit to the data is required, or smoothing, in which a 'smooth' function is constructed that approximately fits the data. A related topic in statistics is regression analysis, which focuses more on questions of statistical inference such as how much uncertainty is present in a curve that is fitted to observed data with certain random errors. Fitted curves can also be used as an aid for data visualization, to infer values of a function where no data are available and to summarize relationships among two or more variables. Extrapolation refers to the use of a fitted curve beyond the range of observed data and is subject to a greater degree of uncertainty which may also reflect the chosen method used to construct the curve as much as reflecting the error involved in the construction of fitted curve using observed data.
Particle Swarm Optimization (PSO) is an optimization technique proposed by Kennedy and Eberhart by means of particle swarm (Weise, 2007). PSO incorporates swarming behaviors observed in flocks of birds, school of fish, swarm of bees and even social behavior, from where the idea is originally emerged. Thus, PSO is a population based optimization tool which could be implemented and applied easily to solve various function optimization problems, or problems that can be transformed into function optimization forms. As an algorithm, the main strength of PSO is its fast convergence, which compares favorably with many global optimization algorithms like Genetic Algorithm (Eiben and Smith, 2007), Simulated Annealing (Kirkpatrick et al., 1983) and other global optimization algorithms. To apply PSO successfully, one of the key issues is finding how to map the problem solution into the PSO article, which directly affects its feasibility and performance.

Conic curve:
A standard form of conics can be found in Yang (2004) and Farin (1989) Eq. 1: Where: are control points of the Bezier curve and w is the middle weight. Here we list some useful properties of conics: For w < 1, we obtain an ellipse; for w = 1 a parabola; and for w > 1 a hyperbola: • The straight line segments [b 0 , b 1 ] and [b 1 , b 2 are tangents to r at r(0) = b 0 and r(1) = b 2 , respectively • For w 0 ≥ , the curve segment (1) lies in the convex hull of the control polygon • The point s = r(1/2) of a conic segment in its standard form is called the shoulder point. It can be computed from: are called the characteristic points. The shoulder tangent is spanned by q 0 and q 1 . Note that the shoulder tangent is parallel to 0 2 b , b ; see Fig. 1. As a consequence: where, m is the midpoint of b 0 and b 0 .
Particle Swarm Optimization: PSO starts by having a population of particles initialized with random positions marked by vector i x and random velocities i v (Das et al., 2008). The population of such particles is called a 'swarm' S. Each particle P has two state variables viz., its current position i x (t) and its current velocity i v (t) . It is also equipped with a small memory which comprises of its previous best position p(t) , i.e., the personal best experience and the best p(t) of all P, g(t) i.e., the best position found so far in the neighborhood of the particle. The PSO scheme has the following algorithmic parameters: • V max or maximum velocity which restricts i V (t) within the interval [-V max , V max ] an inertia weight factor ω • TWO uniformly distributed random numbers, 1 2 0 , 1 ≤ ϕ ϕ ≤ on the velocity update formula • two constant multiplier terms C 1 and C 2 known as 'self-confidence' and 'swarm confidence', respectively Initially the settings for p(t) and g(t) are for all particles. Once the particles are all initialized, an iterative optimization process begins, where the positions and velocities of all the particles are altered by the following recursive equations.
The equations are presented for the d th dimension of the position and velocity of the i th particle Eq. 2 and 3: The first term in the velocity updating formula represents the inertial velocity of the particle. Since the coefficient C 1 has a contribution towards the selfexploration (or experience) of a particle, we regard it as the particle's self-confidence. On the other hand, the coefficient C 2 has a contribution towards motion of the particles in global direction, which takes into account the motion of all the particles in the preceding program iterations, naturally its definition 'as swarm confidence' is apparent. After having calculated the velocities and position for the next time step t+1, the first iteration of the algorithm is completed. Typically, this process is iterated for a certain number of time steps, or until some acceptable solution has been found by the algorithm or until an upper limit of CPU usage has been reached. The algorithm is summarized in the following pseudo code: The PSO Algorithm: Input: Randomly initialized position and velocity of the particles: i X (0) and i V (0) .
Output: Position of the approx. global optima X * Begin While terminating condition is not reached For i = 1 to number of particles Evaluate the fitness:= i f (X ) Update i p and i g ; Adapt velocity of the particle using Eq. 3; Update the position of the particle; Increase i; end while end Proposed technique: In our proposed method, we estimate the control points by finding the intersection point between the point connecting two adjacent points at both ends of the curve (Fig. 2). Then we choose the size of the search area to find the best value for the control point. For example, we choose the search space size = 1 where the control point is identified in the search space (Fig. 3). To find the best weight, an initial value for the weight will be assigned at random in the range of [0, 1].
Our proposed algorithm starts by having an initial swarm position with swarm size =25 Fig. 4. PSO is used to find the best control point and weight, to enable us to generate the best fitted curve to the given data. To obtain the best solution, we use the sum squares error method proposed by Yahya et al. (2006). We set number of iterations = 50, inertia 1.0 ω = and C 1 = C 2 = 2.0. The pseudo code of our proposed technique is given below. Figure 5 displays

CONCLUSION
Instead of using one of the usual direct techniques, we use an indirect technique of soft computing methods, i.e., PSO to fit a curve to a given data set. In order to find the best solution, we map the curve fitting problem to the best PSO scheme. In the future, we intend to use a similar algorithm in order to solve surface fitting problem. The effects of changed parameters found in the PSO scheme will also be studied.