This document contains code for parsing GPS data, road network data, and ground truth data to perform hidden Markov modeling (HMM) for vehicle trajectory estimation. It defines functions for calculating spherical distances and probabilities. It parses the input data files, initializes the HMM variables and road list states. It then performs analysis by running the Viterbi algorithm to estimate the most likely trajectory through the road network given the observed GPS points.