Persistent Homology of Trigonometric Functions

For this analysis I examined the persistent homology of trigonometric functions, such as f(t) = sin(t), using the JavaPlex Matlab library (see https://appliedtopology.github.io/javaplex/).

I first took sliding window samples of the function f(t) = sin(t). Define a sliding window as

,

and define the point cloud of sliding windows

.

where is a set of so-called "starting points" for each sliding window, d + 1 is the number of points sampled from f in each sliding window and the dimension of the point cloud of sliding windows, and tau is the step between points sampled within each sliding window.

After generating the points, I created a Vietoris-Rips filtered simplicial complex from the point cloud using JavaPlex. With parameters d = 45, tau = 0.2, and as the set of 40 equally distributed reals on [0,8*pi], I produced the following barcode:



In this plot, we see a number of small bars in dimension zero, but one bar persists infinitely. This means that as the simplicial complex is built, eventually there is only one connected structure containing all points. We also notice that upon the "collapse" of all of the smaller dimension-zero simplicies, a long bar in dimension one emerges, representing a hole. There is some noise in dimension two but these bars are relatively quite small and thus not indicative of a persisting structure in the point cloud. From the bar code, we get Betti numbers B0 = 1, B1 = 1, B2 = 0. These are the same Betti numbers of a one-dimensional circle. There is one connected structure, and a hole in the center. From this we draw the conclusion that the underlying function, sin(t) is periodic.

We call maximum persistence the longest bar in dimension one. For the above plot, the maximum persistence is equal to 7.6. Maximum persistence is dependent upon the parameters, and it took some adjustment of the parameters dtau, and T,  to create a plot with the highest maximum persistence that I could achieve. What I found is that increasing the number of sliding windows, i.e. the size of the set T, increased the maximum persistence. This was limited by the computational power of my computer, which doesn't have enough memory to compute for many more than about 50 points.

I also found that setting the maximum and minimum values in the set to be multiples of 2*pi increased the maximum persistence compared to other selections. The set that I used for the above barcode contains 4 complete cycles of the sin function. As a method for choosing the parameter T in general, I suggest that it is chosen as a multiple of the length of the period of the function being analyzed.

I also found that as d increased, so too did the maximum persistence. Recall that d + 1 is the number of values of f(t) = sin(t) that are sampled in each sliding window. A low value of d means that each sliding window only contains a few points from the function f. At a low enough value of d, the overall pattern of the function may not be evident in the sliding windows. Increasing d means that the pattern of the function will be more clear in each sliding window, as there are more points sampled, and those points are closer together and thus better resemble the underlying function.

The parameter tau determines how far apart the points sampled in each sliding window are. I think tau is analogous to the "resolution" of the sliding window. When choosing tau, I think that it is important that the points be close enough together (tau low enough) so that the overall pattern of the function is evident, but that the points be spaced out enough (tau high enough) so that the sliding window intervals are wide enough to contain the pattern of the function. "Zooming in," so to speak, on the function too much will mask the bigger picture, but looking at it from too far away also diminishes the overall pattern. Thus a "sweet spot" value of tau must be found based on the other parameters chosen. I found tau = 0.2 to create the highest maximum persistence. 

As a control, I also produced a barplot for the function f(t) = t. As this function is not periodic, I expected a different result from the barplot for f(t) = sin(t). Indeed, with parameters with parameters d = 20, tau = 0.2, and as the set of 30 equally distributed reals on [0,10], a range which contains five periods of the function, I found the following barplot:
From this plot, we can see that in dimension zero, there is one bar which persists infinitely. This means that eventually, we are left with one connected simplicial complex. There are no bars in dimensions one or two. Thus we have Betti numbers B0 = 1, B1 = 0, B2 = 0. This means that there is just one connected structure with no holes or voids, which is consistent with what is to be expected of the function of a line or flare.

Next, I used the function f(t)  = sin(t) + sin(3t) and performed a similar analysis. Because this function has the same period as f(t) = sin(t), I expected to achieve a similar maximum persistence. Indeed, with parameters d = 45, tau = 0.2, and as the set of 50 equally distributed reals on [0,8*pi], I produced the following barcode, which has maximum persistence of 7.5.

As in the barcode for sin(t), we see the persistent homology of a circle, with one persisting bar in dimension zero, one persisting bar in dimension one, and no significantly long bars in dimension two. Therefore the Betti numbers are B0 = 1, B1 = 1, B2 = 0. This is as expected; this barcode confirms that the function is indeed periodic.

The next function I analyzed was f(t)  = sin(pi * t). This function has a period of 2, which is shorter than that of sin(t). Thus, I expected to see a shorter maximum persistence for f(t)  = sin(pi * t). I also expected to have to use different parameters to get the largest maximum persistence possible. For the following plot I used parameters d = 45, tau = 0.2, and as the set of 40 equally distributed reals on [0,10].


The maximum persistence for this plot is 7.6. This is contrary to my prediction that maximum persistence would smaller due to the shorter period of this function, and raises some questions. What is the significance of maximum persistence, aside from determining Betti numbers? Does the value of maximum persistence tell you anything about the underlying function, or is it only important that it is significantly longer than the rest of bars in its dimension? At any rate, we see one persisting bar in dimension zero, one persisting bar in dimension one, and zero significant bars in dimension two (the bars visible are relatively small and therefore are only noise). Thus we have Betti numbers B0 = 1, B1 = 0, B2 = 0, which tells us the function f(t)  = sin(pi * t) exhibits the persistent homology of a circle or loop, and therefore is periodic, as we know it to be.





Comments

  1. If this is your case, we recommend you to strive your luck enjoying in} progressive jackpot video poker games. Additionally, you may also|you would possibly also|you may additionally} 코인카지노 take pleasure in classic titles such as Jacks or Better and Deuces Wild. Many on line casino sites additionally offer beneficiant welcome bonuses. The additional funds will allow you to spend extra time enjoying in} and to probably place higher bets than what may have} originally planned. To select the most handy offer for you, which is why we recommend you to consider about|to contemplate} enjoying in} at the true cash online on line casino listed below.

    ReplyDelete
  2. This exploration of the persistent homology of trigonometric functions is fascinating! Your thorough explanation makes a complex topic accessible to readers with varying levels of mathematical background. The use of diagrams and examples really helps in understanding the concepts. It's evident that a lot of effort went into making this content both informative and engaging. As someone interested in math tuition, I find your approach incredibly helpful.

    ReplyDelete

Post a Comment

Popular posts from this blog

Topological Analysis of Baseball Batting Data