# Application of GPS and Accelerometers in Predicting Physical Activity Patterns

Authors: Mingzhu Mo
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

To reduce the workload, to predict the physical activity mode with fewer variables, and to construct a path to predict PAM based on temporal and spatial data generated by physical activity and the amount of activity, this paper mainly uses the literature, logical analysis, and inductive method to sort out and summarize the basic methods and models in predicting physical activity mode using GPS and accelerometer at home and abroad and to construct a path from equipment. The process involves selecting and determining the predictors, collecting data, and using supervised learning algorithms and unsupervised learning algorithms. The joint use of GPS and accelerometers is fully capable of predicting physical activity patterns and can realize the method of predicting physical activity patterns based on the spatiotemporal data and the amount of activity generated by physical activity, although GPS and accelerometers have shortcomings in predicting PAM in terms of positioning error, missing data, and wearing position and mode.


---

## Body

## 1. Introduction

The World Health Organization defines physical activity as any physical movement driven by the contraction of skeletal muscles to expend energy and lists physical inactivity as the fourth leading cause of mortality worldwide [1]. In fact, the “number one killer” of human health, cardiovascular disease, is also very closely related to physical inactivity, and numerous scientific studies have demonstrated the important role of physical activity in the prevention of chronic diseases [2] and cognitive promotion [3], and there are even studies that have shown that physical activity levels are significantly associated with the prevention, treatment, and recovery of many types of cancer [4]. The general lack of physical activity worldwide and the importance of physical activity for human health have contributed to the emergence of physical activity as a hot area of research both nationally and internationally. Physical activity mode (PAM) is a specific expression of physical activity, including various forms of domestic, transportation, occupational, and leisure activities. When and where people do physical activity mode, the proportion of different physical activity modes in people’s daily life, the characteristics of physical activity modes of people of different sexes, ages, and occupations, the relationship between physical activity modes and people’s health, the psychological state when generating different physical activities, etc. are all questions that lead people to conduct in-depth research on them. At present, domestic and foreign research on physical activity is mostly focused on the measurement of physical activity and its relationship with health, but in the area of national health promotion, it is not enough to understand the adequacy of physical activity and its impact on health, and it is also necessary to further study the composition of physical activity and the psychological states and influencing factors arising from different physical activity patterns. Understanding how people engage in physical activity in their natural state of life and its rules will be of great significance to the promotion of physical activity and scientific fitness guidance for different groups of people. With the progress of science and technology and the use of new technologies and methods in daily life and scientific research, the study of the composition of physical activity and physical activity patterns is becoming a hot topic in the field of physical activity research.Currently, PAM can only be investigated through physical activity questionnaires (logs) and behavioral observation methods [5]. The advantages of physical activity questionnaires are that they can be tested on a large sample, but the disadvantages are that they are too subjective, and the use of questionnaires is more about the subjective attitudes or perceptions of the subject on certain things or things, while the PAM of the subject is the objective existence of the status quo. Especially when the respondents are children and adolescents or the elderly, the accuracy is greatly reduced due to the lack of cognitive ability of children and adolescents and the decline of cognitive ability of the elderly. The advantage of the behavioral observation method is its high accuracy, but the disadvantage is that it is time consuming and cannot be used for large data surveys. In view of this, this study attempts to construct a pathway to predict PAM based on temporal and spatial data generated by physical activity and the amount of activity based on new techniques and methods from related studies.


## 2. Overview of Relevant Research

