<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Computation of PDFs on Big Spatial Data: Problem &amp; Architecture</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ji Liu</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Noel M. Lemus</string-name>
          <email>nmlemus@gmail.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Esther Pacitti</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabio Porto</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Patrick Valduriez</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Inria</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>LIRMM</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Univ. of Montpelier</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>France</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>LNCC Petro´ polis</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Brazil</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>80</fpage>
      <lpage>83</lpage>
      <abstract>
        <p>Big spatial data can be produced by observation or numerical simulation programs and correspond to points that represent a 3D soil cube area. However, errors in signal processing and modeling create some uncertainty, and thus a lack of accuracy in identifying geological or seismic phenomenons. To analyze uncertainty, the main solution is to compute a Probability Density Function (PDF) of each point in the spatial cube area, which can be very time consuming. In this paper, we analyze the problem and discuss the use of Spark to efficiently compute PDFs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In this paper, we take advantage of Spark [
        <xref ref-type="bibr" rid="ref9">Zaharia et al. 2010</xref>
        ], a popular
inmemory big data processing framework for computer clusters, to efficiently compute
PDFs in parallel. In the paper, we detail the problem, i.e. how to efficiently compute
PDFs, and propose an architecture using Spark to compute PDFs.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Problem Definition</title>
      <p>Figure 1 shows that the set of observation values at a point may have four distribution
types, i.e. uniform (a), normal (b), exponential (c), and log-normal (d). The horizontal
axis represents the values (V) and the vertical axis represents the frequency (F). The green
bars represent the frequency of the observation values in value intervals and the red outline
represents the calculated PDF. During the calculation of the PDF at a point, there may be
some error between the distribution of the observation values and the calculated PDF. We
denote this error by PDF error (or error for short in the rest of the paper). In order to
precisely fit a PDF based on observation values, we need to reduce this error. Once we
have the PDF of a point, we can calculate the QOI value that has the highest possibility,
with which we can quantify the uncertainty each spatial data set.</p>
      <p>
        Let DS be a set of spatial data sets, dk be a spatial data set in DS and N be the
number of points in a region. Each point px,y, where x and y are spatial dimensions in
the slice, has a set of values V = {v1, v2, ..., vn} while vk is the value corresponding to
the point px,y in dk 2 DS. Based on these notations, we define Equations 1 - 4, which
are based on the formulas in [
        <xref ref-type="bibr" rid="ref4">Dixon and Massey 1968</xref>
        ]. The mean (µx,y) and standard
deviation ( x,y) values of a point can be calculated according to Equations 1 and 2,
respectively. The error ex,y,i between the PDF F and the set of observation values V can
be calculated according to Equation 3, which compares the probability of the values in
different intervals in V and the probability computed according to the PDF. The intervals
are obtained by evenly splitting the space between the maximum value and the minimum
value in V . min is the minimum value in V , max is the maximum value in V and L
represents the number of all considered intervals, which can be configured. F reqk
represents the number of values in V that are in the kth interval. The integral of P DF (x)
computes the probability according to the PDF in the kth interval. Equation 3 is inspired
by the Kolmogorov-Smirnov Test [Lopes 2011], which tests whether a PDF is adequate
for a data set. In addition, we assume that the probability of the values outside the space
between the maximum value and the minimum value is negligible for this equation. Then,
the average error E of Slice i can be calculated according to Equation 4.
µx,y =
      </p>
      <p>Pn
i=1 vi
n</p>
      <p>x,y =
s Pin=1(vi</p>
      <p>µ)2
n</p>
      <p>1
E =</p>
      <p>P
px,y2 slicei ex,y,i</p>
      <p>N
ex,y,i =</p>
      <p>N
X
k=1
|</p>
      <p>F reqk</p>
      <p>N</p>
      <p>Z min+(max min)⇤ Lk
min+(max min)⇤ kL1</p>
      <p>P DF (x)dx |
(2)
(3)
(4)</p>
      <p>We can now express the problem as follows: given a set of spatial data sets DS
corresponding to the same spatial cube area C = {slice1, slice2, ..., slicej }, how to
efficiently calculate the mean, standard deviation values and the PDF F at each point in
slicei 2 C with a small average error E not higher than a predefined average error ".</p>
    </sec>
    <sec id="sec-3">
      <title>3. Architecture</title>
      <p>
        The architecture (see Figure 2) has four layers, i.e. infrastructure, basic process to
compute PDFs, memory management and methods to compute PDFs. In the infrastructure
layer, the big spatial data is stored in NFS [
        <xref ref-type="bibr" rid="ref5">Sandberg et al. 1985</xref>
        ]. Spark and HDFS
