<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JCC</journal-id><journal-title-group><journal-title>Journal of Computer and Communications</journal-title></journal-title-group><issn pub-type="epub">2327-5219</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jcc.2017.53010</article-id><article-id pub-id-type="publisher-id">JCC-75132</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Robust Local Weighted Regression for Magnetic Map-Based Localization on Smartphone Platform
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Zhibin</surname><given-names>Meng</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Mei</surname><given-names>Wang</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Enliang</surname><given-names>Wang</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Xiangyu</surname><given-names>Xu</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Key Laboratory of Cognitive Radio &amp;amp;Information Processing, Ministry of Education, Guilin University of Electronic Technology, Guilin, China</addr-line></aff><pub-date pub-type="epub"><day>08</day><month>03</month><year>2017</year></pub-date><volume>05</volume><issue>03</issue><fpage>80</fpage><lpage>90</lpage><history><date date-type="received"><day>January</day>	<month>9,</month>	<year>2017</year></date><date date-type="rev-recd"><day>Accepted:</day>	<month>March</month>	<year>10,</year>	</date><date date-type="accepted"><day>March</day>	<month>13,</month>	<year>2017</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
   
   The magnetic information measured on the smartphone platform has a large fluctuation and the research of indoor localization algorithm based on smart-phone platform is less. Indoor localization algorithm on smartphone platform based on particle filter is studied. Robust local weighted regression is used to smooth the original magnetic data in the process of constructing magnetic map. Use moving average filtering model to filter the online magnetic observation data in positioning process. Compare processed online magnetic data with processed magnetic map collected by smartphone platform and the average matching error is 0.3941uT. Average positioning error is 0.229 meter when using processed online and map data. 
  
 