Research on the use of GIS, GPS, and accelerometers for physical activity has been pioneered in the United States, with findings suggesting that a combination of the three can study where physical activity of varying intensities occurs in adolescent children [6]; examine the influence of the environment on physical activity in adolescent children [7]; explore the relationship between physical activity and the built environment and how the built environment affects the perception of physical activity [8]; investigate adolescent children’s use of neighborhood parks and sports facilities [9]; in addition, the same application has been made in the field of physical activity in other populations [10]; recent studies have even shown that this approach can also be used to help us understand animal locomotor behavior, and that the unsupervised learning approach employed is an ideal tool for the systematic analysis of complex multivariate locomotor data [11]. Thus, it is clear that the combination of GIS, GPS, and accelerometers used to study physical activity will continue to yield new and promising results in the future.Professor Pober [12] in the United States was one of the first researchers to use accelerometer data to predict physical activity patterns. He selected six test subjects wearing accelerometers to perform four physical activity patterns of walking, walking uphill, cleaning and vacuuming, and doing desk work and performed quadratic discriminant analysis on the data (quadratic discriminant analysis). Troped et al. [13] selected 10 healthy adults aged 23–51 years and asked them to wear accelerometers while wearing GPS devices to perform the activities of slow walking, fast walking/running, cycling, rollerblading, and driving, respectively. They were asked to wear accelerometers and GPS devices to perform five types of physical activities: slow walking, brisk walking/running, bicycling, roller skating, and driving. Discriminant function analysis was used to analyze the data, and the results showed that the accuracy of predicting different PAMs in minutes for 200 minutes was 91% and in rounds for 43 rounds was 98%. This experiment is one of the first studies to combine the use of GPS and accelerometers to predict PAM, and the experimental procedure has great reference value. The inclusion of GPS data to distinguish between two PAMs with similar activity levels but different speeds helped researchers to more accurately distinguish between relatively stationary and moving PAMs. Ruben and Bruno [14] concluded that active transportation modes are important sources of physical activity and have a positive impact on health. Montoye et al. [15] used seven laboratory activity tests on 24 subjects (age = 27.6 ± 6.2) to develop models for classifying sedentary, walking, and running. The results showed that the overall classification accuracy of walking and running was 92.7%.In recent years, domestic scholars have been heating up the research on the application of accelerometer sensors to measure physical activity. The main focus has been on the study of the reliability and validity of accelerometer motion sensors applied in physical activity; the establishment of related energy consumption prediction models; and accelerometer sensors in physical activity measurement and evaluation applications and other related studies. The study concluded that the three accelerometers used in China, ActiGraph GT3X, LivePod LP2, and Armband, have good reliability and validity, and different accelerometers are applied under different conditions, and their reliability and validity vary. The energy consumption equations established in different ways have large differences, and a suitable joint segmented equation energy consumption prediction model should be selected for a specific physical activity in accelerometer application.


## 3. Testing Method

### 3.1. Selection of Equipment and Devices

In the world of sports, the progress of science and technology is not only reflected in the development of sports technology but also in the renewal of equipment and devices. Accelerometers were first used to measure the linear acceleration of the carrier body; based on the principle of acceleration in theX, Y, and Z axes in space when the human body moves, it can be applied to the field of physical activity measurement after modification. Researchers at the American College of Sports Medicine (ACSM) concluded in a study of papers presented at the ACSM annual meeting that accelerometers are used in more than 90% of studies related to physical activity measurement, and that the ActiGraph series of accelerometers is currently the most widely used accelerometer in the world. The ActiGraph GT3X + is a widely validated and effective device for physical activity monitoring and energy expenditure estimation. Many domestic studies involving physical activity measurements have also used such accelerometers, and the device has been widely accepted by researchers both in China and abroad. There is only one model of domestic accelerometer on the market, the LivePod LP2, and the search results on CNKI show that there is only one physical activity study using this accelerometer, and the domestic accelerometer has not been widely recognized by domestic researchers. Therefore, in the selection of physical activity measurement equipment, it is recommended that our researchers choose the ActiGraph series accelerometers.The Global Positioning System (GPS) is a satellite navigation system developed and built by the United States, which has the characteristics of all-round, all-time, and high accuracy, and its role is positioning and navigation. It has been widely used in many fields of social production and is closely related to our daily life. For example, almost all the smartphones we use nowadays are installed with GPS, carrying map software to facilitate our travel. The geographic information system (GIS) is a technical system for collecting, storing, managing, computing, analyzing, displaying, and describing data about geographic distribution in the whole or part of the Earth’s surface space with the support of computer software and hardware. For example, the map software we commonly use, such as Baidu Map and Gaode Map, contains a huge amount of geographic information data, which is essentially a GIS. GIS and GPS have a close relationship, GPS is an important source of GIS data, and GIS is an important tool and platform for processing GPS data. The focus of this study is on predicting physical activity, and the relationship between physical activity and geographic environment is not considered for the time being, so only a brief introduction to GIS is given [16–18]. There are various models of GPS devices based on different accuracy requirements, and their positioning principles are the same. Only the appearance and size of the products of different companies or the applicable environment may be different, so this paper does not make further comparison of GPS devices. In addition, we need to use the cumulative distribution function, which can be defined by the following formula:(1)pro=NumiNum,i∈0,1,2,...,N−1,Ai=limi⟶∞∑j=0iproij=limi⟶∞∑j=0iNumiNum.