[
        <xref ref-type="bibr" rid="ref6">Shvachko et al. 2010</xref>
        ] are deployed over the nodes of the computer cluster. The
intermediate and the output data are stored in HDFS.
      </p>
      <p>The basic processing of PDFs consists of data loading, from NFS to Spark RDDs,
followed by PDF computation using Spark. The data loading process treats the data
corresponding to a slice and pre-processes it in parallel, i.e. calculates statistical parameters
of observation values of each point. Then, the PDF computation groups the data and
calculates the PDFs and errors of all the points in a slice in parallel.</p>
      <p>
        In order to efficiently compute PDFs, we use two memory management
techniques: data caching and window size adjustment. We use data caching to reduce disk
accesses with the Spark Cache operation and a memory-based file system [
        <xref ref-type="bibr" rid="ref7">Snyder 1990</xref>
        ].
We test the Scala program on a small workload with different window sizes to find an
optimal window size, which is used for the PDF computation of all the points in the slice.
      </p>
      <p>We use two methods to compute PDFs efficiently, i.e. data grouping and ML
prediction. The data grouping method groups the points with exactly the same mean and
standard deviation values into a group, using the aggregation operation in Spark. Then,
one point is selected for each group to compute the PDFs. The ML prediction method is
based on a decision tree to predict the distribution type to compute PDFs for each point.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Experimental Evaluation</title>
      <p>To validate our solution, we implement the two methods in a Spark cluster and performed
extensive experiments using three big spatial data sets of from 235 GB to 2.4 TB,
generated based on the seismic benchmark of the HPC4e project [HPC4E ]. The experimental
results show that our solution is efficient and scales up very well compared with
Baseline, i.e. brute-force method without using data grouping and ML prediction. Grouping
outperforms Baseline by up to 92% (more than 10 times) without introducing extra error.
ML can be up to 91% (more than 9 times) better than Baseline with very slight acceptable
extra error (up to 0.017). The combination of Grouping and ML can be up to 97% (more
than 33 times) better than Baseline with an acceptable extra error (up to 0.017).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Campisano</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Porto</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pacitti</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Masseglia</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ogasawara</surname>
            ,
            <given-names>E. S.</given-names>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>Spatial sequential pattern mining for seismic data</article-title>
          .
          <source>In Simp o´sio Brasileiro de Banco de Dados (SBBD)</source>
          , pages
          <fpage>241</fpage>
          -
          <lpage>246</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mao</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and Liu,
          <string-name>
            <surname>Y.</surname>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Big data: A survey</article-title>
          .
          <source>Mobile Networks and Applications</source>
          ,
          <volume>19</volume>
          (
          <issue>2</issue>
          ):
          <fpage>171</fpage>
          -
          <lpage>209</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Cressie</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          (
          <year>2015</year>
          ).
          <article-title>Statistics for spatial data</article-title>
          . John Wiley &amp; Sons.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Dixon</surname>
            ,
            <given-names>W. J.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Massey</surname>
            ,
            <given-names>F. J.</given-names>
          </string-name>
          (
          <year>1968</year>
          ).
          <article-title>Introduction to statistical analysis</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Sandberg</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goldberg</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kleiman</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Walsh</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Lyon</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          (
          <year>1985</year>
          ).
          <article-title>Design and implementation of the sun network file system</article-title>
          .
          <source>In the Summer USENIX conf.</source>
          , pages
          <fpage>119</fpage>
          -
          <lpage>130</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Shvachko</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kuang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Radia</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Chansler</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2010</year>
          ).
          <article-title>The hadoop distributed file system</article-title>
          .
          <source>In IEEE Symp. on Mass Storage Systems and Technologies (MSST)</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>10</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Snyder</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          (
          <year>1990</year>
          ).
          <article-title>tmpfs: A virtual memory file system</article-title>
          .
          <source>In European UNIX Users Group Conf.</source>
          , pages
          <fpage>241</fpage>
          -
          <lpage>248</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Trajcevski</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2011</year>
          ).
          <article-title>Uncertainty in spatial trajectories</article-title>
          .
          <source>In Computing with Spatial Trajectories</source>
          , pages
          <fpage>63</fpage>
          -
          <lpage>107</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Zaharia</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chowdhury</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Franklin</surname>
            ,
            <given-names>M. J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shenker</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Stoica</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          (
          <year>2010</year>
          ).
          <article-title>Spark: Cluster computing with working sets</article-title>
          .
          <source>In USENIX Workshop on Hot Topics in Cloud Computing (HotCloud).</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>