</p></abstract><kwd-group><kwd>Indoor Localization</kwd><kwd> Magnetic</kwd><kwd> Particle Filter</kwd><kwd>  Robust Local Weighted Regression Algorithm</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Localization system has become an indispensable tool in life and work, we usually use GPS or Beidou to complete the localization function in outdoor environment, but when entering the indoor environment, the GPS signal become weakened and even unable to achieve positioning function. Based on people’s demand for indoor localization services, indoor localization technology in recent years has been a great development. [<xref ref-type="bibr" rid="scirp.75132-ref1">1</xref>] proposed RSSI-based indoor positioning method for concrete hydropower station to provide security for workers; [<xref ref-type="bibr" rid="scirp.75132-ref2">2</xref>] proposed a technology for providing indoor positioning of hospital medical supplies; [<xref ref-type="bibr" rid="scirp.75132-ref3">3</xref>] proposed WIFI-based indoor localization using of sub-regional and curve fitting algorithm with positioning accuracy of 2 meters to 2.5 meters; [<xref ref-type="bibr" rid="scirp.75132-ref4">4</xref>] proposed the use of ZigBee indoor localization, compared to its reference indoor localization system based on WIFI, it has 85% reduction in power and 87% on accuracy.</p><p>Localization technology proposed in the past mainly based on ZigBee, Bluetooth, ultrasound, geomagnetism, UWB, RFID, WiFi. Indoor localization algorithms based on ZigBee, Bluetooth [<xref ref-type="bibr" rid="scirp.75132-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref6">6</xref>] and WiFi [<xref ref-type="bibr" rid="scirp.75132-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref7">7</xref>] almost use RSSI technology which needs to add some infrastructure and their accuracy is similar, about 2 meters [<xref ref-type="bibr" rid="scirp.75132-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref5">5</xref>]. Positioning accuracies employing of RFID [<xref ref-type="bibr" rid="scirp.75132-ref8">8</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref9">9</xref>], UWB [<xref ref-type="bibr" rid="scirp.75132-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref11">11</xref>] and ultrasonic [<xref ref-type="bibr" rid="scirp.75132-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref13">13</xref>] are much higher, but they require increasing emission and receiving equipment which also cost much more. Localization system based on geomagnetism [<xref ref-type="bibr" rid="scirp.75132-ref14">14</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref15">15</xref>] has more advantages that it doesn’t need additional equipment support, only relying on magnetic sensor carried by mobile platform, its accuracy can reach 1m in special condition [<xref ref-type="bibr" rid="scirp.75132-ref15">15</xref>]. The magnetic distribution in the indoor environment is mainly caused by the superposition of natural geomagnetism and manmade geomagnetism. Reinforced concrete structure interferes with the indoor magnetic environment, which makes the magnetic information become rich. It is the rich magnetic information that makes indoor localization based on magnetic field come true [<xref ref-type="bibr" rid="scirp.75132-ref16">16</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref17">17</xref>].</p><p>In the past, magnetic indoor localization algorithm mostly concentrated on the particle filter algorithm [<xref ref-type="bibr" rid="scirp.75132-ref14">14</xref>] [<xref ref-type="bibr" rid="scirp.75132-ref15">15</xref>]. Most indoor localization experimental platforms are mobile robot equipped with magnetic sensor, and the magnetic information is rarely processed. Equipped with gyroscopes, accelerometers and magnetic sensor, android smartphone makes a good localization platform. But the magnetic sensor is often affected by hard and soft-iron effects, resulting in large fluctuations [<xref ref-type="bibr" rid="scirp.75132-ref18">18</xref>]. This paper analyzes the magnetic information of the mobile platform, and makes use of the robust local weighted regression algorithm to smooth the magnetic original data, which makes the established map more stable and accurate. Online stage moving average filtering model is used to filter the magnetic data which rely by particle filter as observation in the process of indoor localization and the data filtering makes online magnetic data more accuracy.</p></sec><sec id="s2"><title>2. Map Construction and Localization Algorithm</title><sec id="s2_1"><title>2.1. Magnetic Data Smoothen by Robust Local Weighted Regression Algorithm</title><p>The robust local weighted regression algorithm which is proposed by Cleveland [<xref ref-type="bibr" rid="scirp.75132-ref19">19</xref>] makes use of local data to fit the points by polynomials weighted fitting and the polynomial coefficient is estimated by the least square method. In local weighted regression algorithm, for each point<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x2.png" xlink:type="simple"/></inline-formula>, the weight <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x3.png" xlink:type="simple"/></inline-formula> is obtained from the weight function. Fitted value <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x4.png" xlink:type="simple"/></inline-formula> is got by <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x5.png" xlink:type="simple"/></inline-formula> degree polynomial fitting using the weighted least squares method with weight <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x6.png" xlink:type="simple"/></inline-formula> to fit<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x7.png" xlink:type="simple"/></inline-formula>. Then we can get <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x8.png" xlink:type="simple"/></inline-formula> from residual <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x9.png" xlink:type="simple"/></inline-formula> and use new weight <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x10.png" xlink:type="simple"/></inline-formula> instead of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x11.png" xlink:type="simple"/></inline-formula> to compute new fitted value<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x12.png" xlink:type="simple"/></inline-formula>. After T times of repeats we can get the final fitted value <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x13.png" xlink:type="simple"/></inline-formula> which is called robust local weighted regression fitted value.</p><p>Percentage <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x14.png" xlink:type="simple"/></inline-formula> represents the window size, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x15.png" xlink:type="simple"/></inline-formula>is the number of points occupied by the window, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x16.png" xlink:type="simple"/></inline-formula>is the <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x17.png" xlink:type="simple"/></inline-formula> smallest value in<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x18.png" xlink:type="simple"/></inline-formula>. The weight is <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x19.png" xlink:type="simple"/></inline-formula> for <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x19.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x20.png" xlink:type="simple"/></inline-formula> and the commonly used weight function <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x19.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x20.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x21.png" xlink:type="simple"/></inline-formula> is</p><disp-formula id="scirp.75132-formula90"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x22.png"  xlink:type="simple"/></disp-formula><p>In this paper, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x23.png" xlink:type="simple"/></inline-formula>is coordinate point and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x23.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x24.png" xlink:type="simple"/></inline-formula> is the corresponding magnetic energy value. Steps of calculating <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x23.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x24.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x25.png" xlink:type="simple"/></inline-formula> are as follows:</p><p>(1) For each magnetic data<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x26.png" xlink:type="simple"/></inline-formula>, compute the corresponding estimated parameters of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x26.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x27.png" xlink:type="simple"/></inline-formula> degree polynomial regression:</p><disp-formula id="scirp.75132-formula91"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x28.png"  xlink:type="simple"/></disp-formula><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula>is <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x30.png" xlink:type="simple"/></inline-formula> dimensions vector, utilizing <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x31.png" xlink:type="simple"/></inline-formula> degree local weighted regression algorithm to obtain the point<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x31.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x32.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x31.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x32.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x33.png" xlink:type="simple"/></inline-formula>is the fitting value at point<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x29.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x31.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x32.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x33.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x34.png" xlink:type="simple"/></inline-formula>:</p><disp-formula id="scirp.75132-formula92"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x35.png"  xlink:type="simple"/></disp-formula><p>(2) Define the bisquare weight function as below:</p><disp-formula id="scirp.75132-formula93"><label>(4)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x36.png"  xlink:type="simple"/></disp-formula><p>Let <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x37.png" xlink:type="simple"/></inline-formula> be the residual of the fitted value, and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x37.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x38.png" xlink:type="simple"/></inline-formula> be the median of<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x37.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x39.png" xlink:type="simple"/></inline-formula>. Define the robustness weights:</p><disp-formula id="scirp.75132-formula94"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x40.png"  xlink:type="simple"/></disp-formula><p>(3) Compute new <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x41.png" xlink:type="simple"/></inline-formula> by fitting a <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x42.png" xlink:type="simple"/></inline-formula> degree polynomial using weighted least squares with weight<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x42.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x43.png" xlink:type="simple"/></inline-formula> instead of<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x42.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x43.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x44.png" xlink:type="simple"/></inline-formula>.</p><p>(4) Repeatedly carry out steps 2 and 3 for T times, the final <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x45.png" xlink:type="simple"/></inline-formula> is the magnetic fitted value corresponds to point<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x45.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x46.png" xlink:type="simple"/></inline-formula>, and this process is called robust local weighted regression.</p></sec><sec id="s2_2"><title>2.2. Online Magnetic Data Filtering by Moving Average Filtering Model</title><p>The moving average filtering model gets the filtered result <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x47.png" xlink:type="simple"/></inline-formula> by averaging the N-1 points before <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x47.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x48.png" xlink:type="simple"/></inline-formula> and itself. For the magnetic observation data of the smartphone platform fluctuates violently that can reach<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x47.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x48.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x49.png" xlink:type="simple"/></inline-formula>, which is beyond the tolerance range of the magnetic-based particle filter location algorithm. Moving average filtering model is used to filter online magnetic data and the filtering algorithm model is described below:</p><disp-formula id="scirp.75132-formula95"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x50.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x51.png" xlink:type="simple"/></inline-formula> is the number of moving average points, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x51.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x52.png" xlink:type="simple"/></inline-formula>is the online magnetic data at time<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x51.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x52.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x53.png" xlink:type="simple"/></inline-formula>.</p></sec><sec id="s2_3"><title>2.3. Particle Filter Localization Algorithm</title><p>Particle Filter algorithm is usually utilized in indoor magnetic localization to estimate the position of user. We use particles <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x54.png" xlink:type="simple"/></inline-formula> to represent user’s position state. When the direction and observation is known, position of user can be estimated by Particle Filter algorithm which is used in the condition that the distribution <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x54.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x55.png" xlink:type="simple"/></inline-formula> cannot be measuring but prior<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x54.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x55.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x56.png" xlink:type="simple"/></inline-formula>. When the algorithm beginning, initial distribution of particles is uniformly and randomly sampled from prior<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x54.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x55.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x57.png" xlink:type="simple"/></inline-formula>. Then for every particle we calculate the weight <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x54.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x55.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x56.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x57.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x58.png" xlink:type="simple"/></inline-formula> by online magnetic observation. Normalizing the particles and</p><p>we can get approximation probability<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x59.png" xlink:type="simple"/></inline-formula>. As<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x59.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x60.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x59.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x60.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x61.png" xlink:type="simple"/></inline-formula>tends to equal to<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x59.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x60.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x61.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x62.png" xlink:type="simple"/></inline-formula>. The main steps are shown below.</p><disp-formula id="scirp.75132-formula96"><graphic  xlink:href="http://html.scirp.org/file/75132x63.png"  xlink:type="simple"/></disp-formula><p>The motion model is</p><disp-formula id="scirp.75132-formula97"><label>(7)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x64.png"  xlink:type="simple"/></disp-formula><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x65.png" xlink:type="simple"/></inline-formula>is two dimensional Gaussian noise. <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x66.png" xlink:type="simple"/></inline-formula>subjects to the Gaussian distribution with <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x66.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x67.png" xlink:type="simple"/></inline-formula> as the mean and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x65.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x66.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x67.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x68.png" xlink:type="simple"/></inline-formula> as the variance:</p><disp-formula id="scirp.75132-formula98"><label>(8)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/75132x69.png"  xlink:type="simple"/></disp-formula></sec></sec><sec id="s3"><title>3. Experiment</title><p>Experiments are conducted on the 3rd floor of keji building where is 27 meters long and 7 meters wide in Guilin University of Electronic Technology. The experimental environment is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref> and it is a corridor. Besides the corridor there is student lab in which a large number of experimental instruments help increase the richness of magnetic information. Experimental platform is smartphone Honor7. In the process of magnetic information acquisition and online localization, their directions are set to be the same. In the Y direction, we use 5 meters for a section and keep walking in the sampling process. Corresponding to the X direction, we choose 0.5 meters for interval and the whole sampling process example is shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>. After sampling by the phone, each 5-metersmagnetic data are smoothed and mapped in 5 meters long coordinate with interval of 0.1 meter. Finally, two-dimensional plane interpolation is carried out to get total magnetic map with interval of 0.1 meter in both X and Y direction.</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> Experiment environmen</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x70.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Magnetic map sampling process</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x71.png"/></fig><sec id="s3_1"><title>3.1. Simulation of Robust Local Weight Regression</title><p>In the process of smoothing, numbers of iterations <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x72.png" xlink:type="simple"/></inline-formula> is set as empirical value of 5 and polynomial degree as 2 which means the local fitting objective function is<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x72.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x73.png" xlink:type="simple"/></inline-formula>.Windows size <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x72.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x73.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x74.png" xlink:type="simple"/></inline-formula> need to adjust the amount change of mag-</p><p>netic data for there is not available empirical value. So we only discuss the size of window <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x75.png" xlink:type="simple"/></inline-formula> and set <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x75.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x76.png" xlink:type="simple"/></inline-formula> be 0.01, 0.06 and 0.15. Simulation results show <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>Magnetic data of 5 meters long are used to simulation. From the simulation results, when<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x77.png" xlink:type="simple"/></inline-formula>, due to the window size is too small, there has been overfitting phenomenon. When<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x77.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x78.png" xlink:type="simple"/></inline-formula>, the window size is set properly, so the fitting result is better. When<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x77.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x78.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x79.png" xlink:type="simple"/></inline-formula>, due to the window size is too large, the fitting is in underfitting state and the fitting curve can’t represent the original data.</p><fig-group id="fig3"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Simulation result of Robust local weighted regression with <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x83.png" xlink:type="simple"/></inline-formula> equals of 0.01 (a); 0.06 (b) and 0.15 (c).</title></caption><fig id ="fig3_1"><label>(b)</label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x80.png"/></fig><fig id ="fig3_2"><label> (c)</label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x81.png"/></fig><fig id ="fig3_3"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x82.png"/></fig></fig-group></sec><sec id="s3_2"><title>3.2. Simulation Moving Average Filter Model</title><p>As the indoor localization has high demand of real-time, so in the process of filtering magnetic data, both filtering time and data stability have to be considered. Limited by experimental phone’s sampling frequency 100 HZ and the real-time is difficult to present by simulation, so the algorithm is only validated by simulation and there is no analysis about the number of moving average points. Set average number<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x84.png" xlink:type="simple"/></inline-formula>, final magnetic observation is made by filtering the magnetic data within 0.5 seconds before the time point. We sample single point for 60 seconds and obtain 6000 sets of magnetic data. Moving average filtering model is used to filter the obtained data, simulation result is shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p><p>From the simulation results, filtered data have great improvements compared to the original data in stability. Although there are still fluctuations, taking into account the real-time factors, these fluctuations can be acceptable.</p></sec><sec id="s3_3"><title>3.3. Online Measurement Data and Map Data Comparison</title><p>Construct magnetic map by robust local weighted regression algorithm and compare the map with online magnetic observation processed by filter model to validate the two methods. <xref ref-type="fig" rid="fig5">Figure 5</xref> shows the matching result of the map created by the smoothing process and the online processed magnetic data. <xref ref-type="fig" rid="fig6">Figure 6</xref> shows the matching result of the map created by original magnetic data and original online magnetic data. <xref ref-type="fig" rid="fig5">Figure 5</xref> shows a better match error of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x85.png" xlink:type="simple"/></inline-formula> and <xref ref-type="fig" rid="fig6">Figure 6</xref> shows match error of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x85.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x86.png" xlink:type="simple"/></inline-formula> relatively. Matching result indicates that the processed magnetic data are more stable and have higher matching degree.</p></sec><sec id="s3_4"><title>3.4. Online Simulation of Particle Filter</title><p>Through the above process, we get the magnetic map and online observation data which are used to simulate on platform MATLAB. The step length in walking and simulation are set the same of 0.5 meter, the variance of the weight func-</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Filter result by moving average filter with window size of 50 points</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x87.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Matching result by processed data</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x88.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Matching result by original data</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x89.png"/></fig><p>tion is<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/75132x90.png" xlink:type="simple"/></inline-formula>, number of particles is 100, initial distribution is evenly distri- buted in the range of (0 cm, 0 cm) to (100 cm, 2700 cm). Particle filter simulation results by processed data and unprocessed data are shown in <xref ref-type="fig" rid="fig7">Figure 7</xref> and the localization errors are shown in <xref ref-type="fig" rid="fig8">Figure 8</xref>.</p><p>After the particles converge, the positioning results are analyzed as follows. Simulation result by unprocessed data is lower in stability and accuracy than the processed data. The average error using processed data is 0.229 meter compared to the unprocessed data’s 0.394. 96.9% of the localization errors are lower than 0.5 meter by processed data but unprocessed data’s 77.3%.</p></sec></sec><sec id="s4"><title>4. Conclusion</title><p>In this paper, robust local weighted regression algorithm is used to smooth the magnetic original data. Online magnetic observation data are filtered by moving average filter. Compare processed magnetic map and online processed magnetic observation, the average error of data matching is 0.3941uT. Indoor localization based on particle filter using processed map and online observation shows ave-</p><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Simulation trajectory</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x91.png"/></fig><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> Localization error comparison between different data and the red line is localization error by original data and blue line is by processed data</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/75132x92.png"/></fig><p>rage positioning error of 0.229 meter which is relatively better. But the problem is also exists, this result is in experimental environment. In the procedure of map construction and online data obtained, the height and direction of smartphone are same. We have to solve these problems by adding other algorithm such as magnetic sensor calibration algorithm or using magnetic variation as observation.</p></sec><sec id="s5"><title>Acknowledgement</title><p>This work is supported by the National Natural Science Foundation of China (No.61371107), the Guangxi Experiment Center of Information Science (No.LD16061X), the Guangxi Natural Science Foundation (No.2016GXNSFBA38014), and the China Postdoctoral Science Foundation (No.2016M602921XB).</p></sec><sec id="s6"><title>Cite this paper</title><p>Meng, Z.B., Wang, M., Wang, E.L. and Xu, X.Y. (2017) Robust Local Weighted Regression for Magnetic Map-Based Localization on Smartphone Platform. Journal of Computer and Communications, 5, 80-90. https://doi.org/10.4236/jcc.2017.53010</p></sec></body><back><ref-list><title>References</title><ref id="scirp.75132-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Lin, P., Li, Q., Fan, Q., Gao, X. and Hu, S. (2014) A Real-Time Location-Based Services System Using WiFi Fingerprinting Algo-rithm for Safety Risk Assessment of Workers in Tunnels. Math. Prob. Eng., 2014, 371 456-1-371 456-10.</mixed-citation></ref><ref id="scirp.75132-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Jeong, S.Y., Jo, H.G. and Kang, S.J. (2014) Fully Distributed Monitoring Architecture Supporting Multiple Trackees and Trackers in Indoor Mobile Asset Management Application. Sensors, 14, 5702-5724. https://doi.org/10.3390/s140305702</mixed-citation></ref><ref id="scirp.75132-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Wang, B., Zhou, S., Liu, W., et al. (2015) Indoor Localization Based on Curve Fitting and Location Search Using Received Signal Strength. IEEE Transactions on Industrial Electronics, 62, 572-582. https://doi.org/10.1109/TIE.2014.2327595</mixed-citation></ref><ref id="scirp.75132-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Niu, J., Wang, B., Shu, L., et al. (2015) ZIL: An Energy-Efficient Indoor Localization System Using ZigBee radio to Detect WiFi Fingerprints. IEEE Journal on Selected Areas in Communications, 33, 1-1. https://doi.org/10.1109/JSAC.2015.2430171</mixed-citation></ref><ref id="scirp.75132-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Pei, L., et al. (2010) Using Inquiry-Based Bluetoothrssi Probability Distributions for Indoor Positioning. J. Glob. Positioning Syst., 9, 122-130.</mixed-citation></ref><ref id="scirp.75132-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Bargh, M.S. and de Groote, R. (2008) Indoor Localization Based on Response Rate of Bluetooth Inquiries. In: Proc. ACM Int. Workshop Mobile Entity Localization Tracking GPS-Less Environ, 49-54. https://doi.org/10.1145/1410012.1410024</mixed-citation></ref><ref id="scirp.75132-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Yang, L., Chen, H., Cui, Q., et al. (2015) Proba-bilistic-KNN: A Novel Algorithm for Passive Indoor-Localization Scenario. Vehicular Technology Conference. IEEE, 1-5.</mixed-citation></ref><ref id="scirp.75132-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Zhang, Z., Lu, Z., Saakian, V., et al. (2014) Item-Level Indoor Localization With Passive UHF RFID Based on Tag Interaction Analysis. IEEE Transactions on Industrial Electronics, 61, 2122-2135. https://doi.org/10.1109/TIE.2013.2264785</mixed-citation></ref><ref id="scirp.75132-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Papapostolou, A. and Chaouchi, H. (2011) RFID-Assisted Indoor Localization and the Impact of Interference on Its Performance. Journal of Network &amp; Computer Applications, 34, 902-913.</mixed-citation></ref><ref id="scirp.75132-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Venkatesh, S. and Buehrer, R.M. (2007) NLOS Mitigation Using Linear Programming in Ultrawideband Location-Aware Networks. IEEE Trans. Veh. Technol., 56, 3182-3198. https://doi.org/10.1109/TVT.2007.900397</mixed-citation></ref><ref id="scirp.75132-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Guvenc, I., Chong, C.-C. and Watanabe, F. (2007) NLOS Identification and Mitigation for UWB Localization Systems. In: Proc. IEEE WCNC, Mar. 2007, 1571-1576. https://doi.org/10.1109/wcnc.2007.296</mixed-citation></ref><ref id="scirp.75132-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Huang, W., Xiong, Y., Li, X.Y., et al. (2015) Swadloon: Direction Finding and Indoor Localization Using Acoustic Signal by Shaking Smartphones. IEEE Transactions on Mobile Computing, 14, 2145-2157.  
https://doi.org/10.1109/TMC.2014.2377717</mixed-citation></ref><ref id="scirp.75132-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Choi, K.H., Ra, W.-S., Park, S.-Y. and Park, J.B. (2014) Robust Least Squares Approach to Passive Target Localization Using Ultrasonic Receiver Array. IEEE Trans. Ind. Electron., 61, 1993-2002. https://doi.org/10.1109/TIE.2013.2266076</mixed-citation></ref><ref id="scirp.75132-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Haverinen, J. and Kemppainen, A. (2009) Global Indoor Self-Localization Based on the Ambient Magnetic Field. Robotics &amp; Autonomous Systems, 57, 1028-1035.</mixed-citation></ref><ref id="scirp.75132-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Xie, H., Gu, T., Tao, X., et al. (2014) MaLoc: A Practical Magnetic Fingerprinting Approach to Indoor Localization Using Smartphones. Proceedings of the 2014 ACM International Joint Conference on Pervasive and Ubiquitous Computing. ACM, 243-253.</mixed-citation></ref><ref id="scirp.75132-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Yamazaki, K., Kato, K., Ono, K., Saegusa, H., Tokunaga, K., Iida, Y., Yamamoto, S., Ashiho, K., Fujiwara, K. and Takahashi, N. (2003) Analysis of Magnetic Disturbance Due to Buildings. IEEE Transactions on Magnetics, 39, 3226-3228.  
https://doi.org/10.1109/TMAG.2003.816729</mixed-citation></ref><ref id="scirp.75132-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Casinovi, G., Geri, A. and Veca, G.M. (1989) Magnetic Field near a Concrete Wall during a Lightning Stroke. IEEE Transactions on Magnetics, 25, 4006-4008.  
https://doi.org/10.1109/20.42505</mixed-citation></ref><ref id="scirp.75132-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Ozyagcilar, T. (2012) Calibrating an eCompass in the Presence of Hard and Soft-Iron Interfe-rence. Freescale Semiconductor Ltd.</mixed-citation></ref><ref id="scirp.75132-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Cleveland, W.S. (1979) Robust Locally Weighted Regression and Smoothing Scatterplots. Journal of the American Statistical Association, 74, 829-836.  
https://doi.org/10.1080/01621459.1979.10481038</mixed-citation></ref></ref-list></back></article>