### 3.2. Building the Prediction Model

#### 3.2.1. Selection of Variables

Both accelerometers and GPS devices generate large amounts of data that are cumbersome to process. In studies related to physical activity using only accelerometers, some researchers chose counts as the only variable, others chose counts and steps (steps) as variables [12], while in studies related to PAM using a combination of GPS, researchers chose GPS variables and accelerometer variables. Among the data provided by GPS (see Table 1), the most valuable ones for this study are coordinates and time. Knowing the coordinates of two points, the distance between the two points (d=Lo1−Lo22+La1−La22), and the time, the speed of displacement from one point to another (s = d/t, s = speed, d = distance, and t = time) can be calculated. In addition, time is used to match the data generated by the accelerometer, which requires us to make sure that the time is consistent when setting up the accelerometer and the GPS device. Combining the control and selection of variables from existing studies and the selection of data available from the GPS device and accelerometer, speed (speed), count, and step count are currently the most suitable predictors for the model. Table 1 shows the GPS data when setting the time interval to 30 seconds, and Figure 1 shows the results of comparison of GPS data.Table 1
GPS data when setting the time interval to 30 seconds.
CoordinateMEVSATimeDateLoLaUnit: (m)Unit: (°)118.82406232.1824014280.0406 : 09 : 302021-9-3118.82411532.1824263309.7806 : 10 : 002021-9-3118.82411532.1824261309.7806 : 10 : 302021-9-3118.82428132.182414676.4606 : 11 : 002021-9-3118.82431932.1822123132.8806 : 11 : 302021-9-3118.82422932.1823252132.8806 : 12 : 002021-9-3118.82422932.1823255132.8806 : 12 : 302021-9-3Lo = longitude, La = latitude, MEV = maximum error value, and SA = satellite angle.Figure 1
Comparison of GPS data.


#### 3.2.2. Modeling Algorithm with Supervised Learning

Supervised learning is a common machine learning method that builds mathematical models to predict unknown samples after the characteristics of a certain sample are known, which is simply classification, i.e., a model is obtained by training with existing training samples and this model is used to make simple judgments on the output to achieve classification of unknown data. When supervised learning algorithms are used, training samples (training data) with known categories are necessary. In the study of predictive PAM, the training samples were obtained mainly by the following way: the testers put the test subjects in an experimental observation environment and specified that they could only perform one type of PAM in a certain period of time and collected the records and processed the data as a standard reference dataset for that type of PAM. After establishing the dataset, some researchers have used univariate statistical analysis (univariate statistics) to select the mean, median, and quartiles to build a classification model and classify the unknown PAM data. This method essentially establishes a threshold interval of variables, and the unclassified data that meet the threshold interval of multiple variables of a certain PAM at the same time are then classified and defined as such PAM. Supervised learning is well controllable and does not require the literacy level of the test population, but it increases the workload of the testers and is not suitable for large data surveys. It is important to note here that there will be great variability in physical activity between test populations of different ages and genders. The division of age groups is based on the law of human growth and development, which is important for the collection of standard datasets. The current criteria for dividing the age groups of the Chinese population are as follows: childhood (0–6), adolescence (7–17), youth (18–40), middle age (41–65), and old age (66+). The international age group division is slightly different from that of China (the elderly are those aged 76 years or older). Children and adolescents and the elderly are in the rapid growth and development and decline stages of the human body, respectively, and the amount of physical activity in different age groups within the age range varies greatly, so it is recommended that these two age groups be further divided specifically in the physical activity study.


