aa r X i v : . [ m a t h . D S ] O c t Novel method of fractal approximation
K. Igudesman and G. Shabernev
Abstract
We introduce new method of optimization for finding free parametersof affine iterated function systems (IFS), which are used for fractal ap-proximation. We provide the comparison of effectiveness of fractal andquadratic types of approximation, which are based on a similar optimiza-tion scheme, on the various types of data: polynomial function, DNAprimary sequence, price graph and graph of random walking.
It is well known that approximation is a crucial method for making compli-cated data easier to describe and operate. In many cases we have to deal withirregular forms, which can’t be approximate with desired precision. Fractal ap-proximation become a suitable tool for that purpose. Ideas for interpolationand approximation with the help of fractals appeared in works of M. Barnsley[2] and was developed by P. Massopust [6] and C. Bandt and A. Kravchenko [1].Today we can apply fractals to approximate such interesting and interdis-ciplinary data as graphs of DNA primary sequences of different species andinterbeat heart intervals [7], price waves and many others.Section 2 of this work is devoted to the construction of fractal interpolationfunctions. Necessary condition on free parameters d i of affine iterated functionsystems is shown. One graphical example is given.In section 3 we give the common scheme of approximation of general function g ∈ L [ a, b ] and obtain the equation for direct calculation of free parameters d i .In section 4 we illustrate the results on concrete examples. There are two methods for constructing fractal interpolation functions. In 1986M. Barnsley [2] defined such functions, as attractors of some specific iteratedfunction systems. In this work we use common approach, which was developedby P. Massopust [6].Let [ a, b ] ⊂ R be a nonempty interval, 1 < N ∈ N and { ( x i , y i ) ∈ [ a, b ] × R | a = x < x < · · · < x N − < x N = b } — are points of interpolation. For all1 = 1 , N consider affine transformations of the plane A i : R → R , A i (cid:18) xy (cid:19) := (cid:18) a i c i d i (cid:19) (cid:18) xy (cid:19) + (cid:18) e i f i (cid:19) . We require following two conditions hold true for all i : A i ( x , y ) = ( x i − , y i − ) , A i ( x N , y N ) = ( x i , y i ) . In this case a i = x i − x i − b − a , c i = y i − y i − − d i ( y N − y ) b − a ,e i = bx i − − ax i b − a , f i = by i − − ay i − d i ( by − ay N ) b − a , (1)there { d i } Ni =1 act like family of parameters. Notice, that for all i operator A i takes the line segment between ( x , y ) and ( x N , y N ) to the line segment passesthrough points of interpolation ( x i − , y i − ) and ( x i , y i ).Let K be a space of nonempty compact subsets R with Hausdorff metric.Define the Hutchinson operator [5]Φ : K → K , Φ( E ) = N [ i =1 A i ( E ) . It is easily seen [2], that the Hutchinson operator Φ take a graph of any con-tinuous function on a segment [ a, b ] to a graph of a continuous function on thesame segment. Thus, Φ can be treated as operator on the space of continuousfunctions C [ a, b ].For all i = 1 , N denote u i : [ a, b ] → [ x i − , x i ] , u i ( x ) := a i x + e i ,p i : [ a, b ] → R , p i ( x ) := c i x + f i . (2)Massopust [6] has shown, that Φ acts on C [ a, b ] according to the rule(Φ g )( x ) = N X i =1 (cid:0) ( p i ◦ u − i )( x ) + d i ( g ◦ u − i )( x ) (cid:1) χ [ x i − ,x i ] ( x ) . (3)Moreover, if | d i | < i = 1 , N , then operator Φ is contractive on theBanach space ( C [ a, b ] , k k ∞ ) with contractive constant d ≤ max {| d i | | i = 1 , N } .By the fixed-point theorem there exists unique function g ⋆ ∈ C [ a, b ], such thatΦ g ⋆ = g ⋆ and for all g ∈ C [ a, b ] we havelim n →∞ k Φ n ( g ) − g ⋆ k ∞ = 0 . We will call g ⋆ fractal interpolation function. It is clear, that if g ∈ C [ a, b ], g ( x ) = y and g ( x N ) = y N , then Φ( g ) passes through points of interpolation.In this case we will call Φ n ( g ) pre-fractal interpolation functions of order n . Example 1
Picture shows fractal interpolation function, which was constructedon points of interpolation (0 , , (0 . , .
5) (1 , with parameters d = d = 0 . . .2 0.4 0.6 0.8 1.00.10.20.30.40.50.6 Figure 1: Fractal interpolation function.
From now on we assume, that | d i | < i = 1 , N . We try to approximatefunction g ∈ C [ a, b ] by the fractal interpolation function g ⋆ , which is constructedon points of interpolation { ( x i , y i ) } Ni =0 . Thus, it is sufficient to fit parameters d i ∈ ( − ,
1) to minimize the distance between g and g ⋆ .We use methods that have been developed for fractal image compression [3].Notice, that from (3), (2) and (1) follows, that for all g, h ∈ L [ a, b ] k Φ g − Φ h k = sZ ba (Φ g − Φ h ) d x = vuut N X i =1 d i Z x i x i − ( g ◦ u − i ( x ) − h ◦ u − i ( x )) d x ≤ max i =1 ,N {| d i |} · vuut N X i =1 a i Z ba ( g − h ) d x = max i =1 ,N {| d i |} · k g − h k . Thus, Φ : L [ a, b ] → L [ a, b ] is contractive operator with a fixed point g ⋆ .Furthermore, instead of minimization of k g − g ⋆ k we will minimize k g − Φ g k , that makes the problem of optimization much easier. The collage theoremprovides validity of such approach. Theorem 1
Let ( X, d ) be a non-empty complete metric space. Let T : X → X be a contraction mapping on X with contractivity factor c < . Then for all x ∈ X d ( x, x ⋆ ) ≤ d ( x, T ( x ))1 − c where x ⋆ is the fixed point of T . ◮ For all integer n we have d ( x, x ⋆ ) ≤ d ( x, T ( x )) + d ( T ( x ) , T ( x )) + · · · + d ( T n − ( x ) , T n ( x )) + d ( T n ( x ) , x ⋆ ) ≤ d ( x, T ( x ))(1 + c + c + · · · + c n − ) + d ( T n ( x ) , x ⋆ ) . n → ∞ we establish the formula. ◭ Considering (1) and (2), we rewrite (3):(Φ g )( x ) = N X i =1 (cid:16) α i ( x ) − d i (cid:0) β i ( x ) − g ◦ γ i ( x ) (cid:1)(cid:17) χ [ x i − ,x i ] ( x ) , (4)where α i ( x ) = ( y i − y i − ) x + ( x i y i − − x i − y i ) x i − x i − ,β i ( x ) = ( y N − y ) x + ( x i y − x i − y N ) x i − x i − , (5) γ i ( x ) = ( b − a ) x + ( x i a − x i − b ) x i − x i − . Thus, we have to minimize functional( k g − Φ g k ) = N X i =1 Z x i x i − (cid:16) g ( x ) − α i ( x ) + d i (cid:0) β i ( x ) − g ◦ γ i ( x ) (cid:1)(cid:17) d x. Setting partial derivatives with respect to d i to zero we obtain d i = R x i x i − (cid:0) α i ( x ) − g ( x ) (cid:1)(cid:0) β i ( x ) − g ◦ γ i ( x ) (cid:1) d x R x i x i − (cid:0) β i ( x ) − g ◦ γ i ( x ) (cid:1) d x , i = 1 , . . . , N. (6) In this section we will approximate discrete data Z = { ( z m , w m ) } Mm =1 , a = z 1) to minimize M X m =1 ( w m − g ⋆ ( z m )) . Let us approximate Z by the piecewise constant function g : [ a, b ] → R .More precisely g ( z ) = w m , where ( z m , w m ) ∈ Z and z m is a nearest neighbor of z . From (6) we obtain the discrete formulas for d i : d i = P z m ∈ [ x i ,x i +1 ] (cid:0) α i ( z m ) − w m (cid:1)(cid:0) β i ( z m ) − g ◦ γ i ( z m ) (cid:1)P z m ∈ [ x i ,x i +1 ] (cid:0) β i ( z m ) − g ◦ γ i ( z m ) (cid:1) , i = 1 , . . . , N − . (7)After finding d i we obtain formulas for affine transformations A i and we areable to construct fractal interpolation function g ⋆ for g .4ur aim is to compare fractal approximation with a piecewise quadraticapproximation function which is based on the same discretization. On eachsegment [ x i − , x i ] approximating function has the quadratic form q i ( x ) = k i x + r i x + l i . To get a continuous function we claim that q i ( x i − ) = g ( x i − ) and q i ( x i ) = g ( x i ). From this we find coefficients k i and l i . To find free parameter r i we minimize functional X z m ∈ [ x i − ,x i ] ( w m − q i ( z m )) with respect to r i on each segment [ x i − , x i ] , i = 1 , N . The approximatingfunction q ( x ) will have following form: q ( x ) = q ( x ) = k x + r x + l , x ∈ [ a = x , x ]; q ( x ) = k x + r x + l , x ∈ [ x , x ];... q N ( x ) = k N x + r N x + l N , x ∈ [ x N − , x N = b ] . Since there is one free parameter r i in each function q i ( x ) and one parameter d i for each affine transformation A i it makes the comparison correct.To compare fractal and quadratic approximations we consider four types ofdata.1. Polynomial function.2. DNA sequence.3. Price graph.4. Random walking graph.For all types of data M = 10000, z m = m , [ a, b ] = [1 , M ], { w m } Mm =1 arenormalized sequences, that is E ( { w m } ) = 0 and E ( { w m } ) = 1. For all cases wechoose ( x , y ) = (1 , w ), ( x N , y N ) = ( M, w M ) and other interpolation points( x i , y i ), i = 1 , N − Example 2 Let f ( x ) = − x + 5 x + 5 x − x + x , x ∈ [ − , . . As wework with the segment [1 , M ] we map [ − , . to it. Consider sequence v m = f (cid:16) m − M − − (cid:17) , m = 1 , M . Set w m = ( v m − s ) /s , where s and s are meanand deviation of { v m } Mm =1 . Figure 2 shows the normalized sequence { w m } .Choose five interpolation points x = 1 , x = 500 , x = 4000 , x = 7500 , x = 10000 . Applying (7) we obtain d = 0 . , d = 0 . , d = 0 . , d = 0 . . The small values of | d i | mean that on segments [ x i − , x i ] fractalapproximation function looks as a straight line. Figure 3 shows the graphs offractal and quadratic approximating functions. 000 4000 6000 8000 10000 - - Figure 2: The graph of original function g .Figure 3: Fractal and quadratic interpolations of the polynomial function. Example 3 A DNA sequence can be identified with a word over an alphabet N = { A, C, G, T } . Here we have the sequence of 10000 nucleotides of Edward-siella tarda. The graph represented by the formula v = 0 , v m = v m − + (cid:26) +1 , if m th nucleotide belongs to (A,G) ; − , if m th nucleotide belongs to (C,T) . For full description of representation of DNA primary sequences see [4]. Figure4 shows the sequence { w m } after normalization of { v m } according to the formulain the previous example. Interpolation points are x = 1 , x = 1000 , x = 2500 , x = 3000 , x = 3500 , x = 5000 , x = 6500 , x = 7000 , x = 8000 , x = 9000 , x = 10000 . Applying (7) we obtain d = − . , d = 0 . , d = 0 . , d = 0 . , d = − . , d = 0 . , d = − . , d = − . , d = 0 . , d = 0 . . Figure 5 shows the graphs of fractal and quadratic approximatingfunctions. Example 4 We take price wave of 10000 prices v m , m = 1 , M of one dayperiod for EUR/USD, then normalize it (Figure 6). Interpolation points are - - Figure 6: Picture shows Price Graph for EUR/USD.7 = 0 , x = 500 , x = 1500 , x = 2000 , x = 2500 , x = 3000 , x = 4000 , x = 5000 , x = 6000 , x = 8000 , x = 10000 . Applying (7) we obtain d = − . , d = − . , d = 0 . , d = 0 . , d = 0 . , d = − . , d = − . , d = 0 . , d = 0 . , d = − . . Figure 7 shows the graphsof fractal and quadratic approximating functions. Figure 7: Fractal and quadratic interpolations of the Price Graph. Example 5 Picture shows Random Walking Graph. It represented by the for-mula v = 0 , v i = v i − + ξ i , where ξ i is a random value with normal distribution.Interpolation points are x = 0 , x = 1500 , x = 2000 , x = 3000 , x = 4000 , Figure 8: Normalized Random Walking graph. x = 5500 , x = 6300 , x = 7600 , x = 8000 , x = 9000 , x = 10000 .Applying (7) we obtain d = − . , d = 0 . , d = − . , d = − . , d = 0 . , d = 0 . , d = − . , d = − . , d = 0 . , d = − . .Figure 9 shows the graphs of fractal and quadratic approximating functions. To compare the results we calculate approximation errors for each type ofdata. Let h ( x ) be the approximating function for data { w m } Mm =1 . Then ap-8igure 9: Fractal and quadratic interpolations of the Random Walking graph.proximation error is vuut M X m =1 ( h ( x m ) − w m )) M . Here we represent the table of approximation errors for each type F ractal QuadraticP olynomialF unction . . DN A P rimary Sequence . . P rice Graph . . Random W alking . . References [1] C. Bandt, A. Kravchenko. Differentiability of fractal curves . Nonlinearity,24(10):2717–2728, 2011.[2] M. F. Barnsley. Fractals Everywhere . Academic Press Inc., MA, 1988.[3] M. F. Barnsley and L. P. Hurd. Fractal Image Compression . Wellesley,MA:AK Peters, 1993.[4] Feng-lan Bai, Ying-zhao Liu, Tian-ming Wang. A representation of DNAprimary sequences by random walk . Mathematical Biosciences 209 (2007)282–291. 95] J. Hutchinson. Fractals and self similarity. Indiana Univ. Math. J., 30:713–747, 1981.[6] P. Massopust. Interpolation and approximation with splines and fractals. Oxford University Press, Oxford, 2010.[7] H. E. Stanley, S. V. Buldyrev, A. L. Goldbergerb, J. M. Hausdorff, S. Havlin,J. Mietusb, C. K. Peng, F. Sciortino and M. Simons.