Two Minute Walking Test Experiment

Pim van Oirschot
Orikami blog
Published in
6 min readApr 26, 2017
Figure 1: Picture taken of five of the six people that preformed these tests on a running track in Nijmegen.

Multiple sclerosis (MS) is an unpredictable, often disabling disease of the central nervous system in which the immune system attacks the protective sheath (myelin) that covers nerve fibers. This disrupts the flow of information within the brain, and between the brain and body. Walking limitations are among the most visible manifestations of MS, but signs and symptoms of MS vary widely and depend on the amount of nerve damage and which nerves are affected. Some people with severe MS may lose the ability to walk independently or at all, while others may experience long periods of remission without any new symptoms. The 2-Minute Walking Test (2MWT) is a variant of the frequently used 6-Minute Walking Test to assess walking endurance, that takes less time to perform and is a smaller burden to persons with MS, especially to those with decreased mobility. The “Mijn Kwik” app that is currently being developed at orikami examines the functional mobility of a person with MS, by measuring the distance walked during the 2MWT. For more information about orikami’s work on MS, please visit our MS Thuis website.

Experiment testing

In order to estimate the distance walked during the 2MWT, the following four parameters are used of the Global Positioning System (GPS) data that was gathered by the smartphone during the test: latitude, longitude, accuracy, and time. For testing the distance calculation algorithm, the 2MWT was done on seven different phones (indicated hereafter by the letters A — G) on an (athletics) running track in Nijmegen. Six people walking side by side performed the test a total of 16 times, at varying distances. 50 meters, 100 meters, 200 meters, and an unknown distance (although a human estimate would probably be between 150 and 200 meters) were walked three times each, and 150 meters was walked four times (Figure 1).

Timestamp artifacts

In Figure 2, a histogram of the GPS data points per timestamp range is shown for each phone, using phone A’s first time datapoint as zero. For the data from the tests with fixed distances, the distance walked is shown in the upper right corner of each panel. Note that there was no GPS data stored for phone G during the 100 m walking experiment plotted here.

Figure 2: Histograms of the number of data points (vertical axis) per time passed in seconds (horizontal axis) since the beginning of the walking tests.

A few interesting artifacts become clear: all phones are expected to have the earliest timestamp around time zero. However, phone B and C (corresponding to the green and red histograms, respectively) have often stored GPS data with a timestamp that is approximately 100 or 150 seconds before the starting timestamp. Furthermore, phones D and E (corresponding to the cyan and magenta histograms, respectively) often have stored GPS data for more than 120 seconds. These artifacts should either be removed by data cleaning, or something should be changed in the way the data is stored. In the following algorithm, the first of these two options is used.

Applying filters

The early data points can be filtered out using a histogram of all data points, as is shown in Figure 2, in which phones B and C clearly show a data gap. Only the data on the right side of the gap is used for the distance calculation. This is the first filter that is applied to the data. For the second filter, the accuracy is used. Only data points with a maximum inaccuracy of 20 meters are used. As a third filter, all data points with a timestamp larger than 120 seconds after the earliest data point in the data sample obtained by applying the first two filters are removed.

As a fourth filter, data points that are unrealistic because they would correspond to a walking speed of more than 3 m/s (10.8 km/s, which is a running pace) are removed. To this end, the data points are sorted in time, and the GPS latitude and longitude are converted to a distance walked in kilometers. For the latter, we use the haversine formula. Each data point that passed the first three filters is compared with the previous data point in a time-sorted list, and passed through this filter if and only if the change in distance (expressed in m) divided by the change in time (expressed in s) is smaller than 3 m/s.

Having applied this fourth filter, the remaining data points can have new nearest neighbors, and therefore implied walking speeds greater than 3 m/s can still occur. As a fifth filter, the same method used in filter four is applied another time. The data points that remain after having applied these five filters are shown in Figure 3. Displacement in latitude is shown on the horizontal axis, displacement in longitude on the vertical axis. The latitude and longitude values of the first data point in the database for phone A are subtracted from all data points, so that there is always at least one data point that sits in the origin (0,0). Again, the distance walked (if known) is shown in the upper right corner of each panel in this figure. The distance walked, calculated as the sum of the distance obtained by connecting the data points, is shown in the upper left corner for each phone. The data points are connected through straight lines.

Figure 3: Filtered GPS data points of the seven phones in this experiment.

Results

In the following table, the mean deviation (in %) from the actual distance walked, as well as the standard deviation, is shown for the calculated distances over all performed experiments for which the distance was known (N=13) per phone. By accepting a mean deviation of at most 20% (rounded to integers), only the first four phones can be used to accurately calculate the distance walked with this algorithm.

Table 1: Performance of the algorithm on GPS data acquired with seven phones.

Not all hope is lost for phone E, as there is still room for improvement of the algorithm, as can be seen for example in the GPS data from the first 150 m experiment that is plotted (Figure 3, middle left panel), where the first data point in the top right corner, which could be regarded as an outlier, is not filtered out. Improvement of the algorithm hopefully also decreases the mean deviation for phone C and D to below 10%. There is little hope that the distance estimated from the GPS data acquired with phones F and G can still be improved. However, it must be noted that the GPS function of phone G was known to be unreliable. Indeed, as can be seen from Figure 3, no data point obtained using this phone passed the five filters, resulting in a mean deviation of 100%. Furthermore, in the algorithm described here, only GPS data is used. However, more than only GPS data can be used to estimate the distance walked during the walking test, for example accelerometer data. We plan to explain how this can be done in a future blog post. Note that you can stay informed about orikami, by following us on twitter.

Lessons learned

  1. There are large differences in the algorithm preformance per phone.
  2. The current version of the algorithm preforms well on 4 out of 7 phones.
  3. The GPS timestamp histograms show gaps in data collected with iPhones.

--

--