#### 3.2.3. Modeling Algorithms with Unsupervised Learning

Unsupervised learning refers to the method of identifying and classifying unknown classes of training data, and it has been suggested that this method can handle large amounts of data and does not require direct observation of the behavior of the test object. The most typical algorithm in unsupervised learning is cluster analysis, which is used to classify data directly based on the similarity of the data when the overall classification is not clear and the data under the same clusters have a very high similarity. After defining the PAM for the categories derived from the cluster analysis, discriminant analysis is then used to create a discriminant formula to discriminate the new data. This approach allows the test subjects to be in free-living conditions, but it is still necessary to know which PAMs were performed by the test subjects. To solve this problem, some researchers have asked the test subjects to fill out their own physical activity logs while wearing the instrument or to send PAM information to the researchers via instant messenger. After the classification was completed, discriminant analysis was used to create a discriminant formula to discriminate the new data. In the field of physical activity measurement, unsupervised learning obviously relies more on the subjectivity and cooperation of the test subjects than supervised learning and is also more suitable for large data surveys, which can be used for test populations with higher cooperation and better cognitive abilities. However, when the test subjects are children and adolescents, the elderly, and other special populations, perhaps supervised learning algorithms are more suitable than unsupervised learning algorithms. It should be noted that unsupervised learning encompasses numerous algorithms, such as K-means or K-median, which are common in partitioning clustering algorithms, and ROCK, which is a hierarchical clustering algorithm. The SPSS software provides powerful data analysis functions, which can help us to further study the accuracy of different algorithms. Here, we only introduce the Hessian matrix and related derivation.The Hessian matrix can be expressed as(2)Hessian=∂2∂x2∂2∂x∂y∂2∂x∂y∂2∂y2.The Hessian matrix discriminant is as follows:(3)Hessian'=∂2∂x2∂2∂y2−∂2∂xy.We can use the following formula to calculate the three matrix elements on they scale of the matrix:(4)GX,Y=∂2∂x2X′,HessianX,Y=∂xxX,Y∂xyX,Y∂xyX,Y∂yyX,Y.


## 3.1. Selection of Equipment and Devices

