Step 3.3: Framework time: MAP

Five frameworks are available and they all have their specific usage and important place in Time-Series analytics:

Let’s end with the MAP framework.

The MAP framework

Now it is time to update the values of a set of time series using the MAP framework. The MAP framework allows you to apply a function on values of a Geo time seriesTM that fall into a sliding window.

Alt Text

In other words, the MAP framework allows the user to compute the same operation on all the points of a series. For specific kind of operations (means, min, max…), some points directly before and after the current point can be added to the computation. This resume the concept of sliding window around each points.

Input parameters

Map takes as input a list of parameters. The first element of this list can be one or several lists of time series. Then there is a mapper function. The third and the fourth elements are related to the sliding window, with first an element corresponding to pre, the width of the sliding window before the value. In second, there is an element corresponding to post, the width of the sliding window after the value. The last element corresponds to occurences which is the limit of computation of a number. For all elements except the set of time series and the mapper function a default value 0 can be used, and those parameters would not be used.

// MAP Framework
[
    $gts                                // Series list or Singleton
    mapper.function                     // Mapper function operator
    0                                   // Pre
    0                                   // Post
    0                                   // Occurence
]
MAP

Pro tips: A mmapper with the pre, post and occurence parameters at zero is called a single value mapper, meaning that the mapper function will be applied to all points of a series!

To get a working mapper, replace the function keyword by an exisiting function as replace, mean, min, max, sd, abs, mul, add, round

Mapper in pictures

Let’s resume step by step each mapper element. First MAP framework requires a set of time series (Singleton or list):

Alt Text

The second step consists to choose the function to apply on each points (resp window): replace, mean, min, max, sd, abs, mul, add, round and lot of others:

Alt Text

A mapper can be tuned according to three parameters: pre which corresponds to the number of points to integrate to the sliding window before the current point:

Alt Text

The second parameter to tun a mapper consists of post: which corresponds to the number of points to integrate to the sliding window after the current point:

Alt Text

And finally the last parameter used to tun a mapper is occurences which specify the maximal number of computation of each points!

Alt Text

Now we would like to apply this specific framework to compute the same operation on all the time series points of the NASA lightcurve data. Let’s see how to process!

Hello Exo World step

In previous step we saw how to downsample the data, but what if to get the main aspect of the lightcurve we would like now to compute its approximate trend? In statistics, we could compute a moving average as example. In WarpScript, the map framework can be used to approximate such a computation. For a example we can define a window containing 5 elements before and as many after the current point and compute its mean value.

Let’s try it! Try the mapper.mean with a moving window!

Resume

The main goal of this step is to compute a moving average of some time series. To do so, you used the MAP framework, it expects on top of the stack a list of parameters containing: the time series as list or as singleton to bucketize, a mapper function, and three long parameter: pre, post and occurences.

The result of this step corresponds to a computed time series list. In our case the 4 selected time series are now on top of stack containing averaged value of all the values inside a moving window (for each point).

To be continued

Congrats, you reached the end of the framework step! Understanding the help providing by those framework is really important to help a young hunter to complete its quest to retrieve Kepler-11 exoplanet. In the next step we will focus, now that we have all the needed tools, on writing a working exploratory script to discover existing exoplanet for kepler-11!