PALMS+Calculation+-+Release+4+-+GPS+Processing


 * NOTE: This is a draft under development. This note will be removed when the draft is finalized.**

This page details the GPS processing algorithms, the parameters used by the algorithms and how adjustments to the default parameters change the results.

Raw GPS data is processed in multiple passes. The output of one pass is the input of the next. Thus changing parameters used in early passes, may impact the results of later passes. The order of processing is as follows:
 * Preprocess and detect Loss of Signal
 * Filter invalid values
 * Detect Indoors / Outdoors
 * Detect trips
 * Detect locations
 * Reconsider trips
 * Classify trip’s mode of transportation
 * Trap stationary fixes to locations


 * Preprocess** – This pass calculates duration, distance, speed, elevation change, bearing, bearing change between consecutive fixes. Detects gaps in data (Loss of Signal) longer than N seconds (default = 600 seconds). The fix immediately before the loss of signal is marked as the "last fix". The next fix is marked as the "first fix". A "lone fix" is one which occurs between two periods of Loss of Signal. These are removed by default.

//Discussion:// First and last fixes are used by the trip and location detection algorithms.


 * Filter Invalid Values** – The filter pass optionally removes fixes that are obviously invalid: lone fixes (a single fix between two gaps in data; fixes with excessive speed (default 130 km/hr); and fixes with excessive changes in elevation (default 1000 m). It also optionally removed fixes that indicate a back-and-forth movement within 3 constitutive fixes, typically of GPS glitter (default 10 m).

//Discussion:// Excessive speed and excessive changes in elevation are typically caused by a bad GPS fix.
 * The speed default is set to 130 km/hr or 80 mph. Depending on your participant's driving habits, you may want to increase this value.
 * The max change in elevation default should be adjusted based on the terrain of your study area: A lower value can be used if the area is relatively flat.


 * Detect Indoors / Outdoors** – Some GPS data loggers (such as the Qstarz BT-1000XT) provides the number of satellites in view, the number of satellites used to compute the location and the "signal strength" (SNR) of each. When the GPS is outdoors ,the signal strength is stronger and there are more satellites. PALMS marks the location as outdoors when the total SNR of all satellites in view exceeds a threshold. (Threshold value defaults to 250). If the SNR is not available, PALMS will mark as outdoors if the ratio of used / view exceeds 50%. (This method is not as accurate as using the SNR.)

//Discussion:// The indoor / outdoor detection algorithm has been developed using the Qstarz data loggers which must be configured to record the satellite information. Indoor / Outdoor information is used by the trip detection and location trapping algorithms to "clean" the GPS signal as discussed below.


 * Trip Detection** – PALMS marks the start of a trip when it detects movement greater than N meters over 1 minute (default 34 meters). It marks a pause point when the device is stationary for N seconds (180). If device is stationary for greater than N seconds (300) or loss of signal occurs**,** then the end of trip is marked.

//Discussion:// Trips are detected based on distance traveled over time. False movement caused by GPS errors can trigger "false" trips and/or cause true trips to appear longer than they actually are. The "reconsider trips" processing (described below) removes most of the false trips.
 * The "Min distance traveled over one minute" is set to 34 meters which is equivalent to moving at 2 km/hr. If your participants are moving at speeds slower than that, you can decrease this value at the risk of increasing the number of false trips.
 * The "Min pause duration" and "Max pause duration" determine the length of of a pause. Using the default values, a pause can last 3 to 5 minutes.
 * If you wish to break pauses into individual trips, set both parameters to the same value. Using the defaults, a quick "in-n-out" stop to a convenience store will be considered a pause on a longer trip.


 * Location Detection** -- PALMS uses the first fixes, last fixes, trip starts, trip ends and optionally pause points as the initial locations. It then clusters fixes within N meters (30) of these initial locations. In cases where the locations overlap, the location with the most fixes encompassed the lessor locations.

//Discussion://
 * Choosing to include pause points as locations may result is generating a large number of irrelevant locations (IE: traffic lights).
 * The "cluster radius" determines how close locations may be to each other.
 * The total time spent at each location is calculated. If the time does not exceed N seconds, the location is removed The default value is set to 0 -- no locations are removed. This value can be changed as desired. Note larger values risk missing quick "in-n-out" stops.
 * Location numbers are assigned consecutively as they are discovered by PALMS. When processing multiple participants, locations common to multiple participants will be assigned the same location number. This option can be changed by checking the "Reset location numbers for each participant" parameter.
 * When "false" trips are removed, locations trigger by these trips are also removed. These locations can be kept by checking the "Allow locations without trips" parameter.


 * Reconsider Trips** -- Once locations are identified, PALMS reconsiders trips and will remove those trips that do not meet the specified conditions (specified in the Trip Detection section of the parameter block): less than N seconds duration (180); less than N meters in length (100); trips in which N% of the fixes occur within a single location (90%); trips that occur N% indoors (70%). There are two reasons to reconsider trips: (1) researchers may only be interested in trips exceeding a certain duration and length; (2) trips that are short, within a single location and/or indoors are typically false trips caused by excessive GPS jitter when the device is indoors with poor satellite reception.

//Discussion://
 * If you are interested in detecting short trips, consider increasing the values of Min trip length and Min trip duration.
 * When looking for trips in school yards, playground, or backyard, it is probable that such trips will occur within the one location (as defined by the cluster radius specified in the location detection). Setting the "Max % of trip allowed in a single location" parameter to 100 will detect these trips, but will also increase the number of false trips.
 * If a person is outdoors with poor GPS reception, the points may be incorrectly marked indoors and the trip removed. Setting the "Max % of trip allowed indoors" parameter to 100 will allow these trips (and increase the number of false trips).
 * Points marked as indoors are removed from the start and end of trips by default. Trips start when a person exits a building and end when he/she enters a building.


 * Mode of Transportation** – PALMS makes an initial estimate of the trips mode of transportation based on speed (defaults: 1-10 km/hr – pedestrian; 10-25 km/hr – bicycle; 25+ vehicle). In order to detect changes in transportation mode, each trip is segmented at points where the speed is less than .5 km/hr and the segments are at least N meters (30) in length. The speed for each segment is calculated and a mode is assigned based on the speed at the N percentile (90%). Adjacent segments with the same mode are combined. Single segments bounded by identically classified segments are reclassified. (Typically typical case is the vehicle-bicycle-vehicle pattern seen in slow moving traffic. The bicycle segment will be re-classified as vehicle.) When a sustained change in mode over multiple segments is detected, PALMS splits each different mode into a separate trip.

In R4, PALMS then does another “re-consideration” pass and will remove these “new” trips if they do not meet the above conditions. In R4.1, this pass is optional. The default is NOT to remove short trips.

//Discussion://
 * Slow moving traffic can be misclassified as bicycle trips and may be broken into several, individual trips. If you know your participants are not using bicycles, set both the bicycle and vehicle cutoff to the same value (typically 10 km/hr).
 * In the case where a person walks a short distance to or from a car, that walk will be considered a pedestrian trip and may be removed based on the Min trip length and Min trip duration parameters.
 * In R4.1, the new default is NOT to remove these short trips . Check the "Reconsider trips after segmenting" box if you want them removed.


 * Location Trapping** – The purpose of location trapping is to eliminate the errors caused by GPS jitter within or near buildings. Fixes within the cluster radius of N meters (30) of the location’s center, optionally be can be trapped. If trapped, the latitude, longitude, and elevation is set to that of the location’s center. The speed, distance traveled, elevation delta, bearing delta is set to 0.

//Discussion://
 * Location trapping parameters are contained in the Location Detection section.
 * By default, indoor and outdoor fixes that are not part of a trip are trapped.
 * If you are interested "backyard activity", try un-checking the "trap outdoors" parameter..
 * If you are principally interested in vehicle trips, try checking the "trap points that are part of a trip" parameter.


 * Speed and Elevation Change Averaging** -- The speed and elevation delta reported are the instantaneous values between two concurrent fixes. If desired, these may be "smoothed" and replaced the the moving average computed over N fixes (default 3).

//Discussion://
 * By default, moving averages are not used.
 * This feature has not often been used, thus it has been moved to the end of the parameter block.


 * Disabling all Filtering and Data Cleaning**

If you are interested in seeing all GPS fixes as they exist in your dataset, set the parameters as follows:
 * Set the Interval to the GPS epoch
 * Remove lone fixes: unchecked
 * Filter invalid fixes: unchecked
 * Trap indoor points: unchecked
 * Trap outdoor points: unchecked
 * Trap points that are part of trip: unchecked

If you are interested in maximizing the number of trips detected, set the parameters as follows:
 * Min distance traveled over 1 minute: 17 (distance traveled at 1KM per hr)
 * Min trip length: 0
 * Min trip duration: 0
 * Min pause time: 120
 * Max pause time: 120
 * Max % of trip allowed at a single location: 100
 * Max % of trip allowed indoors: 100
 * Remove indoor points from trip starts and ends: uncheck
 * Trap points that are part of trip: unchecked

If you are interested in seeing the difference made by using indoor detection
 * Uncheck the detect indoors parameter

To disable the use of indoor information on trip detection:
 * Set Max % of trip allowed indoors: 100
 * Remove indoor points from trip starts and ends: uncheck


 * GPS Processing Events in the Calculation Log File**

When a calculation executes, it generates a log file that contains information on the inter workings of the calculation. The log file can be viewed by clicking the result set's "book" icon. Should the results be different that you expected (for example, too many, too few, missing data, misclassification of values, etc), reading the log file may provide insight into how you can adjust the calculations parameters.

Details about reading the log file can be found on this page.