In the world of sports, the progress of science and technology is not only reflected in the development of sports technology but also in the renewal of equipment and devices. Accelerometers were first used to measure the linear acceleration of the carrier body; based on the principle of acceleration in theX, Y, and Z axes in space when the human body moves, it can be applied to the field of physical activity measurement after modification. Researchers at the American College of Sports Medicine (ACSM) concluded in a study of papers presented at the ACSM annual meeting that accelerometers are used in more than 90% of studies related to physical activity measurement, and that the ActiGraph series of accelerometers is currently the most widely used accelerometer in the world. The ActiGraph GT3X + is a widely validated and effective device for physical activity monitoring and energy expenditure estimation. Many domestic studies involving physical activity measurements have also used such accelerometers, and the device has been widely accepted by researchers both in China and abroad. There is only one model of domestic accelerometer on the market, the LivePod LP2, and the search results on CNKI show that there is only one physical activity study using this accelerometer, and the domestic accelerometer has not been widely recognized by domestic researchers. Therefore, in the selection of physical activity measurement equipment, it is recommended that our researchers choose the ActiGraph series accelerometers.The Global Positioning System (GPS) is a satellite navigation system developed and built by the United States, which has the characteristics of all-round, all-time, and high accuracy, and its role is positioning and navigation. It has been widely used in many fields of social production and is closely related to our daily life. For example, almost all the smartphones we use nowadays are installed with GPS, carrying map software to facilitate our travel. The geographic information system (GIS) is a technical system for collecting, storing, managing, computing, analyzing, displaying, and describing data about geographic distribution in the whole or part of the Earth’s surface space with the support of computer software and hardware. For example, the map software we commonly use, such as Baidu Map and Gaode Map, contains a huge amount of geographic information data, which is essentially a GIS. GIS and GPS have a close relationship, GPS is an important source of GIS data, and GIS is an important tool and platform for processing GPS data. The focus of this study is on predicting physical activity, and the relationship between physical activity and geographic environment is not considered for the time being, so only a brief introduction to GIS is given [16–18]. There are various models of GPS devices based on different accuracy requirements, and their positioning principles are the same. Only the appearance and size of the products of different companies or the applicable environment may be different, so this paper does not make further comparison of GPS devices. In addition, we need to use the cumulative distribution function, which can be defined by the following formula:(1)pro=NumiNum,i∈0,1,2,...,N−1,Ai=limi⟶∞∑j=0iproij=limi⟶∞∑j=0iNumiNum.


## 3.2. Building the Prediction Model

### 3.2.1. Selection of Variables

Both accelerometers and GPS devices generate large amounts of data that are cumbersome to process. In studies related to physical activity using only accelerometers, some researchers chose counts as the only variable, others chose counts and steps (steps) as variables [12], while in studies related to PAM using a combination of GPS, researchers chose GPS variables and accelerometer variables. Among the data provided by GPS (see Table 1), the most valuable ones for this study are coordinates and time. Knowing the coordinates of two points, the distance between the two points (d=Lo1−Lo22+La1−La22), and the time, the speed of displacement from one point to another (s = d/t, s = speed, d = distance, and t = time) can be calculated. In addition, time is used to match the data generated by the accelerometer, which requires us to make sure that the time is consistent when setting up the accelerometer and the GPS device. Combining the control and selection of variables from existing studies and the selection of data available from the GPS device and accelerometer, speed (speed), count, and step count are currently the most suitable predictors for the model. Table 1 shows the GPS data when setting the time interval to 30 seconds, and Figure 1 shows the results of comparison of GPS data.Table 1
GPS data when setting the time interval to 30 seconds.
CoordinateMEVSATimeDateLoLaUnit: (m)Unit: (°)118.82406232.1824014280.0406 : 09 : 302021-9-3118.82411532.1824263309.7806 : 10 : 002021-9-3118.82411532.1824261309.7806 : 10 : 302021-9-3118.82428132.182414676.4606 : 11 : 002021-9-3118.82431932.1822123132.8806 : 11 : 302021-9-3118.82422932.1823252132.8806 : 12 : 002021-9-3118.82422932.1823255132.8806 : 12 : 302021-9-3Lo = longitude, La = latitude, MEV = maximum error value, and SA = satellite angle.Figure 1
Comparison of GPS data.


### 3.2.2. Modeling Algorithm with Supervised Learning

Supervised learning is a common machine learning method that builds mathematical models to predict unknown samples after the characteristics of a certain sample are known, which is simply classification, i.e., a model is obtained by training with existing training samples and this model is used to make simple judgments on the output to achieve classification of unknown data. When supervised learning algorithms are used, training samples (training data) with known categories are necessary. In the study of predictive PAM, the training samples were obtained mainly by the following way: the testers put the test subjects in an experimental observation environment and specified that they could only perform one type of PAM in a certain period of time and collected the records and processed the data as a standard reference dataset for that type of PAM. After establishing the dataset, some researchers have used univariate statistical analysis (univariate statistics) to select the mean, median, and quartiles to build a classification model and classify the unknown PAM data. This method essentially establishes a threshold interval of variables, and the unclassified data that meet the threshold interval of multiple variables of a certain PAM at the same time are then classified and defined as such PAM. Supervised learning is well controllable and does not require the literacy level of the test population, but it increases the workload of the testers and is not suitable for large data surveys. It is important to note here that there will be great variability in physical activity between test populations of different ages and genders. The division of age groups is based on the law of human growth and development, which is important for the collection of standard datasets. The current criteria for dividing the age groups of the Chinese population are as follows: childhood (0–6), adolescence (7–17), youth (18–40), middle age (41–65), and old age (66+). The international age group division is slightly different from that of China (the elderly are those aged 76 years or older). Children and adolescents and the elderly are in the rapid growth and development and decline stages of the human body, respectively, and the amount of physical activity in different age groups within the age range varies greatly, so it is recommended that these two age groups be further divided specifically in the physical activity study.


### 3.2.3. Modeling Algorithms with Unsupervised Learning

Unsupervised learning refers to the method of identifying and classifying unknown classes of training data, and it has been suggested that this method can handle large amounts of data and does not require direct observation of the behavior of the test object. The most typical algorithm in unsupervised learning is cluster analysis, which is used to classify data directly based on the similarity of the data when the overall classification is not clear and the data under the same clusters have a very high similarity. After defining the PAM for the categories derived from the cluster analysis, discriminant analysis is then used to create a discriminant formula to discriminate the new data. This approach allows the test subjects to be in free-living conditions, but it is still necessary to know which PAMs were performed by the test subjects. To solve this problem, some researchers have asked the test subjects to fill out their own physical activity logs while wearing the instrument or to send PAM information to the researchers via instant messenger. After the classification was completed, discriminant analysis was used to create a discriminant formula to discriminate the new data. In the field of physical activity measurement, unsupervised learning obviously relies more on the subjectivity and cooperation of the test subjects than supervised learning and is also more suitable for large data surveys, which can be used for test populations with higher cooperation and better cognitive abilities. However, when the test subjects are children and adolescents, the elderly, and other special populations, perhaps supervised learning algorithms are more suitable than unsupervised learning algorithms. It should be noted that unsupervised learning encompasses numerous algorithms, such as K-means or K-median, which are common in partitioning clustering algorithms, and ROCK, which is a hierarchical clustering algorithm. The SPSS software provides powerful data analysis functions, which can help us to further study the accuracy of different algorithms. Here, we only introduce the Hessian matrix and related derivation.The Hessian matrix can be expressed as(2)Hessian=∂2∂x2∂2∂x∂y∂2∂x∂y∂2∂y2.The Hessian matrix discriminant is as follows:(3)Hessian'=∂2∂x2∂2∂y2−∂2∂xy.We can use the following formula to calculate the three matrix elements on they scale of the matrix:(4)GX,Y=∂2∂x2X′,HessianX,Y=∂xxX,Y∂xyX,Y∂xyX,Y∂yyX,Y.


## 3.2.1. Selection of Variables

Both accelerometers and GPS devices generate large amounts of data that are cumbersome to process. In studies related to physical activity using only accelerometers, some researchers chose counts as the only variable, others chose counts and steps (steps) as variables [12], while in studies related to PAM using a combination of GPS, researchers chose GPS variables and accelerometer variables. Among the data provided by GPS (see Table 1), the most valuable ones for this study are coordinates and time. Knowing the coordinates of two points, the distance between the two points (d=Lo1−Lo22+La1−La22), and the time, the speed of displacement from one point to another (s = d/t, s = speed, d = distance, and t = time) can be calculated. In addition, time is used to match the data generated by the accelerometer, which requires us to make sure that the time is consistent when setting up the accelerometer and the GPS device. Combining the control and selection of variables from existing studies and the selection of data available from the GPS device and accelerometer, speed (speed), count, and step count are currently the most suitable predictors for the model. Table 1 shows the GPS data when setting the time interval to 30 seconds, and Figure 1 shows the results of comparison of GPS data.Table 1
GPS data when setting the time interval to 30 seconds.
CoordinateMEVSATimeDateLoLaUnit: (m)Unit: (°)118.82406232.1824014280.0406 : 09 : 302021-9-3118.82411532.1824263309.7806 : 10 : 002021-9-3118.82411532.1824261309.7806 : 10 : 302021-9-3118.82428132.182414676.4606 : 11 : 002021-9-3118.82431932.1822123132.8806 : 11 : 302021-9-3118.82422932.1823252132.8806 : 12 : 002021-9-3118.82422932.1823255132.8806 : 12 : 302021-9-3Lo = longitude, La = latitude, MEV = maximum error value, and SA = satellite angle.Figure 1
Comparison of GPS data.


## 3.2.2. Modeling Algorithm with Supervised Learning

Supervised learning is a common machine learning method that builds mathematical models to predict unknown samples after the characteristics of a certain sample are known, which is simply classification, i.e., a model is obtained by training with existing training samples and this model is used to make simple judgments on the output to achieve classification of unknown data. When supervised learning algorithms are used, training samples (training data) with known categories are necessary. In the study of predictive PAM, the training samples were obtained mainly by the following way: the testers put the test subjects in an experimental observation environment and specified that they could only perform one type of PAM in a certain period of time and collected the records and processed the data as a standard reference dataset for that type of PAM. After establishing the dataset, some researchers have used univariate statistical analysis (univariate statistics) to select the mean, median, and quartiles to build a classification model and classify the unknown PAM data. This method essentially establishes a threshold interval of variables, and the unclassified data that meet the threshold interval of multiple variables of a certain PAM at the same time are then classified and defined as such PAM. Supervised learning is well controllable and does not require the literacy level of the test population, but it increases the workload of the testers and is not suitable for large data surveys. It is important to note here that there will be great variability in physical activity between test populations of different ages and genders. The division of age groups is based on the law of human growth and development, which is important for the collection of standard datasets. The current criteria for dividing the age groups of the Chinese population are as follows: childhood (0–6), adolescence (7–17), youth (18–40), middle age (41–65), and old age (66+). The international age group division is slightly different from that of China (the elderly are those aged 76 years or older). Children and adolescents and the elderly are in the rapid growth and development and decline stages of the human body, respectively, and the amount of physical activity in different age groups within the age range varies greatly, so it is recommended that these two age groups be further divided specifically in the physical activity study.


## 3.2.3. Modeling Algorithms with Unsupervised Learning

Unsupervised learning refers to the method of identifying and classifying unknown classes of training data, and it has been suggested that this method can handle large amounts of data and does not require direct observation of the behavior of the test object. The most typical algorithm in unsupervised learning is cluster analysis, which is used to classify data directly based on the similarity of the data when the overall classification is not clear and the data under the same clusters have a very high similarity. After defining the PAM for the categories derived from the cluster analysis, discriminant analysis is then used to create a discriminant formula to discriminate the new data. This approach allows the test subjects to be in free-living conditions, but it is still necessary to know which PAMs were performed by the test subjects. To solve this problem, some researchers have asked the test subjects to fill out their own physical activity logs while wearing the instrument or to send PAM information to the researchers via instant messenger. After the classification was completed, discriminant analysis was used to create a discriminant formula to discriminate the new data. In the field of physical activity measurement, unsupervised learning obviously relies more on the subjectivity and cooperation of the test subjects than supervised learning and is also more suitable for large data surveys, which can be used for test populations with higher cooperation and better cognitive abilities. However, when the test subjects are children and adolescents, the elderly, and other special populations, perhaps supervised learning algorithms are more suitable than unsupervised learning algorithms. It should be noted that unsupervised learning encompasses numerous algorithms, such as K-means or K-median, which are common in partitioning clustering algorithms, and ROCK, which is a hierarchical clustering algorithm. The SPSS software provides powerful data analysis functions, which can help us to further study the accuracy of different algorithms. Here, we only introduce the Hessian matrix and related derivation.The Hessian matrix can be expressed as(2)Hessian=∂2∂x2∂2∂x∂y∂2∂x∂y∂2∂y2.The Hessian matrix discriminant is as follows:(3)Hessian'=∂2∂x2∂2∂y2−∂2∂xy.We can use the following formula to calculate the three matrix elements on they scale of the matrix:(4)GX,Y=∂2∂x2X′,HessianX,Y=∂xxX,Y∂xyX,Y∂xyX,Y∂yyX,Y.


## 4. GPS and Accelerometers Are Inadequate in Predicting PAM

### 4.1. Problems to Be Noted When Using GPS

The accuracy error of GPS for civilian use is 3–10 meters, and with the advancement of technology and algorithm, the accuracy of GPS will become higher and higher. However, when the signal is bad or interfered, GPS data are likely to be missing, which is a difficult problem to avoid. For missing data, advanced imputation algorithms can be used to deal with it. Therefore, the use of GPS devices and data processing require well-educated professionals. Besides, the power, memory, and price of the GPS device as well as the burden and privacy of the subjects can affect the validity of the data.


### 4.2. Issues to Keep in Mind When Using Accelerometers

Although the extrapolation equation of accelerometer energy consumption has a significant effect on physical activity intensity (MET value), the purpose of this study is to predict PAM, and the constructed path only needs to consider the most primitive accelerometer counts, so the extrapolation equation does not need to be considered. However, the effect of different accelerometer wearing positions on the data exists, and Liu Yang, a domestic scholar, has made a very detailed introduction to explain it, so it will not be repeated here. In general, hand-worn accelerometers are not only easy to wear but also can better conform to the wearing time requirements because they can be worn continuously and do not need to be removed when changing clothes, bathing, or sleeping.


## 4.1. Problems to Be Noted When Using GPS

The accuracy error of GPS for civilian use is 3–10 meters, and with the advancement of technology and algorithm, the accuracy of GPS will become higher and higher. However, when the signal is bad or interfered, GPS data are likely to be missing, which is a difficult problem to avoid. For missing data, advanced imputation algorithms can be used to deal with it. Therefore, the use of GPS devices and data processing require well-educated professionals. Besides, the power, memory, and price of the GPS device as well as the burden and privacy of the subjects can affect the validity of the data.


## 4.2. Issues to Keep in Mind When Using Accelerometers

Although the extrapolation equation of accelerometer energy consumption has a significant effect on physical activity intensity (MET value), the purpose of this study is to predict PAM, and the constructed path only needs to consider the most primitive accelerometer counts, so the extrapolation equation does not need to be considered. However, the effect of different accelerometer wearing positions on the data exists, and Liu Yang, a domestic scholar, has made a very detailed introduction to explain it, so it will not be repeated here. In general, hand-worn accelerometers are not only easy to wear but also can better conform to the wearing time requirements because they can be worn continuously and do not need to be removed when changing clothes, bathing, or sleeping.


## 5. Conclusion

This paper constructs a pathway for predicting physical activity patterns based on GPS data and accelerometer data based on sorting out the methods and ideas of related studies at home and abroad, i.e., determining predictors, collecting data and building datasets, selecting algorithms, and classifying data. In the segment of identifying predictors, researchers are advised to select speed, count, and step count. GPS is one of the most basic functions of smartphones, and in the future, with the advancement of technology, accelerometers can be further reduced in size and installed in smartphones, so that users can directly see various data about their physical activities and even develop interactive programs to stimulate users. The user can even develop an interactive program to stimulate the enthusiasm of the user to exercise and motivate people to take the initiative to carry out physical activity. At the same time, researchers can also obtain more data to achieve real big data analysis, laying a solid data foundation for building a database of physical activity patterns, with the ultimate goal of promoting physical activity and making people physically and mentally healthy.



---

*Source: 8093703-2022-04-29.xml*