<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "https://jats.nlm.nih.gov/nlm-dtd/publishing/3.0/journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" xml:lang="en" dtd-version="3.0" article-type="research-article"><?xmltex \makeatother\@nolinetrue\makeatletter?><?xmltex \bartext{Development and technical paper}?>
  <front>
    <journal-meta><journal-id journal-id-type="publisher">GMD</journal-id><journal-title-group>
    <journal-title>Geoscientific Model Development</journal-title>
    <abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title><abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
  </journal-title-group><issn pub-type="epub">1991-9603</issn><publisher>
    <publisher-name>Copernicus Publications</publisher-name>
    <publisher-loc>Göttingen, Germany</publisher-loc>
  </publisher></journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-16-3765-2023</article-id><title-group><article-title><monospace>GStatSim</monospace> V1.0: a Python package for geostatistical interpolation and conditional simulation</article-title><alt-title><monospace>GStatSim</monospace> V1</alt-title>
      </title-group><?xmltex \runningtitle{\texttt{GStatSim} V1}?><?xmltex \runningauthor{E. J. MacKie et al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>MacKie</surname><given-names>Emma J.</given-names></name>
          <email>emackie@ufl.edu</email>
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Field</surname><given-names>Michael</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2 aff3">
          <name><surname>Wang</surname><given-names>Lijing</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Yin</surname><given-names>Zhen</given-names></name>
          
        <ext-link>https://orcid.org/0000-0001-9215-4426</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff4 aff5 aff6">
          <name><surname>Schoedl</surname><given-names>Nathan</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff4">
          <name><surname>Hibbs</surname><given-names>Matthew</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff6">
          <name><surname>Zhang</surname><given-names>Allan</given-names></name>
          
        </contrib>
        <aff id="aff1"><label>1</label><institution>Department of Geological Sciences, University of Florida, Gainesville, FL 32611, USA</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Department of Earth and Planetary Sciences, Stanford University, Stanford, CA 94305, USA</institution>
        </aff>
        <aff id="aff3"><label>3</label><institution>Earth and Environmental Sciences Area, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA</institution>
        </aff>
        <aff id="aff4"><label>4</label><institution>Department of Computer and Information Science and Engineering, University of Florida, Gainesville, FL 32611, USA</institution>
        </aff>
        <aff id="aff5"><label>5</label><institution>Department of Mathematics, University of Florida, Gainesville,  FL 32611, USA</institution>
        </aff>
        <aff id="aff6"><label>6</label><institution>Department of Statistics, University of Florida, Gainesville, FL 32611, USA</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Emma J. MacKie (emackie@ufl.edu)</corresp></author-notes><pub-date><day>6</day><month>July</month><year>2023</year></pub-date>
      
      <volume>16</volume>
      <issue>13</issue>
      <fpage>3765</fpage><lpage>3783</lpage>
      <history>
        <date date-type="received"><day>6</day><month>November</month><year>2022</year></date>
           <date date-type="rev-request"><day>18</day><month>November</month><year>2022</year></date>
           <date date-type="rev-recd"><day>4</day><month>May</month><year>2023</year></date>
           <date date-type="accepted"><day>31</day><month>May</month><year>2023</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2023 Emma J. MacKie et al.</copyright-statement>
        <copyright-year>2023</copyright-year>
      <license license-type="open-access"><license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p></license></permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023.html">This article is available from https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d1e175">The interpolation of geospatial phenomena is a common problem in Earth science applications that can be addressed with geostatistics, where spatial correlations are used to constrain interpolations. In certain applications, it can be particularly useful to a perform geostatistical simulation, which is used to generate multiple non-unique realizations that reproduce the variability in measurements and are constrained by observations. Despite the broad utility of this approach, there are few open-access geostatistical simulation software applications. To address this accessibility issue, we present <monospace>GStatSim</monospace>, a Python package for performing geostatistical interpolation and simulation. <monospace>GStatSim</monospace> is distinct from previous geostatistical tools in that it emphasizes accessibility for non-experts, geostatistical simulation, and applicability to remote sensing data sets. It includes tools for performing non-stationary simulations and interpolations with secondary constraints. This package is accompanied by a Jupyter Book with user tutorials and background information on different interpolation methods. These resources are intended to significantly lower the technological barrier to using geostatistics and encourage the use of geostatistics in a wider range of applications. We demonstrate the different functionalities of this tool for the interpolation of subglacial topography measurements in Greenland.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

      <?xmltex \hack{\newpage}?>
<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e195">The interpolation of geological and geophysical observations is a common problem in the geosciences with applications in mineral exploration <xref ref-type="bibr" rid="bib1.bibx25 bib1.bibx15" id="paren.1"/>, oil reservoir modeling <xref ref-type="bibr" rid="bib1.bibx27 bib1.bibx52" id="paren.2"/>, groundwater hydrology <xref ref-type="bibr" rid="bib1.bibx28 bib1.bibx16" id="paren.3"/>, soil sciences <xref ref-type="bibr" rid="bib1.bibx20 bib1.bibx30 bib1.bibx67" id="paren.4"/>, climate modeling <xref ref-type="bibr" rid="bib1.bibx8" id="paren.5"/>, natural hazard prediction <xref ref-type="bibr" rid="bib1.bibx69" id="paren.6"/>, and glaciology <xref ref-type="bibr" rid="bib1.bibx33 bib1.bibx70" id="paren.7"/>. The field of geostatistics emerged in the 1950s with the development of kriging, a method for optimizing spatial interpolation, which was originally used to estimate gold ore grades <xref ref-type="bibr" rid="bib1.bibx29 bib1.bibx10" id="paren.8"/>. This theory was expanded by <xref ref-type="bibr" rid="bib1.bibx38" id="text.9"/>, who formalized the variogram as a measure of spatial variance. Since then, a number of methods have evolved to include a variety of interpolators and descriptors of spatial statistics (e.g., <xref ref-type="bibr" rid="bib1.bibx11 bib1.bibx59 bib1.bibx19 bib1.bibx60" id="altparen.10"/>).</p>
      <p id="d1e229">In contrast to deterministic methods such as kriging, which are designed to minimize estimation variance, geostatistical simulation is designed to reproduce the variability in measurements <xref ref-type="bibr" rid="bib1.bibx13" id="paren.11"/>. Geostatistical simulation involves the generation of many stochastic realizations of a Gaussian random field that retains the spatial statistics of observations. These realizations are conditioned to observed<?pagebreak page3766?> data, meaning they exactly match observations. The ensemble of realizations quantifies uncertainty. This approach is often used to account for subsurface heterogeneity when modeling petroleum reservoirs <xref ref-type="bibr" rid="bib1.bibx52" id="paren.12"/>, performing geophysical inversions <xref ref-type="bibr" rid="bib1.bibx44 bib1.bibx57 bib1.bibx64" id="paren.13"/>, and modeling groundwater hydrology <xref ref-type="bibr" rid="bib1.bibx16" id="paren.14"/>.</p>
      <p id="d1e244">Despite this wide range of geological applications, many existing geostatistical modeling software applications are primarily intended for use in oil and mineral exploration applications. For example, T-PROGS <xref ref-type="bibr" rid="bib1.bibx3" id="paren.15"/> is intended for use with borehole data, and the Leapfrog geological modeling software is used almost exclusively in industry. The Geostatistics Software Library (<monospace>GSLIB</monospace>; <xref ref-type="bibr" rid="bib1.bibx13" id="altparen.16"/>) test cases are predominantly devoted to modeling porosity and permeability for oil reservoir modeling. While these tools were primarily tested on point measurements such as borehole data, many scientific applications now rely on large-scale airborne geophysical data sets, which typically consist of cross-cutting line surveys that are densely sampled in the along-track direction with large gaps in between survey lines. This data configuration can prove challenging for geostatistical interpolation. Furthermore, geophysical surveys, and remote sensing methods in particular, can generate extremely large volumes of data. This can be problematic for certain software, such as the Stanford Geostatistical Modeling Software (SGeMS; <xref ref-type="bibr" rid="bib1.bibx53" id="altparen.17"/>) which becomes slow to operate and sometimes crashes when users upload large files. As such, many geostatistical software applications are not directly suited to the scale and nature of certain geophysical data interpolation problems.</p>
      <p id="d1e259">The commercial nature of many geostatistical applications and software further restricts the use of geostatistics in academic and educational settings. Many geostatistical modeling software applications are locked behind a paywall. For example, Leapfrog and T-PROGS are proprietary and cost thousands of dollars per year (e.g., <xref ref-type="bibr" rid="bib1.bibx18" id="altparen.18"/>). Leapfrog and SGeMS only work on Windows operating systems. <monospace>GSLIB</monospace> is written in FORTRAN, which has a limited user base compared to Python. These interoperability issues make it difficult to integrate geostatistical simulation with existing scientific workflows. Furthermore, many of these software applications are intended for use by trained experts and require the purchase of a companion textbook to learn the documentation (e.g., <xref ref-type="bibr" rid="bib1.bibx13 bib1.bibx54" id="altparen.19"/>). These accessibility issues create a barrier to producing open-access, reproducible workflows and fail to meet modern accessibility standards such as the FAIR principles (Findable, Accessible, Interoperable, Reusable; <xref ref-type="bibr" rid="bib1.bibx66" id="altparen.20"/>). Moreover, the restricted availability of geostatistical software limits its use in educational settings. As such, developments in open-access, user-friendly tools are critically needed for advancing the use of geostatistical simulation in open science and education.</p>
      <p id="d1e275">Recently, a growing number of open-source geostatistical modeling tools have become available. This includes the <monospace>gstat</monospace> package in R <xref ref-type="bibr" rid="bib1.bibx48" id="paren.21"/> and the Python packages <monospace>PyKrige</monospace> <xref ref-type="bibr" rid="bib1.bibx41" id="paren.22"/>, <monospace>GeostatsPy</monospace> <xref ref-type="bibr" rid="bib1.bibx51" id="paren.23"/>, <monospace>SciKit-GStat</monospace> <xref ref-type="bibr" rid="bib1.bibx36" id="paren.24"/>, and <monospace>GSTools</monospace> <xref ref-type="bibr" rid="bib1.bibx40" id="paren.25"/>. <monospace>PyKrige</monospace> provides tools for performing kriging interpolation. <monospace>SciKit-GStat</monospace> offers variogram modeling functions. <monospace>GeostatsPy</monospace> is a Python wrapper of some of the <monospace>GSLIB</monospace> functions. <monospace>GSTools</monospace> provides a number of useful functions including tools for time-series analysis, data transformations, and interpolation. While these resources are important steps towards providing the scientific community with accessible geostatistical software and have significantly expanded the repertoire of geostatistical functions in Python, additional tools are needed for performing geostatistical simulation. In particular, existing Python tools are limited in their ability to accommodate non-stationary or variations in spatial statistics, incorporate secondary constraints, and perform interpolations with large conditioning data sets.</p>
      <p id="d1e325">To address the aforementioned needs, we present <monospace>GStatSim</monospace>, a Python package for performing geostatistical interpolations and simulations. <monospace>GStatSim</monospace> enables the user to perform a variety of deterministic and stochastic interpolations in Python including various versions of kriging and sequential Gaussian simulation (SGS). <monospace>GStatSim</monospace> is intended to complement existing Python and geostatistical frameworks. While <monospace>GStatSim</monospace> does not include variogram modeling tools, it is designed to be compatible with existing variogram modeling packages such as <monospace>SciKit-GStat</monospace>, a robust variogram modeling toolkit with extensive documentation. In contrast to previous tools, <monospace>GStatSim</monospace> emphasizes interpolation, particularly conditional simulation. We provide new tools for accommodating non-stationarity or variability in spatial statistics. This package is intended to strike a balance between flexibility and ease of use. The tools are sufficiently deconstructed to allow for a variety of interpolation workflows while also limiting the number of parameter selections that must be made. In contrast to previous software applications that are tested on point data sets, <monospace>GStatSim</monospace> was constructed with geophysical line data sets specifically in mind.</p>
      <p id="d1e350">In addition to providing tools for scientific analyses, <monospace>GStatSim</monospace> is also intended to be an educational resource. We developed a Jupyter Book that contains a series of tutorials for reproducing the figures in this paper. These tutorials provide intuition on the different algorithms and guidance on parameter selection. This is intended to make <monospace>GStatSim</monospace> accessible to non-experts and reduce the amount of time needed to develop models.</p>
      <p id="d1e359">In this paper, we demonstrate the different functionalities of <monospace>GStatSim</monospace> (Tables 1 and 2) and compare it to existing packages such as <monospace>GSTools</monospace>. We also provide a brief description of the underlying theory behind each function. The interpolation functions are demonstrated for the interpolation<?pagebreak page3767?> of ice-sheet bed elevation data measured by airborne ice-penetrating radar. Our goal is not to recommend a specific interpolation method for this case study; rather, we describe the implementation considerations and illustrate the advantages and limitations of each interpolation method. We provide an overview of the available user support and documentation. Finally, we discuss possible future directions for further enabling the widespread utilization of geostatistical simulation in academic disciplines.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Data</title>
      <p id="d1e376">We apply the <monospace>GStatSim</monospace> functions to the interpolation of
ice-penetrating radar measurements of subglacial topography in
Greenland. Subglacial topography is a critical parameter in ice-sheet
models <xref ref-type="bibr" rid="bib1.bibx47 bib1.bibx56" id="paren.26"/>. For
instance, modeled ice flow behavior and subglacial water routing
models can be highly sensitive to the method used to interpolate
measurements <xref ref-type="bibr" rid="bib1.bibx35 bib1.bibx65 bib1.bibx31" id="paren.27"/>. We use bed elevation measurements from the Center
for the Remote Sensing of Ice Sheets <xref ref-type="bibr" rid="bib1.bibx9" id="paren.28"/> over a
<inline-formula><mml:math id="M1" display="inline"><mml:mrow><mml:mn mathvariant="normal">150</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>×</mml:mo><mml:mn mathvariant="normal">150</mml:mn></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M2" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> region in northwest Greenland (Fig. <xref ref-type="fig" rid="Ch1.F1"/>). This location was chosen for the variability in line spacing (10–50 km), abundant crossover points, irregular survey orientations, and the presence of a large-scale trend. These conditions pose a challenge to interpolation, making this data set a good case study for testing the rigor of the <monospace>GStatSim</monospace> algorithms. For the multivariate applications we use ice surface elevation data from ArcticDEM <xref ref-type="bibr" rid="bib1.bibx50" id="paren.29"/> as a secondary source of information for constraining interpolations. We use the 500 m resolution version. The surface and bed elevation coordinates are transformed from geographic coordinates to polar stereographic coordinates using the National Snow and Ice Data Center (NSIDC) coordinate transformation tool <xref ref-type="bibr" rid="bib1.bibx61" id="paren.30"/> so that Euclidean distances can be determined.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1" specific-use="star"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e429">Ice-penetrating radar topography data for test region. The coordinates are shown in a polar stereographic projection.</p></caption>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f01.jpg"/>

      </fig>

</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Interpolation with existing geostatistical tools</title>
      <p id="d1e446">It was our original intent to test existing Python interpolation functions from <monospace>PyKrige</monospace>, <monospace>GSTools</monospace>, and <monospace>GeostatsPy</monospace> on the aforementioned bed elevation data set in order to establish a baseline level of performance for comparison with <monospace>GStatSim</monospace>. However, the <monospace>PyKrige</monospace> and <monospace>GSTools</monospace> kriging and conditional simulation routines crash when applied to our data set due to the high random access memory (RAM) consumption. We are also unable to produce a simulation result using <monospace>GeostatsPy</monospace> due to a “singular matrix” error, which generally indicates that there is some sort of numerical instability. We discuss these limitations in more detail in Sect. <xref ref-type="sec" rid="Ch1.S7"/>. Only the <monospace>GeostatsPy</monospace> kriging function is successfully applied to this data set. The <monospace>GeostatsPy</monospace> kriging implementation and results are described in Sect. <xref ref-type="sec" rid="Ch1.S4.SS3.SSS3"/>.</p><?xmltex \hack{\newpage}?>
</sec>
<sec id="Ch1.S4">
  <label>4</label><?xmltex \opttitle{\texttt{GStatSim} functions and implementation}?><title><monospace>GStatSim</monospace> functions and implementation</title>
      <p id="d1e494"><monospace>GStatSim</monospace> can be used with Python 3.0–3.10 and relies on commonly used packages such as <monospace>scipy</monospace> <xref ref-type="bibr" rid="bib1.bibx63" id="paren.31"/>, <monospace>numpy</monospace> <xref ref-type="bibr" rid="bib1.bibx23" id="paren.32"/>, <monospace>pandas</monospace> <xref ref-type="bibr" rid="bib1.bibx39" id="paren.33"/>, and <monospace>scikit-learn</monospace> <xref ref-type="bibr" rid="bib1.bibx49" id="paren.34"/>. This ensures that <monospace>GStatSim</monospace> is easy to use in different computing environments. The source code is written in accordance with PEP8 standards <xref ref-type="bibr" rid="bib1.bibx62" id="paren.35"/>, making it interpretable and easy to modify.</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>Data initialization</title>
      <p id="d1e537">Prior to performing any geostatistical analysis, we fit the bed elevation data to a 1 km resolution grid using the <monospace>GStatSim</monospace> <monospace>grid_data</monospace> function which averages values within each grid cell. We do this because the interpolation examples shown in this paper use a 1 km resolution. In this way, the spatial statistics of the data will be compatible with the interpolation grid. This gridded data set has 3650 data points. In order to satisfy the Gaussian assumptions of our interpolation functions, we convert our data to a standard Gaussian distribution using the <monospace>scikit-learn</monospace> <monospace>QuantileTransformer</monospace> function. This step converts the data to a standard Gaussian distribution (mean <inline-formula><mml:math id="M3" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, variance <inline-formula><mml:math id="M4" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>), shown in Fig. <xref ref-type="fig" rid="Ch1.F2"/>. It is not strictly necessary for data to be Gaussian when using <monospace>GStatSim</monospace>. However, the interpolation results will be more robust if a Gaussian distribution is used.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Figure}?><label>Figure 2</label><caption><p id="d1e580"><bold>(a)</bold> Original data distribution. <bold>(b)</bold> Transformed data with a standard Gaussian distribution.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f02.png"/>

        </fig>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1" specific-use="star"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e597"><monospace>GStatSim</monospace> interpolation functions.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Function</oasis:entry>
         <oasis:entry colname="col2">Description</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>skrige</monospace></oasis:entry>
         <oasis:entry colname="col2">Simple kriging estimator</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>okrige</monospace></oasis:entry>
         <oasis:entry colname="col2">Ordinary kriging estimator</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>skrige_sgs</monospace></oasis:entry>
         <oasis:entry colname="col2">Sequential Gaussian simulation using simple kriging</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>okrige_sgs</monospace></oasis:entry>
         <oasis:entry colname="col2">Sequential Gaussian simulation using ordinary kriging</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>cluster_sgs</monospace></oasis:entry>
         <oasis:entry colname="col2">Sequential Gaussian simulation using simple kriging, where different variograms are defined in different regions</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>cokrige_mm1</monospace></oasis:entry>
         <oasis:entry colname="col2">Co-kriging under Markov model 1 (MM1) assumptions, uses secondary data as a constraint</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>cosim_mm1</monospace></oasis:entry>
         <oasis:entry colname="col2">Co-simulation under MM1 assumptions, uses secondary data as a constraint</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table><?xmltex \gdef\@currentlabel{1}?></table-wrap>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2" specific-use="star"><?xmltex \currentcnt{2}?><label>Table 2</label><caption><p id="d1e701"><monospace>GStatSim</monospace> accessory functions.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Function</oasis:entry>
         <oasis:entry colname="col2">Description</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>grid_data</monospace></oasis:entry>
         <oasis:entry colname="col2">Fits conditioning data to a grid of some specified resolution</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>prediction_grid</monospace></oasis:entry>
         <oasis:entry colname="col2">Makes an array of coordinates to be interpolated based on bounding coordinates and resolution</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>rbf_trend</monospace></oasis:entry>
         <oasis:entry colname="col2">Estimates the large-scale trend of the conditioning data using a smoothed radial basis function</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>adaptive_partitioning</monospace></oasis:entry>
         <oasis:entry colname="col2">Breaks conditioning data into blocks based on the density of measurements</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><monospace>find_colocated</monospace></oasis:entry>
         <oasis:entry colname="col2">Finds the co-located primary and secondary data points for performing co-kriging and co-simulation</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table><?xmltex \gdef\@currentlabel{2}?></table-wrap>

</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><?xmltex \opttitle{Variogram calculation and modeling with \texttt{SciKit-GStat}}?><title>Variogram calculation and modeling with <monospace>SciKit-GStat</monospace></title>
      <p id="d1e791">The interpolation functions in <monospace>GStatSim</monospace> rely on the variogram, which describes spatial statistics by quantifying the covariance between data points as a function of their separation distance or lag <xref ref-type="bibr" rid="bib1.bibx38" id="paren.36"/>. The experimental variogram <inline-formula><mml:math id="M5" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is defined as the averaged squared differences of data points separated by a lag distance <inline-formula><mml:math id="M6" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula>:
            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M7" display="block"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:munderover><mml:mo>(</mml:mo><mml:mi>Z</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi>Z</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M8" display="inline"><mml:mi>Z</mml:mi></mml:math></inline-formula> is a variable, <inline-formula><mml:math id="M9" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> is a spatial location, and <inline-formula><mml:math id="M10" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the number of pairs of data points for a lag <inline-formula><mml:math id="M11" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula>. Typically, the variance increases with lag distance until a threshold is reached where measurements are no longer spatially correlated. This threshold is called the <italic>sill</italic>, which is, in theory, equal to 1 for normalized data sets. The lag distance where the variogram reaches the sill is called the <italic>range</italic>.</p>
      <?pagebreak page3768?><p id="d1e944"><monospace>GStatSim</monospace> does not include variogram estimation tools as there are already existing resources (e.g., <monospace>SciKit-GStat</monospace>). Our interpolation functions are designed to be integrated with outside variogram modeling tools. We perform our variogram analysis with the <monospace>SciKit-GStat</monospace> functions, which offer robust tools for variogram estimation and modeling. We compute both the isotropic and anisotropic variograms. The anisotropic variogram computes the variogram for different angles from horizontal. Figure <xref ref-type="fig" rid="Ch1.F3"/> shows that the data do not contain significant anisotropy. While the anisotropic variograms do exhibit some disagreement at lags greater than <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">35</mml:mn></mml:mrow></mml:math></inline-formula> km, these differences can be attributed to regional trends in the topography. Additionally, the first part of the variogram with small lags is more important than the tail distributions when it comes to calculating the kriging weights used for interpolation. As such, only the isotropic variogram is used for the variogram modeling analysis.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e969"><bold>(a)</bold> Isotropic experimental variogram and variogram model. <bold>(b)</bold> Anisotropic variogram.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f03.png"/>

        </fig>

      <p id="d1e984">In order to use the variogram for interpolation, a variogram model must be fit to the experimental variogram. <monospace>GStatSim</monospace> can currently accommodate exponential, Gaussian, and spherical variogram model types. The exponential model is as follows:
            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M13" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mi>exp⁡</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mfenced open="{" close=""><mml:mrow><mml:mtable class="array" columnalign="left left left"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mtext>if</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>b</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:mi>b</mml:mi><mml:mo>)</mml:mo><mml:mfenced close="]" open="["><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mstyle scriptlevel="+1"><mml:mfrac><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mi>h</mml:mi></mml:mrow><mml:mi>a</mml:mi></mml:mfrac></mml:mstyle></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mtd><mml:mtd><mml:mtext>if</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mi>h</mml:mi><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo>,</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M14" display="inline"><mml:mi>a</mml:mi></mml:math></inline-formula> is the range parameter, <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is the sill, and <inline-formula><mml:math id="M16" display="inline"><mml:mi>b</mml:mi></mml:math></inline-formula> is the nugget. The nugget describes the variance at near-zero lags, which is often the result of measurement error. In most cases, the nugget is zero. The Gaussian model is
            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M17" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mtext>Gauss</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mfenced close="" open="{"><mml:mrow><mml:mtable class="array" columnalign="left left left"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mtext>if</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>b</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:mi>b</mml:mi><mml:mo>)</mml:mo><mml:mfenced close="]" open="["><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mstyle scriptlevel="+1"><mml:mfrac><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:msup><mml:mi>h</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mtd><mml:mtd><mml:mtext>if</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mi>h</mml:mi><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo>,</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></disp-formula>
          and the spherical model is
            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M18" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mtext>sph</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mfenced open="{" close=""><mml:mrow><mml:mtable class="array" columnalign="left left"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>b</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:mi>b</mml:mi><mml:mo>)</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mn mathvariant="normal">1.5</mml:mn><mml:mo>⋅</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>h</mml:mi><mml:mi>a</mml:mi></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>-</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn><mml:mo>⋅</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:msup><mml:mi>h</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mfenced></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if</mml:mtext><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mn mathvariant="normal">0</mml:mn><mml:mo>&lt;</mml:mo><mml:mi>h</mml:mi><mml:mo>≤</mml:mo><mml:mi>a</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi>h</mml:mi><mml:mo>&gt;</mml:mo><mml:mi>a</mml:mi></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo>.</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e1342">See <xref ref-type="bibr" rid="bib1.bibx4" id="text.37"/> for a detailed description of these models. In practice, variogram model parameters are often selected manually, though <monospace>SciKit-GStat</monospace> also offers automatic variogram modeling tools. Using these tools,<?pagebreak page3769?> we fit each of these model types to the experimental variogram, shown in Fig. <xref ref-type="fig" rid="Ch1.F3"/>a. A visual inspection of Fig. <xref ref-type="fig" rid="Ch1.F3"/>a shows that the exponential variogram model produces the best fit. As such, we use this model type for the topography interpolations shown in this paper. The exponential model has a nugget of 0, a range of 31.9 km, and a sill of 0.7. Geostatistical interpolations can be sensitive to the methods and parameters used to compute and model variograms. As such, we recommend referring to the <monospace>SciKit-GStat</monospace> documentation for best practices and considerations when conducting variogram analysis. The effect of different variogram models on interpolations is described in Sect. <xref ref-type="sec" rid="Ch1.S4.SS5"/>.</p>
</sec>
<sec id="Ch1.S4.SS3">
  <label>4.3</label><title>Kriging</title>
      <p id="d1e1370">Kriging is used to produce deterministic interpolations of a spatial variable, where the goal is to minimize estimation variance (e.g., <xref ref-type="bibr" rid="bib1.bibx38 bib1.bibx10" id="altparen.38"/>). For a spatial variable <inline-formula><mml:math id="M19" display="inline"><mml:mi>Z</mml:mi></mml:math></inline-formula>, kriging models the residuals <inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> from a mean <inline-formula><mml:math id="M21" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>:
            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M22" display="block"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>Z</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi>m</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e1449">In cases where the mean is constant, <inline-formula><mml:math id="M23" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula> is treated as a global mean. Each interpolated value <inline-formula><mml:math id="M24" display="inline"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> at a location <inline-formula><mml:math id="M25" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> is the weighted sum of neighboring measurements:
            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M26" display="block"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mi>N</mml:mi></mml:munderover><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mi>Z</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> are the weights on the <inline-formula><mml:math id="M28" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> data points. These weights account for the variability in the measurements, their proximity to each other and the node being estimated, and the redundancy between nearby measurements. Specifically, the weights are determined by solving the kriging system of equations which, for a system with three data points, would look like
            <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M29" display="block"><mml:mrow><mml:mtable class="split" rowspacing="4.267913pt" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mfenced open="[" close="]"><mml:mtable class="matrix" columnalign="center center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          which can be abbreviated to
            <disp-formula id="Ch1.E8" content-type="numbered"><label>8</label><mml:math id="M30" display="block"><mml:mrow><mml:mi mathvariant="bold">C</mml:mi><mml:mi mathvariant="bold-italic">λ</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold-italic">c</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M31" display="inline"><mml:mi mathvariant="bold">C</mml:mi></mml:math></inline-formula> describes the covariance between pairs of data points, and <inline-formula><mml:math id="M32" display="inline"><mml:mi mathvariant="bold-italic">c</mml:mi></mml:math></inline-formula> describes the covariance between each data point and the location that is being estimated, <inline-formula><mml:math id="M33" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. Note that the covariance is linked to the variogram:
            <disp-formula id="Ch1.E9" content-type="numbered"><label>9</label><mml:math id="M34" display="block"><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M35" display="inline"><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the variance of the data. We use the modeled variogram parameters determined in Sect. 4.2.</p>
      <p id="d1e1932"><monospace>GStatSim</monospace> contains functions for both simple and ordinary kriging. With simple kriging, it is assumed that the mean is a constant, known parameter defined by the mean of the data. For data that have undergone a normal score transformation, the mean is 0. For ordinary kriging, the mean is estimated implicitly within a search neighborhood around the coordinate being estimated, and simple kriging is applied to the residuals. This makes ordinary kriging more robust to spatial trends. The ordinary kriging weight estimation procedure is modified from Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) to
            <disp-formula id="Ch1.E10" content-type="numbered"><label>10</label><mml:math id="M36" display="block"><mml:mrow><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center center center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="italic">μ</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><?xmltex \hack{\hspace{-1cm}}?></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M37" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> is a Lagrange multiplier. The covariance function<?pagebreak page3770?> is also used to compute the uncertainty, or variance, at each location. The variance of an estimate at location <inline-formula><mml:math id="M38" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>E</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is defined as
            <disp-formula id="Ch1.E11" content-type="numbered"><label>11</label><mml:math id="M40" display="block"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>E</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mi>N</mml:mi></mml:munderover><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e2372">The ability of kriging to quantify uncertainty is a major advantage of this method over other deterministic interpolation methods such as spline interpolation.</p>
<sec id="Ch1.S4.SS3.SSS1">
  <label>4.3.1</label><title>Nearest-neighbor octant search</title>
      <p id="d1e2383">In practice, the covariance matrices in Eqs. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) and (<xref ref-type="disp-formula" rid="Ch1.E10"/>), <inline-formula><mml:math id="M41" display="inline"><mml:mi mathvariant="bold">C</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M42" display="inline"><mml:mi mathvariant="bold-italic">c</mml:mi></mml:math></inline-formula>, used to determine kriging weights typically do not use every value in the conditioning data. Instead, it is conventional to use the <inline-formula><mml:math id="M43" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> nearest neighbors, where <inline-formula><mml:math id="M44" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> is the number of conditioning nodes (e.g., <xref ref-type="bibr" rid="bib1.bibx51" id="altparen.39"/>). This significantly reduces the size of the covariance matrix and ensures that estimates are made using only relevant information. However, the nearest-neighbor approach can be problematic when the conditioning data are unevenly spatially distributed. In the ice-penetrating radar example, measurements are sampled densely along flight lines but are entirely absent in between lines. This means that the <inline-formula><mml:math id="M45" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> nearest neighbors of a coordinate next to a flight line could all be on one side, yielding lopsided conditioning data (Fig. <xref ref-type="fig" rid="Ch1.F4"/>). This lopsidedness would produce skewed estimates. To avoid this bias, our interpolation algorithms use a nearest-neighbor octant search (e.g., <xref ref-type="bibr" rid="bib1.bibx48" id="altparen.40"/>), where the <inline-formula><mml:math id="M46" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> neighbors are divided amongst the eight different octants of the coordinate plane (Fig. <xref ref-type="fig" rid="Ch1.F4"/>). This ensures that the conditioning data include values on all sides of the node being estimated. The ability of the nearest-neighbor octant search to produce a balanced conditioning data set is important for producing high-quality estimates, particularly for remote sensing data sets where the measurement density is often non-uniform. We note that the primary drawback of this approach is that it increases the algorithm runtime.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e2446">When measurements are gathered along line surveys, a simple
nearest-neighbor search <bold>(a)</bold> may result in estimates being skewed towards values on one side. The octant nearest-neighbor search <bold>(b)</bold> used in <monospace>GStatSim</monospace> ensures that the conditioning data surround the coordinate being estimated, which minimizes this bias in interpolations.</p></caption>
            <?xmltex \igopts{width=241.848425pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f04.png"/>

          </fig>

<?xmltex \hack{\newpage}?>
</sec>
<?pagebreak page3771?><sec id="Ch1.S4.SS3.SSS2">
  <label>4.3.2</label><title>Covariance matrix inversion</title>
      <p id="d1e2474">According to Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>), solving for the kriging weights <inline-formula><mml:math id="M47" display="inline"><mml:mi mathvariant="bold-italic">λ</mml:mi></mml:math></inline-formula> requires the inversion of the covariance matrix <inline-formula><mml:math id="M48" display="inline"><mml:mi mathvariant="bold">C</mml:mi></mml:math></inline-formula>:
              <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M49" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">λ</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="bold">C</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="bold">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">c</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e2514">However, <inline-formula><mml:math id="M50" display="inline"><mml:mi mathvariant="bold">C</mml:mi></mml:math></inline-formula> is not always a positive definite matrix, meaning that <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">C</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="bold">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> cannot be computed. This is especially common for complex scenarios such as ice-penetrating radar data sets which often contain overlapping and conflicting measurements. The matrix singularity issue can be resolved by computing the pseudo-inverse, <inline-formula><mml:math id="M52" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">C</mml:mi><mml:mo>+</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula>, instead. However the pseudo-inverse requires a time-consuming singular value decomposition with a runtime that scales by <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:mi>O</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> with data input size, making it an impractical choice for applications with large data sets. For improved performance, we use the <monospace>scipy.linalg.lstsq</monospace> function, which computes the least-squares solution to the equation <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold-italic">b</mml:mi></mml:mrow></mml:math></inline-formula>. Solving for the weights with <monospace>lstsq</monospace> instead of computing the matrix inversion directly lends greater numerical stability to the interpolation functions. Therefore, all functions in <monospace>GStatSim</monospace> involving covariance matrix inversions are implemented using <monospace>lstsq</monospace>.</p>
</sec>
<sec id="Ch1.S4.SS3.SSS3">
  <label>4.3.3</label><title>Kriging implementation and results</title>
      <p id="d1e2601">We implement simple kriging and ordinary kriging using the <monospace>GStatSim</monospace> <monospace>skrige</monospace> and <monospace>okrige</monospace> functions, respectively. The input parameters for these functions are the conditioning data, search radius, number of conditioning points, variogram parameters, and a list of coordinates that describe the prediction grid. We use a search radius of 50 km and 100 conditioning points. For convenience, <monospace>GStatSim</monospace> includes a <monospace>prediction_grid</monospace> function that automatically generates a list of coordinates defined by the minimum and maximum coordinate extents and the grid cell resolution. After <monospace>GStatSim</monospace> interpolation is applied, the kriging estimates are back-transformed using the <monospace>scikit-learn</monospace> <monospace>QuantileTransformer</monospace> function so that the original data distribution is recovered. For comparison, we also perform simple kriging using the <monospace>GeostatsPy</monospace> <monospace>kb2d</monospace> function.</p>
      <p id="d1e2635">The <monospace>GStatSim</monospace> kriging results (Fig. <xref ref-type="fig" rid="Ch1.F5"/>) show that the right side of the ordinary kriging estimate has a slightly higher (<inline-formula><mml:math id="M55" display="inline"><mml:mo lspace="0mm">∼</mml:mo></mml:math></inline-formula> tens of meters) elevation than the simple kriging estimate. This is because ordinary kriging does not assume that the mean is constant. The <monospace>GStatSim</monospace> and <monospace>GeostatsPy</monospace> simple kriging estimates are visually similar but differ by tens of meters throughout the domain. The black arrows in Fig. <xref ref-type="fig" rid="Ch1.F5"/>c and f highlight a visible seam in the <monospace>GeostatsPy</monospace> interpolation. This seam is located along grid cells that are equidistant from conditioning lines and may be the result of using a simple nearest-neighbor search (Fig. <xref ref-type="fig" rid="Ch1.F4"/>).</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e2666"><bold>(a)</bold> Simple kriging and <bold>(b)</bold> ordinary kriging interpolations using <monospace>GStatSim</monospace>. <bold>(c)</bold> Simple kriging interpolation using <monospace>GeostatsPy</monospace>. <bold>(d)</bold> Standard deviation for the simple kriging estimate from panel <bold>(a)</bold>. <bold>(e)</bold> Difference between simple and ordinary kriging. <bold>(f)</bold> Difference between <monospace>GStatSim</monospace> and <monospace>GeostatsPy</monospace> simple kriging. The black arrows highlight an artifact in the <monospace>GeostatsPy</monospace> interpolation that is likely caused by using a simple nearest-neighbor search (Fig. <xref ref-type="fig" rid="Ch1.F4"/>).</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f05.jpg"/>

          </fig>

      <p id="d1e2715">To investigate the spatial statistics of kriging interpolation, we compute the variogram for the <monospace>GStatSim</monospace> simple kriging estimate. The resulting variogram, shown in Fig. <xref ref-type="fig" rid="Ch1.F6"/>a, has substantially lower variances than the experimental variogram derived from the data. This difference highlights an important limitation of kriging interpolation: the variogram is not reproduced, making the interpolated values smoother than observations.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Figure}?><label>Figure 6</label><caption><p id="d1e2725"><bold>(a)</bold> Variogram for simple kriging estimate from Fig. <xref ref-type="fig" rid="Ch1.F5"/>a. <bold>(b)</bold> Variogram for SGS realization no. 1.</p></caption>
            <?xmltex \igopts{width=384.112205pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f06.png"/>

          </fig>

</sec>
</sec>
<sec id="Ch1.S4.SS4">
  <label>4.4</label><title>Sequential Gaussian simulation</title>
      <p id="d1e2750">In contrast to kriging, sequential Gaussian simulation (SGS) is designed to preserve the variance of observations. SGS is the stochastic alternative to kriging. In contrast to kriging where the objective is to optimize local accuracy, SGS is used to generate multiple realizations that reproduce the variogram statistics (e.g., <xref ref-type="bibr" rid="bib1.bibx13" id="altparen.41"/>). The implementation of SGS, described in Fig. <xref ref-type="fig" rid="Ch1.F7"/>, is the following:
<list list-type="order"><list-item>
      <p id="d1e2760">Define a random simulation order in which to visit each node.</p></list-item><list-item>
      <p id="d1e2764">At each node <inline-formula><mml:math id="M56" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, use kriging to estimate the mean <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and variance <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>E</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p></list-item><list-item>
      <p id="d1e2811">Randomly sample from the Gaussian distribution defined by <inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:msup><mml:mi>Z</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>E</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. This becomes the simulated value at that node.</p></list-item><list-item>
      <p id="d1e2851">Proceed to the next node and repeat steps 2 and 3 until all nodes have been simulated.</p></list-item></list></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7" specific-use="star"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e2856">Schematic of SGS. This figure is modified from <xref ref-type="bibr" rid="bib1.bibx35" id="text.42"/>, which was published under a Creative Commons Attribution license (<uri>https://creativecommons.org/licenses/by/4.0/</uri>, last access: 1 May 2023).</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f07.png"/>

        </fig>

      <p id="d1e2871"><monospace>GStatSim</monospace> has two different SGS functions, <monospace>okrige_sgs</monospace> and <monospace>skrige_sgs</monospace>, which use ordinary kriging and simple kriging for step 2, respectively. The results are unlikely to differ significantly between these two methods, but <monospace>okrige_sgs</monospace> may be more robust when large-scale trends are present. The input parameters are the same as those used for the <monospace>skrige</monospace> and <monospace>okrige</monospace> functions. We simulate four realizations using <monospace>okrige_sgs</monospace> using the same input parameters as in Sect. 4.3.3. To evaluate the ability of SGS to reproduce the spatial statistics of observations, we compute the variogram for realization no. 1 (Fig. <xref ref-type="fig" rid="Ch1.F6"/>). The variogram of the simulated topography matches the variogram of observations. The realizations are shown in Fig. <xref ref-type="fig" rid="Ch1.F8"/>. Each realization matches the conditioning data and represents an equally probable solution.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e2902"><bold>(a–d)</bold> SGS realizations generated with <monospace>okrige_SGS</monospace>.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f08.jpg"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS5">
  <label>4.5</label><title>Interpolation with different variogram models</title>
      <p id="d1e2924"><monospace>GStatSim</monospace> can perform interpolations using the exponential, Gaussian, or spherical variogram models, as described in Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>. In this section, we demonstrate how interpolations differ when using different variogram model types. We generate a synthetic conditioning data set of 100 points using the unconditional Gaussian field tools in <monospace>GSTools</monospace> (Fig. <xref ref-type="fig" rid="Ch1.F9"/>a). We use a variance of 2 and length scale of 8. While the true<?pagebreak page3772?> variogram for the synthetic data is Gaussian, we perform interpolations using different variogram models for demonstration purposes. We compute the experimental variogram and fit Gaussian, exponential, and spherical variogram models (Fig. <xref ref-type="fig" rid="Ch1.F9"/>b). Then we perform both simple kriging interpolation and SGS with each variogram  model. The results, shown in Fig. <xref ref-type="fig" rid="Ch1.F9"/>, show that the Gaussian model produces the SGS realization with the smoothest spatial structure and lowest kriging variance. The exponential model produces the roughest SGS topography and highest kriging variance, and the spherical model falls in the middle. These different model types allow <monospace>GStatSim</monospace> to accommodate different types of spatial structures.</p>

      <?xmltex \floatpos{p}?><fig id="Ch1.F9" specific-use="star"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e2946">Interpolation comparison using different variogram models. Synthetic conditioning data <bold>(a)</bold>, variograms <bold>(b)</bold>, kriging interpolation <bold>(c–e)</bold>, kriging uncertainty <bold>(f–h)</bold>, and SGS <bold>(i–k)</bold>.</p></caption>
          <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f09.jpg"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS6">
  <label>4.6</label><title>Interpolation with anisotropy</title>
      <?pagebreak page3773?><p id="d1e2978">Geologic phenomena frequently exhibit anisotropy in their spatial statistics. For example, preferential erosion can cause subglacial topography to be smoother in the direction that is parallel to ice flow <xref ref-type="bibr" rid="bib1.bibx35" id="paren.43"/>. The <monospace>GStatSim</monospace> interpolation functions can account for this anisotropy by accepting major and minor range parameters. The major range is the range of the variogram in the smoothest (major) direction, and the minor range is the range of the variogram in the minor direction, which is orthogonal to the major direction. Not all pairs of data points are oriented along the major or minor orientations, so the range is treated as the radius of a rotated ellipse where the major and minor ranges are the lengths of each axis, and the degree of rotation is determined by the angle of anisotropy. The major angle orientation is defined as the angle from zero (horizontal) of the major direction. In practice, these parameters can be determined by modeling the variogram in multiple directions and determining the major angle through visual inspection.</p>
      <?pagebreak page3775?><p id="d1e2987">To demonstrate the implementation of interpolation with anisotropy, we perform simple kriging and SGS with anisotropy for angles of 0 and 60<inline-formula><mml:math id="M61" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>. We use the modeled variogram parameters from previous sections (nugget <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, range <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">31.9</mml:mn></mml:mrow></mml:math></inline-formula> km, sill <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.7</mml:mn></mml:mrow></mml:math></inline-formula>). We use 31.9 km as the minor range and set the major range to be 15 km greater than the minor range for exaggerated effect. These interpolations (Fig. <xref ref-type="fig" rid="Ch1.F10"/>) have clearly visible anisotropy.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F10" specific-use="star"><?xmltex \currentcnt{10}?><?xmltex \def\figurename{Figure}?><label>Figure 10</label><caption><p id="d1e3033"><bold>(a)</bold> Simple kriging with anisotropy at 0<inline-formula><mml:math id="M65" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>. <bold>(b)</bold> Simple kriging with anisotropy at 60<inline-formula><mml:math id="M66" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>. <bold>(c)</bold> SGS with anisotropy at 0<inline-formula><mml:math id="M67" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>. <bold>(d)</bold> SGS with anisotropy at 60<inline-formula><mml:math id="M68" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f10.jpg"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS7">
  <label>4.7</label><title>Mean non-stationarity</title>
      <p id="d1e3098">Data sets often contain variations in spatial statistics, a condition known as non-stationarity. Mean non-stationarity occurs in the presence of a large-scale trend or systematic changes across a study area. While ordinary kriging can accommodate variations in the mean, to some extent, it does not extrapolate well <xref ref-type="bibr" rid="bib1.bibx26" id="paren.44"/>. For this reason, it is sometimes convenient to detrend the data prior to variogram modeling and interpolation. This approach is known as kriging (or SGS) with a trend or universal kriging. Detrending has the additional advantage of producing residual data that more closely represent a random Gaussian process, which makes the variogram modeling more robust. In contrast, data with a strong trend can yield an experimental variogram that never reaches an obvious sill, making it difficult to fit a variogram model.</p>
      <p id="d1e3104">Here we demonstrate kriging and SGS with a trend (Fig. <xref ref-type="fig" rid="Ch1.F11"/>). This is achieved by the following:
<list list-type="order"><list-item>
      <p id="d1e3111">Estimate the trend.</p></list-item><list-item>
      <p id="d1e3115">Subtract the trend from the data to obtain residual measurements.</p></list-item><list-item>
      <p id="d1e3119">Apply a normal score transformation to the residual data.</p></list-item><list-item>
      <p id="d1e3123">Conduct a variogram analysis on the transformed residual measurements.</p></list-item><list-item>
      <p id="d1e3127">Interpolate the residuals.</p></list-item><list-item>
      <p id="d1e3131">Back-transform the interpolation to recover the original data distribution.</p></list-item><list-item>
      <p id="d1e3135">Add the back-transformed interpolation to the trend.</p></list-item></list></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F11" specific-use="star"><?xmltex \currentcnt{11}?><?xmltex \def\figurename{Figure}?><label>Figure 11</label><caption><p id="d1e3140"><bold>(a)</bold> Trend estimate. <bold>(b)</bold> Simple kriging of detrended data. <bold>(c)</bold> The simple kriging estimate from panel <bold>(b)</bold> added to the trend from panel <bold>(a)</bold>. <bold>(d)</bold> The residual bed elevation data after the trend is subtracted from the data. <bold>(e)</bold> SGS applied to the detrended data. <bold>(f)</bold> The SGS interpolation from panel <bold>(e)</bold> added to the trend from panel <bold>(a)</bold>.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f11.jpg"/>

        </fig>

      <p id="d1e3180">While it is common practice to estimate the trend by fitting a linear or polynomial function to the data (e.g., <xref ref-type="bibr" rid="bib1.bibx42" id="altparen.45"/>), determining higher-order polynomial models for complex landscapes can be difficult. Instead, we estimate the trend using a radial basis function (RBF), which is a function that changes with distance from a location, such as a thin-plate spline or Gaussian function. RBFs measure the distance between input values and a center point, assigns weights based on these distances, and combines these weights to produce an output value <xref ref-type="bibr" rid="bib1.bibx2" id="paren.46"/>. The RBF trend estimation was implemented using the <monospace>GStatSim</monospace> <monospace>rbf_trend</monospace> function, which relies on the <monospace>scipy</monospace> RBF implementation. <monospace>rbf_trend</monospace> uses a multiquadric kernel as its RBF, which is known for its high accuracy and flexibility <xref ref-type="bibr" rid="bib1.bibx17 bib1.bibx55" id="paren.47"/>. The <monospace>rbf_trend</monospace> function input parameters are the conditioning data, the grid cell resolution, and a smoothing factor. The smoothing factor ensures that the trend is not overfitting to measurements. The smoothing parameter should be at least as large as the largest data gap. We use a smoothing factor of 100 km.</p>
      <p id="d1e3208">To evaluate the performance of the detrended SGS approach, we compute the experimental variogram for residual data (Fig. <xref ref-type="fig" rid="Ch1.F11"/>d) and the residual SGS (Fig. <xref ref-type="fig" rid="Ch1.F11"/>e). The variograms, shown in Fig. <xref ref-type="fig" rid="Ch1.F12"/>, show close agreement between the spatial statistics of the residual measurements and simulation. Note that both variograms reach a sill of 1 in contrast to the variogram for the data without detrending (Fig. <xref ref-type="fig" rid="Ch1.F6"/>). According to the theoretical definition of the variogram (Eq. <xref ref-type="disp-formula" rid="Ch1.E2"/>), data with a standard Gaussian distribution should reach a sill of 1. As such, the detrended data can often be better suited to variogram-based interpolation.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F12"><?xmltex \currentcnt{12}?><?xmltex \def\figurename{Figure}?><label>Figure 12</label><caption><p id="d1e3223">Variogram for detrended data from Fig. <xref ref-type="fig" rid="Ch1.F11"/>d and simulation of trend from Fig. <xref ref-type="fig" rid="Ch1.F11"/>e. These variograms have a sill of 1, which is the theoretical sill for standard Gaussian data.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f12.png"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS8">
  <label>4.8</label><title>Variogram non-stationarity</title>
      <p id="d1e3244">Variogram non-stationarity describes the condition when the variogram statistics vary throughout a domain. For example, the topographic roughness varies throughout Greenland <xref ref-type="bibr" rid="bib1.bibx7" id="paren.48"/>. To handle these cases, <monospace>GStatSim</monospace> includes a <monospace>cluster_sgs</monospace> function where the user can assign different variograms to different areas. It is implemented by partitioning the data into different clusters and then computing the variogram for each cluster. To simulate a grid cell,</p>
      <p id="d1e3256"><list list-type="order">
            <list-item>

      <p id="d1e3261">choose a random grid cell;</p>
            </list-item>
            <list-item>

      <p id="d1e3267">find the nearest-neighbor value and look up the cluster number of the nearest-neighbor point;</p>
            </list-item>
            <list-item>

      <p id="d1e3273">using the variogram parameters associated with the cluster of the nearest point, simulate a value with SGS;</p>
            </list-item>
            <list-item>

      <p id="d1e3279">assign the nearest-neighbor cluster number to the simulated value;</p>
            </list-item>
            <list-item>

      <p id="d1e3285">repeat until each grid cell is simulated.</p>
            </list-item>
          </list></p>
      <p id="d1e3290">This process ensures that the boundaries between different clusters vary for each realization. <monospace>cluster_sgs</monospace> takes the same inputs as SGS, as well as the cluster numbers for each data point and a data frame with the variogram parameters for each cluster. Users can use any method they like to partition the data into different clusters. In the next two subsections, we outline two approaches.</p>
<sec id="Ch1.S4.SS8.SSS1">
  <label>4.8.1</label><?xmltex \opttitle{$K$-means clustering approach}?><title><inline-formula><mml:math id="M69" display="inline"><mml:mi>K</mml:mi></mml:math></inline-formula>-means clustering approach</title>
      <?pagebreak page3776?><p id="d1e3310">One of the simplest ways to cluster data is with <inline-formula><mml:math id="M70" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>-means clustering, where the data are partitioned into <inline-formula><mml:math id="M71" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> clusters such that the average squared sum of distances from the center within each cluster is minimized. We apply <inline-formula><mml:math id="M72" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>-means clustering to the conditioning data and determine three clusters based on the coordinates and bed elevation (Fig. <xref ref-type="fig" rid="Ch1.F13"/>a). The justification for using these parameters is that data points that are geographically close to each other and have similar elevation values should have similar spatial statistics. We use a <inline-formula><mml:math id="M73" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> of 3, which was chosen arbitrarily for demonstration purposes. In real applications, external information or domain expertise may be used to inform the clustering decision.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F13" specific-use="star"><?xmltex \currentcnt{13}?><?xmltex \def\figurename{Figure}?><label>Figure 13</label><caption><p id="d1e3345"><bold>(a)</bold> <inline-formula><mml:math id="M74" display="inline"><mml:mi>K</mml:mi></mml:math></inline-formula>-means clustering of conditioning data. <bold>(b)</bold> SGS using different variogram parameters for each cluster.</p></caption>
            <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f13.jpg"/>

          </fig>

      <p id="d1e3366">We apply the variogram analysis to the data in each cluster separately using the procedure described in Sect. 4.2. To make the differences between clusters more pronounced, we manually modify several of the variogram parameters to exaggerate the differences in spatial statistics for visualization purposes. Clusters 0 and 2 are assigned angles for anisotropy (45<inline-formula><mml:math id="M75" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> for Cluster 0 and 90<inline-formula><mml:math id="M76" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> for Cluster 2). The minor ranges for Clusters 0 and 2 are assigned based on the automatic variogram modeling. The major ranges are set by adding 15 km to the minor ranges. Cluster 1 is given a sill of 0.6, and Clusters 0 and 2 are assigned sills equal to 1. The <monospace>cluster_sgs</monospace> simulation using these parameters produces visible differences in spatial statistics throughout the domain. For example, the anisotropy is clearly visible in the region defined by Cluster 0 (Fig. <xref ref-type="fig" rid="Ch1.F13"/>b). Despite the extreme differences in parameters used for each cluster, the cluster boundaries do not have artifacts or inconsistencies.</p>
</sec>
<sec id="Ch1.S4.SS8.SSS2">
  <label>4.8.2</label><title>Adaptive partitioning</title>
      <p id="d1e3401">The <inline-formula><mml:math id="M77" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>-means clustering approach described above provides a simple approach to partitioning the data, but the decision boundaries can seem arbitrary and result in clusters with widely varying sample counts. To overcome these challenges we present a recursive implementation of a divisive, density-based clustering approach we call adaptive partitioning. A similar approach was used in <xref ref-type="bibr" rid="bib1.bibx68" id="text.49"/>. The algorithm begins by treating the data set as a single cluster and quartering this cluster into four rectangles of equal area. For each subsequent cluster, the areal extent of the cluster continues to be quartered until the number of data samples contained within the cluster is below the maximum number of samples allowed or the minimum cluster size has been reached. <monospace>GStatSim</monospace> implements this as a fully recursive function named <monospace>adaptive_partitioning</monospace> with primary parameters <italic>max_points</italic>, which controls the maximum points allowed in a cluster, and <italic>min_length</italic>, which controls the minimum side length of a cluster. It may take<?pagebreak page3777?> tuning of these two parameters to produce a desirable partitioning, including adjusting <italic>max_points</italic> to create clusters of adequate sizes given the measurement density; <italic>min_length</italic> should be greater than the expected variogram range to ensure that there are sufficient data to accurately model the variogram parameters. Figure <xref ref-type="fig" rid="Ch1.F14"/>a shows the clusters resulting from <monospace>adaptive_partitioning</monospace> with <italic>max_points</italic> of 800 and <italic>min_length</italic> of 25 km.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F14" specific-use="star"><?xmltex \currentcnt{14}?><?xmltex \def\figurename{Figure}?><label>Figure 14</label><caption><p id="d1e3447"><bold>(a)</bold> Clusters derived from density-based adaptive partitioning function. <bold>(b)</bold> SGS using a different variogram in each cluster.</p></caption>
            <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f14.jpg"/>

          </fig>

      <p id="d1e3461">The variogram parameters for each cluster are modeled automatically and then modified to show exaggerated differences between clusters. Cluster 1 is modified to have a sill of 0.6. Clusters 6 and 12 are given 90 and 45<inline-formula><mml:math id="M78" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> directions of anisotropy, respectively, with major ranges that are determined by adding 15 km to the modeled range. These regional differences in variogram parameters are apparent in the resulting simulation in Fig. <xref ref-type="fig" rid="Ch1.F14"/>.</p>
</sec>
</sec>
<sec id="Ch1.S4.SS9">
  <label>4.9</label><title>Co-kriging and co-simulation</title>
      <?pagebreak page3778?><p id="d1e3485">Secondary information can be integrated into interpolations via co-kriging and co-simulation, where a well-sampled secondary variable is used to constrain the interpolation of a sparsely sampled primary variable. For example, if the ice surface elevation (Fig. <xref ref-type="fig" rid="Ch1.F15"/>a) is found to be correlated with the subglacial bed elevation, then the ice surface can be used to improve the interpolation. We note that the ice surface and subglacial topography are unlikely to be linearly related <xref ref-type="bibr" rid="bib1.bibx43" id="paren.50"/>; this example is merely intended to demonstrate the usage of our co-kriging and co-simulation tools. In theory, co-kriging and co-simulation are implemented by modeling the variogram for each variable and a cross-variogram that describes the covariation between the variables. In practice, the full co-kriging system of equations is difficult to solve, so approximations are used instead <xref ref-type="bibr" rid="bib1.bibx1 bib1.bibx24" id="paren.51"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F15" specific-use="star"><?xmltex \currentcnt{15}?><?xmltex \def\figurename{Figure}?><label>Figure 15</label><caption><p id="d1e3498"><bold>(a)</bold> Ice surface elevation data. <bold>(b)</bold> Normalized ice surface elevation measurements that are co-located with radar measurements. <bold>(c)</bold> Co-kriging interpolation. <bold>(d)</bold> Co-simulation.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/16/3765/2023/gmd-16-3765-2023-f15.jpg"/>

        </fig>

      <p id="d1e3518">While there are several different ways to implement co-kriging <xref ref-type="bibr" rid="bib1.bibx24" id="paren.52"/>, <monospace>GStatSim</monospace> only includes functions for co-located co-kriging under Markov model 1 (MM1) assumptions, as described by <xref ref-type="bibr" rid="bib1.bibx1" id="text.53"/>. This version was chosen for its simplicity; expert geostatistical knowledge is not needed to use this algorithm. Co-located co-kriging means that an estimate is made using only the secondary data point that is <italic>co-located</italic> with, or at the same location as, the grid cell being estimated. This significantly reduces the number of conditioning data points that are used to estimate each grid cell. Co-kriging with MM1 approximates the cross-variogram through a Markov assumption of conditional independence. It is assumed that a secondary data variable <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> at a location <inline-formula><mml:math id="M80" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> is conditionally independent of the primary variable <inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> at a location of <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:msup><mml:mi>u</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula>, given <inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msup><mml:mi>u</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> refers to a spatial location that is not <inline-formula><mml:math id="M85" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>. This statement of conditional independence is written as
            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M86" display="block"><mml:mtable rowspacing="4.267913pt" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi>E</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msup><mml:mi>u</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msup><mml:mi>u</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mi>E</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where <inline-formula><mml:math id="M87" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> refers to the expected value. In the geostatistical community, this Markov assumption is referred to as Markov model 1 <xref ref-type="bibr" rid="bib1.bibx1" id="paren.54"/>. See <xref ref-type="bibr" rid="bib1.bibx24" id="text.55"/> and <xref ref-type="bibr" rid="bib1.bibx58" id="text.56"/> for other co-kriging models. In the case where the ice surface elevation is used as a secondary constraint, MM1 means that the expected value of the ice surface at a location <inline-formula><mml:math id="M88" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, given knowledge of the bed elevation at location <inline-formula><mml:math id="M89" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, is independent of the bed elevation value at other locations. Under MM1 assumptions, the cross-correlogram describing the covariation between the primary and secondary variables is calculated as
            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M90" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M91" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> is the lag distance and <inline-formula><mml:math id="M92" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula> is the correlogram, calculated by
            <disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M93" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          assuming that <inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the normal scores variogram. While<?pagebreak page3779?> the variogram measures spatial covariance, the correlogram measures spatial correlation. This means that <inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the correlogram at a lag distance of zero, is simply the correlation coefficient between the primary and secondary variables. Because the cross-covariance between the primary and secondary data relies only on the correlation coefficient and primary variogram, the secondary variogram is not needed. This means that co-kriging and co-simulation with MM1 only require the primary variogram and the correlation coefficient to determine the co-kriging weights. The simple co-located co-kriging estimate <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:msubsup><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>*</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> at a location <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is defined as
            <disp-formula id="Ch1.E16" content-type="numbered"><label>16</label><mml:math id="M98" display="block"><mml:mrow><mml:msubsup><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>*</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mi>N</mml:mi></mml:munderover><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> are the weights on the <inline-formula><mml:math id="M100" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> primary data points, <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the co-located secondary datum, and <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is the weight for the secondary datum. This means that the co-kriging estimate of a bed elevation value is the weighted sum of bed elevation data points within a specified search radius and the co-located ice surface elevation datum. The variance is computed using Eq. (<xref ref-type="disp-formula" rid="Ch1.E11"/>). Co-SGS is implemented in the same way as SGS, except that Eq. (<xref ref-type="disp-formula" rid="Ch1.E16"/>) is used instead of Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>).</p>
      <p id="d1e4044">To implement co-kriging and co-SGS, we use the variogram model parameters from Sect. 4.2 and compute the correlation coefficient, <inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, between the bed elevation measurements and co-located ice surface elevation. For convenience, we developed a <monospace>find_colocated</monospace> function that extracts the co-located data points from the secondary variable (Fig. <xref ref-type="fig" rid="Ch1.F15"/>b). <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> was determined to be 0.6. The interpolations are performed using the <monospace>GStatSim</monospace> <monospace>cokrige_mm1</monospace> and <monospace>cosim_mm1</monospace> functions. These functions require the same input parameters as <monospace>skrige</monospace>, <monospace>okrige</monospace>, <monospace>skrige_sfs</monospace>, and <monospace>okrige_sfs</monospace> with the addition of <inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">12</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and the secondary data set.</p>
      <?pagebreak page3780?><p id="d1e4126">The co-kriging and co-SGS results are shown in Fig. <xref ref-type="fig" rid="Ch1.F15"/>. Compared to the previous kriging and simulation examples, these interpolations produce visibly higher-elevation topography on the right side of the region. This is due to the correlation with the ice surface. To evaluate the simulation performance, we compute the correlation coefficient between the ice surface elevation (Fig. <xref ref-type="fig" rid="Ch1.F15"/>a) and co-simulated bed elevation (Fig. <xref ref-type="fig" rid="Ch1.F15"/>d). This correlation coefficient is found to be 0.7, which is greater than the correlation coefficient of the co-located data, 0.6. This inflated correlation between the primary and secondary data is a known issue with MM1 <xref ref-type="bibr" rid="bib1.bibx58" id="paren.57"/>. Co-simulation with MM1 is also known to produce interpolation artifacts <xref ref-type="bibr" rid="bib1.bibx35" id="paren.58"/> and artificially high variance <xref ref-type="bibr" rid="bib1.bibx24" id="paren.59"/>. This is because the MM1 assumption screens out the influence of the primary data on the secondary data, except at the location <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, which can lead to the underestimation of the redundancy between the primary and secondary variables. For this reason, MM1 is most effective in situations where the primary variable is smoother than the secondary variable, which is not the case in our example. As such, it is important to check the statistics (variogram and correlation) of simulations produced with <monospace>cosim_mm1</monospace> to ensure that this method is used appropriately.</p>
</sec>
</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Tutorials and documentation</title>
      <p id="d1e4168">Each of the previous interpolation examples can be reproduced in tutorials found in the <monospace>GStatSim</monospace> GitHub page (<uri>https://github.com/GatorGlaciology/GStatSim</uri>, last access: 16 May 2023), Jupyter Book (<uri>https://gatorglaciology.github.io/gstatsimbook/intro.html</uri>, last access: 16 May 2023), or Zenodo repository (<ext-link xlink:href="https://doi.org/10.5281/zenodo.7274640" ext-link-type="DOI">10.5281/zenodo.7274640</ext-link>, <xref ref-type="bibr" rid="bib1.bibx34" id="altparen.60"/>). These tutorials can be downloaded as Jupyter Notebook files and are intended to enhance educational pathways to geostatistics.</p>
</sec>
<sec id="Ch1.S6">
  <label>6</label><title>Installation, licensing, and redistribution</title>
      <p id="d1e4194"><monospace>GStatSim</monospace> is added to the Python Package Index, commonly known as PyPi, and can be installed via the <italic>pip install gstatsim</italic> command. It can also be installed directly from GitHub with <italic>git clone</italic> (<uri>https://github.com/GatorGlaciology/GStatSim</uri>, last access: 16 May 2023). This package has an MIT license making it free to use and redistribute without restriction.</p>
</sec>
<sec id="Ch1.S7">
  <label>7</label><title>Discussion</title>
      <p id="d1e4216">Many existing geostatistical software applications are not open-source or directly suited to large-scale remote sensing problems. For example, we found that <monospace>GSTools</monospace> was unable to perform conditional interpolations for our topography case study due to the large RAM requirements, making it an impractical choice for applications with large conditioning data sets. Similarly, the <monospace>GeostatsPy</monospace> simulation crashed due to a numerical instability. While it is certainly possible that these issues can be attributed to user error, they highlight the need for an open-source geostatistical package that is specifically tested on large-scale line surveys.</p>
      <p id="d1e4225">The <monospace>GStatSim</monospace> package provides an accessible, robust alternative to existing software. The functions in this package are efficient and effective at large scales. Additionally, the octant search can mitigate interpolation bias when line data are used. <monospace>GStatSim</monospace> relies on existing packages (e.g., <monospace>SciKit-GStat</monospace>) where possible and can easily be integrated with existing Python tools and scientific analyses. The tutorials and documentation provide ample scaffolding for users without prior geostatistical experience. This will encourage the utilization of geostatistical simulation in new scientific domains and enhance educational pathways in geostatistics.</p>
      <p id="d1e4237">The bed topography interpolation examples show many different ways to interpolate the same data set, each with different assumptions, advantages, and limitations. We do not make a recommendation for using one interpolation method over others. In practice, the optimal interpolation method or combination of methods will depend on the structure of the data and the scientific objectives for a specific problem. For example, kriging methods are best if local accuracy is desired, while SGS should be used if the goal is to preserve the heterogeneity of a given geological parameter. The <monospace>cluster_sgs</monospace> function is advantageous for enabling variations in the spatial statistics of simulated phenomena. In practice, expert domain knowledge will be needed to select the best clustering approach and parameters. For instance, a known geological boundary may be used to delineate clusters. Many of these interpolation approaches can be combined. For example, <monospace>cluster_sgs</monospace>, <monospace>cokrige_mm1</monospace>, and <monospace>cosim_mm1</monospace> could be applied to detrended data.</p>
      <?pagebreak page3781?><p id="d1e4252">Although the focus of this article is subglacial topography, the <monospace>GStatSim</monospace> routines could be applied to numerous geoscientific problems. Cryosphere applications could include the interpolation of englacial layers <xref ref-type="bibr" rid="bib1.bibx32" id="paren.61"/>, marine sediment cores, and radiometric properties of subglacial conditions (e.g., <xref ref-type="bibr" rid="bib1.bibx5" id="altparen.62"/>). Beyond glaciology, <monospace>GStatSim</monospace> could be used for downscaling, potential field data analysis <xref ref-type="bibr" rid="bib1.bibx64" id="paren.63"/>, and planetary applications such as improving the resolution of digital terrain models <xref ref-type="bibr" rid="bib1.bibx21" id="paren.64"/>. The <monospace>cluster_sgs</monospace> function would be particularly useful for capturing regional changes in spatial statistics, and the nearest-neighbor octant search makes <monospace>GStatSim</monospace> well-suited for geostatistical modeling with geophysical line data. Furthermore, the ability of co-kriging and co-simulation to include secondary constraints provides a mechanism for synthesizing multiple geophysical and geological data sets. <monospace>GStatSim</monospace> could also be integrated with geophysical modeling routines such as SimPEG <xref ref-type="bibr" rid="bib1.bibx6" id="paren.65"/> to perform inversions. Specifically, geostatistical simulation can be used in Markov chain Monte Carlo frameworks for solving inverse problems <xref ref-type="bibr" rid="bib1.bibx22 bib1.bibx46 bib1.bibx44" id="paren.66"/>.</p>
      <p id="d1e4290">Each of the example interpolations in this paper takes 2 to 3 min to run on a MacBook Pro with an Apple M1 chip. The run times increase exponentially with size and resolution improvement. Most of this computational time is attributed to the nearest-neighbor octant search. As such, geostatistical simulation can become cumbersome and time-intensive for large ensembles, depending on the simulation grid size, nearest-neighbor search radius, and number of conditioning points. There are many approaches for accelerating SGS <xref ref-type="bibr" rid="bib1.bibx14 bib1.bibx12 bib1.bibx37 bib1.bibx45" id="paren.67"/>, though these methods lack flexibility or require greater computational resources. Future work is needed to develop tools with improved performance while maintaining the flexibility and functionality. <monospace>GStatSim</monospace> could also be modified to include additional variogram models and interpolation methods such as indicator kriging <xref ref-type="bibr" rid="bib1.bibx59" id="paren.68"/>.</p>
</sec>
<sec id="Ch1.S8" sec-type="conclusions">
  <label>8</label><title>Conclusions</title>
      <p id="d1e4310">Spatial interpolation is a common problem in the geosciences, though the availability of open-access software remains a key barrier to the widespread utilization of geostatistics. The <monospace>GStatSim</monospace> package addresses this barrier by making available Python tools and educational materials for implementing various interpolation methods. The tools here could be applied to a variety of geological and geophysical data sets for both research and educational purposes and can be integrated with existing Python tools and workflows. The inclusion of non-stationary SGS, co-kriging, co-simulation, and trend estimation functions make <monospace>GStatSim</monospace> particularly useful for applying geostatistics to complex phenomena.</p>
</sec>

      
      </body>
    <back><notes notes-type="codedataavailability"><title>Code and data availability</title>

      <p id="d1e4323">The source code, data, and tutorials are permanently archived in Zenodo (<ext-link xlink:href="https://doi.org/10.5281/zenodo.7274640" ext-link-type="DOI">10.5281/zenodo.7274640</ext-link>, <xref ref-type="bibr" rid="bib1.bibx34" id="altparen.69"/>). These materials can also be accessed from GitHub (<uri>https://github.com/GatorGlaciology/GStatSim</uri>, 16 May 2023), PyPi (<uri>https://pypi.org/project/gstatsim/</uri>, 16 May 2023), and our Jupyter Book (<uri>https://gatorglaciology.github.io/gstatsimbook/intro.html</uri>, 16 May 2023).</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e4345">EJM is the primary developer of <monospace>GStatSim</monospace> and author of the manuscript. MF made major contributions to the package and writing. LW, ZY, NS, MH, and AZ contributed to the <monospace>GStatSim</monospace> software development.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e4357">The contact author has declared that none of the authors has any competing interests.</p>
  </notes><?xmltex \hack{\newpage}?><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d1e4364">Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e4370">We would like to thank Eric Stubbs for providing technical support on the software development. We thank Fernando Peréz for his guidance on the direction of this repository. We thank Caroline Riggall, Leo Ramsey Watson, and Caleb Koresh for helping test the tools. We also thank  Mirko Mälicke and Joe MacGregor whose reviews greatly improved this article.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e4375">This work was sponsored by the Earth Sciences Information Partners (ESIP) Lab, the National Science Foundation (NSF) GeoSMART program, and the University of Florida Artificial Intelligence Initiative Center.</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e4381">This paper was edited by Deepak Subramani and reviewed by Joseph MacGregor and Mirko Mälicke.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Almeida and Journel(1994)}}?><label>Almeida and Journel(1994)</label><?label almeida1994joint?><mixed-citation>
Almeida, A. S. and Journel, A. G.: Joint simulation of multiple variables with a Markov-type coregionalization model, Math. Geol., 26, 565–588, 1994.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Broomhead and Lowe(1988)}}?><label>Broomhead and Lowe(1988)</label><?label broomhead1988radial?><mixed-citation>
Broomhead, D. S. and Lowe, D.: Radial basis functions, multi-variable functional interpolation and adaptive networks, Tech. rep., Royal Signals and Radar Establishment Malvern, United Kingdom, 1988.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Carle(1999)}}?><label>Carle(1999)</label><?label carle1999t?><mixed-citation>
Carle, S. F.: T-PROGS: Transition probability geostatistical software, Version 2.1, Department of Land, Air and Water Resources, University of California, Davis, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Chiles and Delfiner(2009)}}?><label>Chiles and Delfiner(2009)</label><?label chiles2009geostatistics?><mixed-citation>Chiles, J.-P. and Delfiner, P.: Geostatistics: modeling spatial uncertainty, Vol. 497, John Wiley &amp; Sons, <ext-link xlink:href="https://doi.org/10.1007/s11004-012-9429-y" ext-link-type="DOI">10.1007/s11004-012-9429-y</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{{Chu et al.(2021)Chu, Hilger, Culberg, Schroeder, Jordan, Seroussi, Young, Blankenship, and Vaughan}}?><label>Chu et al.(2021)Chu, Hilger, Culberg, Schroeder, Jordan, Seroussi, Young, Blankenship, and Vaughan</label><?label chu2021multisystem?><mixed-citation>Chu, W., Hilger, A. M., Culberg, R., Schroeder, D. M., Jordan, T. M., Seroussi, H., Young, D. A., Blankenship, D. D., and Vaughan, D. G.: Multisystem synthesis of radar sounding observations of the Amundsen Sea sector from the 2004–2005 field season, J. Geophys. Res.-Earth, 126, e2021JF006296, <ext-link xlink:href="https://doi.org/10.1029/2021JF006296" ext-link-type="DOI">10.1029/2021JF006296</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Cockett et al.(2015)Cockett, Kang, Heagy, Pidlisecky, and Oldenburg}}?><label>Cockett et al.(2015)Cockett, Kang, Heagy, Pidlisecky, and Oldenburg</label><?label cockett2015simpeg?><mixed-citation>
Cockett, R., Kang, S., Heagy, L. J., Pidlisecky, A., and Oldenburg, D. W.: SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications, Comput. Geosci., 85, 142–154, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Cooper et al.(2019)Cooper, Jordan, Schroeder, Siegert, Williams, and Bamber}}?><label>Cooper et al.(2019)Cooper, Jordan, Schroeder, Siegert, Williams, and Bamber</label><?label cooper2019subglacial?><mixed-citation>Cooper, M. A., Jordan, T. M., Schroeder, D. M., Siegert, M. J., Williams, C. N., and Bamber, J. L.: Subglacial roughness of the Greenland Ice Sheet: relationship with contemporary ice velocity and geology, The Cryosphere, 13, 3093–3115, <ext-link xlink:href="https://doi.org/10.5194/tc-13-3093-2019" ext-link-type="DOI">10.5194/tc-13-3093-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Costa and Soares(2009)}}?><label>Costa and Soares(2009)</label><?label costa2009homogenization?><mixed-citation>
Costa, A. C. and Soares, A.: Homogenization of climate data: review and new perspectives using geostatistics, Math. Geosci., 41, 291–305, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{CReSIS(2022)}}?><label>CReSIS(2022)</label><?label cresis2022?><mixed-citation>CReSIS: CReSIS Radar Depth Sounder, Digital Media, <uri>http://data.cresis.ku.edu/</uri> (last access: 1 August 2022), 2022.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Cressie(1990)}}?><label>Cressie(1990)</label><?label cressie1990origins?><mixed-citation>
Cressie, N.: The origins of kriging, Math. Geol., 22, 239–252, 1990.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Cressie and Hawkins(1980)}}?><label>Cressie and Hawkins(1980)</label><?label cressie1980robust?><mixed-citation>
Cressie, N. and Hawkins, D. M.: Robust estimation of the variogram: I, J. Int. Ass. Math. Geol., 12, 115–125, 1980.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Daly et al.(2010)Daly, Quental, and Novak}}?><label>Daly et al.(2010)Daly, Quental, and Novak</label><?label daly2010faster?><mixed-citation>Daly, C., Quental, S., and Novak, D.: A faster, more accurate Gaussian simulation, in: Proceedings of the Geocanada Conference, Calgary, AB, Canada, 10–14, <uri>https://www.searchanddiscovery.com/pdfz/abstracts/pdf/2014/90172cspg/abstracts/ndx_daly.pdf.html</uri> (last access: 28 June 2023), 2010.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Deutsch and Journel(1992)}}?><label>Deutsch and Journel(1992)</label><?label deutsch1992geostatistical?><mixed-citation>
Deutsch, C. V. and Journel, A. G.: Geostatistical software library and user's guide, Oxford University Press, 1–375, 1992.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Dimitrakopoulos and Luo(2004)}}?><label>Dimitrakopoulos and Luo(2004)</label><?label dimitrakopoulos2004generalized?><mixed-citation>Dimitrakopoulos, R. and Luo, X.: Generalized sequential Gaussian simulation on group size <inline-formula><mml:math id="M107" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula> and screen-effect approximations for large field simulations, Math. Geol., 36, 567–591, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Emery and Maleki(2019)}}?><label>Emery and Maleki(2019)</label><?label emery2019geostatistics?><mixed-citation>Emery, X. and Maleki, M.: Geostatistics in the presence of geological boundaries: Application to mineral resources modeling, Ore Geol. Rev., 114, 103124, <ext-link xlink:href="https://doi.org/10.1016/j.oregeorev.2019.103124" ext-link-type="DOI">10.1016/j.oregeorev.2019.103124</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Feyen and Caers(2006)}}?><label>Feyen and Caers(2006)</label><?label feyen2006quantifying?><mixed-citation>
Feyen, L. and Caers, J.: Quantifying geological uncertainty for flow and transport modeling in multi-modal heterogeneous formations, Adv. Water Resour., 29, 912–929, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Franke(1982)}}?><label>Franke(1982)</label><?label franke1982scattered?><mixed-citation>
Franke, R.: Scattered data interpolation: tests of some methods, Math. Comput., 38, 181–200, 1982.</mixed-citation></ref>
      <ref id="bib1.bibx18"><?xmltex \def\ref@label{{GMS(2021)}}?><label>GMS(2021)</label><?label gms2021?><mixed-citation>GMS: GMS 10.6 Editions &amp; Pricing, <uri>https://www.aquaveo.com/software/gms-pricing</uri> (last access: 1 August 2022), 2021.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{Goovaerts(1998)}}?><label>Goovaerts(1998)</label><?label goovaerts1998ordinary?><mixed-citation>
Goovaerts, P.: Ordinary cokriging revisited, Math. Geol., 30, 21–42, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx20"><?xmltex \def\ref@label{{Goovaerts(1999)}}?><label>Goovaerts(1999)</label><?label goovaerts1999geostatistics?><mixed-citation>
Goovaerts, P.: Geostatistics in soil science: state-of-the-art and perspectives, Geoderma, 89, 1–45, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{{Gwinner et al.(2009)Gwinner, Scholten, Spiegel, Schmidt, Giese, Oberst, Heipke, Jaumann, and Neukum}}?><label>Gwinner et al.(2009)Gwinner, Scholten, Spiegel, Schmidt, Giese, Oberst, Heipke, Jaumann, and Neukum</label><?label gwinner2009derivation?><mixed-citation>
Gwinner, K., Scholten, F., Spiegel, M., Schmidt, R., Giese, B., Oberst, J., Heipke, C., Jaumann, R., and Neukum, G.: Derivation and validation of high-resolution digital terrain models from Mars Express HRSC data, Photogramm. Eng. Rem. S., 75, 1127–1142, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{{Haas and Dubrule(1994)}}?><label>Haas and Dubrule(1994)</label><?label haas1994geostatistical?><mixed-citation>Haas, A. and Dubrule, O.: Geostatistical inversion-a sequential method of stochastic reservoir modelling constrained by seismic data, First break, 12, <ext-link xlink:href="https://doi.org/10.3997/1365-2397.1994034" ext-link-type="DOI">10.3997/1365-2397.1994034</ext-link>, 1994.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Harris et al.(2020)}}?><label>Harris et al.(2020)</label><?label harris2020array?><mixed-citation>
Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H., Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., Gérard-Marchant, P., Sheppard, K., Reddy, T., Weckesser, W., Abbasi, H., Gohlke, C., and Oliphant, T. E.: Array programming with NumPy, Nature, 585, 357–362, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Journel(1999)}}?><label>Journel(1999)</label><?label journel1999markov?><mixed-citation>
Journel, A. G.: Markov models for cross-covariances, Math. Geol., 31, 955–964, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Journel and Huijbregts(1976)}}?><label>Journel and Huijbregts(1976)</label><?label journel1976mining?><mixed-citation>
Journel, A. G. and Huijbregts, C. J.: Mining geostatistics, Academic Press, 600 pp., ISBN-10: 0123910501, 1976.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Journel and Rossi(1989)}}?><label>Journel and Rossi(1989)</label><?label journel1989we?><mixed-citation>
Journel, A. G. and Rossi, M.: When do we need a trend model in kriging?, Math. Geol., 21, 715–739, 1989.</mixed-citation></ref>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Kelkar and Perez(2002)}}?><label>Kelkar and Perez(2002)</label><?label kelkar2002applied?><mixed-citation>
Kelkar, M. and Perez, G.: Applied geostatistics for reservoir characterization, Society of Petroleum Engineers, 274 pp., ISBN-10: 1555630952, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Kitanidis(1997)}}?><label>Kitanidis(1997)</label><?label kitanidis1997introduction?><mixed-citation>
Kitanidis, P. K.: Introduction to geostatistics: applications in hydrogeology, Cambridge University Press, 272 pp., ISBN: 9780521587471, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx29"><?xmltex \def\ref@label{{Krige(1951)}}?><label>Krige(1951)</label><?label krige1951statistical?><mixed-citation>
Krige, D. G.: A statistical approach to some basic mine valuation problems on the Witwatersrand, J. S. Afr. I. Min. Metall., 52, 119–139, 1951.</mixed-citation></ref>
      <?pagebreak page3783?><ref id="bib1.bibx30"><?xmltex \def\ref@label{{Lark(2012)}}?><label>Lark(2012)</label><?label lark2012towards?><mixed-citation>
Lark, R. M.: Towards soil geostatistics, Spat. Stat.-Neth., 1, 92–99, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx31"><?xmltex \def\ref@label{{Law et al.(2023)}}?><label>Law et al.(2023)</label><?label law2023complex?><mixed-citation>Law, R., Christoffersen, P., MacKie, E., Cook, S., Haseloff, M., and Gagliardini, O.: Complex motion of Greenland Ice Sheet outlet glaciers with basal temperate ice, Science Advances, 9, eabq5180, <ext-link xlink:href="https://doi.org/10.1126/sciadv.abq5180" ext-link-type="DOI">10.1126/sciadv.abq5180</ext-link>, 2023.</mixed-citation></ref>
      <ref id="bib1.bibx32"><?xmltex \def\ref@label{{MacGregor et al.(2015)MacGregor, Fahnestock, Catania, Paden, Prasad Gogineni, Young, Rybarski, Mabrey, Wagman, and Morlighem}}?><label>MacGregor et al.(2015)MacGregor, Fahnestock, Catania, Paden, Prasad Gogineni, Young, Rybarski, Mabrey, Wagman, and Morlighem</label><?label macgregor2015radiostratigraphy?><mixed-citation>
MacGregor, J. A., Fahnestock, M. A., Catania, G. A., Paden, J. D., Prasad Gogineni, S., Young, S. K., Rybarski, S. C., Mabrey, A. N., Wagman, B. M., and Morlighem, M.: Radiostratigraphy and age structure of the Greenland Ice Sheet, J. Geophys. Res.-Earth, 120, 212–241, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx33"><?xmltex \def\ref@label{{MacKie et al.(2020)}}?><label>MacKie et al.(2020)</label><?label mackie2020antarctic?><mixed-citation>MacKie, E., Schroeder, D., Caers, J., Siegfried, M., and Scheidt, C.: Antarctic topographic realizations and geostatistical modeling used to map subglacial lakes, J. Geophys. Res.-Earth, 125, e2019JF005420, <ext-link xlink:href="https://doi.org/10.1029/2019JF005420" ext-link-type="DOI">10.1029/2019JF005420</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx34"><?xmltex \def\ref@label{MacKie et al.(2022)}?><label>MacKie et al.(2022)</label><?label MacKieZenodo?><mixed-citation>MacKie, E., Field, M., Wang, L., Yin, Z., Schoedl, N., and Hibbs, M.: GStatSim, Version 1.0, Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.7274640" ext-link-type="DOI">10.5281/zenodo.7274640</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx35"><?xmltex \def\ref@label{{MacKie et al.(2021)}}?><label>MacKie et al.(2021)</label><?label mackie2021stochastic?><mixed-citation>
MacKie, E. J., Schroeder, D. M., Zuo, C., Yin, Z., and Caers, J.: Stochastic modeling of subglacial topography exposes uncertainty in water routing at Jakobshavn Glacier, J. Glaciol., 67, 75–83, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx36"><?xmltex \def\ref@label{{M{\"{a}}licke(2022)}}?><label>Mälicke(2022)</label><?label malicke2022scikit?><mixed-citation>Mälicke, M.: SciKit-GStat 1.0: a SciPy-flavored geostatistical variogram estimation toolbox written in Python, Geosci. Model Dev., 15, 2505–2532, <ext-link xlink:href="https://doi.org/10.5194/gmd-15-2505-2022" ext-link-type="DOI">10.5194/gmd-15-2505-2022</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx37"><?xmltex \def\ref@label{{Mariethoz(2010)}}?><label>Mariethoz(2010)</label><?label mariethoz2010general?><mixed-citation>
Mariethoz, G.: A general parallelization strategy for random path based geostatistical simulation methods, Comput. Geosci., 36, 953–958, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx38"><?xmltex \def\ref@label{{Matheron(1963)}}?><label>Matheron(1963)</label><?label matheron1963principles?><mixed-citation>
Matheron, G.: Principles of geostatistics, Econ. Geol., 58, 1246–1266, 1963.</mixed-citation></ref>
      <ref id="bib1.bibx39"><?xmltex \def\ref@label{{McKinney(2010)}}?><label>McKinney(2010)</label><?label mckinney2010data?><mixed-citation>
McKinney, W.: Data structures for statistical computing in python, in: Proceedings of the 9th Python in Science Conference, Austin, TX, 445, 51–56, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx40"><?xmltex \def\ref@label{{M{\"{u}}ller et al.(2022)}}?><label>Müller et al.(2022)</label><?label muller2022gstools?><mixed-citation>Müller, S., Schüler, L., Zech, A., and Heße, F.: <monospace>GSTools</monospace> v1.3: a toolbox for geostatistical modelling in Python, Geosci. Model Dev., 15, 3161–3182, <ext-link xlink:href="https://doi.org/10.5194/gmd-15-3161-2022" ext-link-type="DOI">10.5194/gmd-15-3161-2022</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx41"><?xmltex \def\ref@label{{Murphy(2014)}}?><label>Murphy(2014)</label><?label murphy2014pykrige?><mixed-citation>Murphy, B. S.: PyKrige: development of a kriging toolkit for Python, in: AGU fall meeting abstracts, San Francisco, December 2014, H51K-0753, <uri>https://geostat-framework.readthedocs.io/en/latest/</uri> (last access: 29 June 2023), 2014.</mixed-citation></ref>
      <ref id="bib1.bibx42"><?xmltex \def\ref@label{{Neven et al.(2021)Neven, Dall'Alba, Juda, Straubhaar, and Renard}}?><label>Neven et al.(2021)Neven, Dall'Alba, Juda, Straubhaar, and Renard</label><?label neven2021ice?><mixed-citation>Neven, A., Dall'Alba, V., Juda, P., Straubhaar, J., and Renard, P.: Ice volume and basal topography estimation using geostatistical methods and ground-penetrating radar measurements: application to the Tsanfleuron and Scex Rouge glaciers, Swiss Alps, The Cryosphere, 15, 5169–5186, <ext-link xlink:href="https://doi.org/10.5194/tc-15-5169-2021" ext-link-type="DOI">10.5194/tc-15-5169-2021</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx43"><?xmltex \def\ref@label{{Ng et al.(2018)Ng, Ign{\'{e}}czi, Sole, and Livingstone}}?><label>Ng et al.(2018)Ng, Ignéczi, Sole, and Livingstone</label><?label ng2018response?><mixed-citation>
Ng, F. S., Ignéczi, Á., Sole, A. J., and Livingstone, S. J.: Response of surface topography to basal variability along glacial flowlines, J. Geophys. Res.-Earth, 123, 2319–2340, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx44"><?xmltex \def\ref@label{{Nunes et al.(2012)Nunes, Soares, Schwedersky, Dillon, Guerreiro, Caetano, Maciel, and Leon}}?><label>Nunes et al.(2012)Nunes, Soares, Schwedersky, Dillon, Guerreiro, Caetano, Maciel, and Leon</label><?label nunes2012geostatistical?><mixed-citation>Nunes, R., Soares, A., Schwedersky, G., Dillon, L., Guerreiro, L., Caetano, H., Maciel, C., and Leon, F.: Geostatistical inversion of prestack seismic data, in: Ninth International Geostatistics Congress, Oslo, Norway, June, 2012, 1–8, <uri>http://geostats2012.nr.no/pdfs/1747134.pdf</uri> (last access: 29 June 2023), 2012.</mixed-citation></ref>
      <ref id="bib1.bibx45"><?xmltex \def\ref@label{{Nussbaumer et al.(2018)Nussbaumer, Mariethoz, Gravey, Gloaguen, and Holliger}}?><label>Nussbaumer et al.(2018)Nussbaumer, Mariethoz, Gravey, Gloaguen, and Holliger</label><?label nussbaumer2018accelerating?><mixed-citation>
Nussbaumer, R., Mariethoz, G., Gravey, M., Gloaguen, E., and Holliger, K.: Accelerating sequential gaussian simulation with a constant path, Comput. Geosci., 112, 121–132, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx46"><?xmltex \def\ref@label{{Oh and Kwon(2001)}}?><label>Oh and Kwon(2001)</label><?label oh2001geostatistical?><mixed-citation>
Oh, S.-H. and Kwon, B.-D.: Geostatistical approach to Bayesian inversion of geophysical data: Markov chain Monte Carlo method, Earth Planets Space, 53, 777–791, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx47"><?xmltex \def\ref@label{{Parizek et al.(2013)}}?><label>Parizek et al.(2013)</label><?label parizek2013dynamic?><mixed-citation>
Parizek, B., Christianson, K., Anandakrishnan, S., Alley, R., Walker, R., Edwards, R., Wolfe, D., Bertini, G., Rinehart, S., Bindschadler, R., and Nowicki, S. M. J.: Dynamic (in) stability of Thwaites Glacier, West  Antarctica, J. Geophys. Res.-Earth, 118, 638–655, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx48"><?xmltex \def\ref@label{{Pebesma(2004)}}?><label>Pebesma(2004)</label><?label pebesma2004multivariable?><mixed-citation>
Pebesma, E. J.: Multivariable geostatistics in S: the gstat package, Comput. Geosci., 30, 683–691, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx49"><?xmltex \def\ref@label{{Pedregosa et al.(2011)Pedregosa, Varoquaux, Gramfort, Michel, Thirion, Grisel, Blondel, Prettenhofer, Weiss, Dubourg, Vanderplas, Passos, Cournapeau, Brucher, Perrot, and Duchesnay}}?><label>Pedregosa et al.(2011)Pedregosa, Varoquaux, Gramfort, Michel, Thirion, Grisel, Blondel, Prettenhofer, Weiss, Dubourg, Vanderplas, Passos, Cournapeau, Brucher, Perrot, and Duchesnay</label><?label scikit-learn?><mixed-citation>
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E.: Scikit-learn: Machine Learning in Python, J. Mach. Learn. Res., 12, 2825–2830, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx50"><?xmltex \def\ref@label{{Porter et al.(2018)}}?><label>Porter et al.(2018)</label><?label center2018arctic?><mixed-citation>Porter, C., Morin, P., Howat, I., Noh, M.-J., Bates, B., Peterman, K., Keesey, S., Schlenk, M., Gardiner, J., Tomko, K., Willis, M., Kelleher, C., Cloutier, M., Husby, E., Foga, S., Nakamura, H., Platson, M., Wethington Jr., M., Williamson, C., Bauer, G., Enos, J., Arnold, G., Kramer, W., Becker, P., Doshi, A., D'Souza, C., Cummens, P., Laurier, F., and Bojesen, M.: ArcticDEM, Version 3, Harvard Dataverse [data set], <ext-link xlink:href="https://doi.org/10.7910/DVN/OHHUKH" ext-link-type="DOI">10.7910/DVN/OHHUKH</ext-link>,  2018.</mixed-citation></ref>
      <ref id="bib1.bibx51"><?xmltex \def\ref@label{{Pyrcz et al.(2021)Pyrcz, Jo, Kupenko, Liu, Gigliotti, Salomaki, and Santos}}?><label>Pyrcz et al.(2021)Pyrcz, Jo, Kupenko, Liu, Gigliotti, Salomaki, and Santos</label><?label pyrcz2021geostatspy?><mixed-citation>Pyrcz, M., Jo, H., Kupenko, A., Liu, W., Gigliotti, A., Salomaki, T., and Santos, J.: GeostatsPy, <uri>https://github.com/GeostatsGuy/GeostatsPy</uri> (last access: 1 June 2022), 2021.</mixed-citation></ref>
      <ref id="bib1.bibx52"><?xmltex \def\ref@label{{Pyrcz and Deutsch(2014)}}?><label>Pyrcz and Deutsch(2014)</label><?label pyrcz2014geostatistical?><mixed-citation>
Pyrcz, M. J. and Deutsch, C. V.: Geostatistical reservoir modeling, Oxford University Press, 384 pp., ISBN: 978-0199731442, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx53"><?xmltex \def\ref@label{{Remy(2005)}}?><label>Remy(2005)</label><?label remy2005s?><mixed-citation>Remy, N.: S-GeMS: the stanford geostatistical modeling software: a tool for new algorithms development, in: Geostatistics Banff 2004, edited by: Leuangthong, O. and Deutsch, C. V., Springer, 865–871, <ext-link xlink:href="https://doi.org/10.1007/978-1-4020-3610-1_89" ext-link-type="DOI">10.1007/978-1-4020-3610-1_89</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx54"><?xmltex \def\ref@label{{Remy et al.(2009)}}?><label>Remy et al.(2009)</label><?label remy2009applied?><mixed-citation>Remy, N., Boucher, A., and Wu, J.: Applied geostatistics with SGeMS: A user's guide, Cambridge University Press, <ext-link xlink:href="https://doi.org/10.1017/CBO9781139150019" ext-link-type="DOI">10.1017/CBO9781139150019</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx55"><?xmltex \def\ref@label{{Sarra and Kansa(2009)}}?><label>Sarra and Kansa(2009)</label><?label sarra2009multiquadric?><mixed-citation>
Sarra, S. A. and Kansa, E. J.: Multiquadric radial basis function approximation methods for the numerical solution of partial differential equations, Advances in Computational Mechanics, 2, 220 pp., 2009.</mixed-citation></ref>
      <ref id="bib1.bibx56"><?xmltex \def\ref@label{{Seroussi et al.(2017)Seroussi, Nakayama, Larour, Menemenlis, Morlighem, Rignot, and Khazendar}}?><label>Seroussi et al.(2017)Seroussi, Nakayama, Larour, Menemenlis, Morlighem, Rignot, and Khazendar</label><?label seroussi2017continued?><mixed-citation>
Seroussi, H., Nakayama, Y., Larour, E., Menemenlis, D., Morlighem, M., Rignot, E., and Khazendar, A.: Continued retreat of Thwaites Glacier, West Antarctica, controlled by bed topography and ocean circulation, Geophys. Res. Lett., 44, 6191–6199, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx57"><?xmltex \def\ref@label{{Shamsipour et al.(2010)Shamsipour, Marcotte, Chouteau, and Keating}}?><label>Shamsipour et al.(2010)Shamsipour, Marcotte, Chouteau, and Keating</label><?label shamsipour2013?><mixed-citation>
Shamsipour, P., Marcotte, D., Chouteau, M., and Keating, P.: 3D stochastic inversion of gravity data using cokriging and cosimulation, Geophysics, 75, I1–I10, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx58"><?xmltex \def\ref@label{{Shmaryan and Journel(1999)}}?><label>Shmaryan and Journel(1999)</label><?label shmaryan1999two?><mixed-citation> Shmaryan, L. and Journel, A.: Two Markov models and their application, Math. Geol., 31, 965–988, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx59"><?xmltex \def\ref@label{{Solow(1986)}}?><label>Solow(1986)</label><?label solow1986mapping?><mixed-citation>Solow, A. R.: Mapping by simple indicator kriging, Math. Geol., 18, 335–352, 1986.
 </mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx60"><?xmltex \def\ref@label{{Strebelle(2002)}}?><label>Strebelle(2002)</label><?label strebelle2002conditional?><mixed-citation>
Strebelle, S.: Conditional simulation of complex geological structures using multiple-point statistics, Math. Geol., 34, 1–21, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx61"><?xmltex \def\ref@label{{Torrence(2019)}}?><label>Torrence(2019)</label><?label nsidc2019?><mixed-citation>Torrence, C.: DC Polar Stereographic Projection lon/lat conversion: polar_convert, <uri>https://github.com/nsidc/polarstereo-lonlat-convert-py/</uri> (last access: 1 March 2023), 2019.</mixed-citation></ref>
      <ref id="bib1.bibx62"><?xmltex \def\ref@label{{Van Rossum et al.(2001)}}?><label>Van Rossum et al.(2001)</label><?label van2001pep?><mixed-citation>Van Rossum, G., Warsaw, B., and Coghlan, N.: PEP 8–style guide for python code, Python.org, 1565, <uri>https://peps.python.org/pep-0008/</uri> (last access: 1 September 2022), 2001.</mixed-citation></ref>
      <ref id="bib1.bibx63"><?xmltex \def\ref@label{{Virtanen et al.(2020)}}?><label>Virtanen et al.(2020)</label><?label virtanen2020scipy?><mixed-citation>
Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J.,   van der Walt, S. J., Brett, M., Wilson, J., Jarrod Millman, K.,  Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., Carey, C. J., Polat, I.,
Feng, Y., Moore, E. W., VanderPlas,J., Laxalde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E. A., Harris, C. R., Archibald, A. M., Ribeiro, A. H., Pedregosa, F., van Mulbregt, P., and SciPy 1.0 Contributors: SciPy 1.0: fundamental algorithms for scientific computing in Python, Nat. Methods, 17, 261–272, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx64"><?xmltex \def\ref@label{{Volkova and Merkulov(2019)}}?><label>Volkova and Merkulov(2019)</label><?label volkova2019iterative?><mixed-citation>Volkova, A. and Merkulov, V.: Iterative Approach of Gravity and Magnetic Inversion through Geostatistics, in: Petroleum Geostatistics 2019, vol. 2019, European Association of Geoscientists &amp; Engineers, 1–5, <ext-link xlink:href="https://doi.org/10.3997/2214-4609.201902257" ext-link-type="DOI">10.3997/2214-4609.201902257</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx65"><?xmltex \def\ref@label{{Wernecke et al.(2022)}}?><label>Wernecke et al.(2022)</label><?label wernecke2022quantifying?><mixed-citation>Wernecke, A., Edwards, T. L., Holden, P. B., Edwards, N. R., and Cornford, S. L.: Quantifying the impact of bedrock topography uncertainty in Pine Island Glacier projections for this century, Geophys. Res. Lett., 49, e2021GL096589, <ext-link xlink:href="https://doi.org/10.1029/2021GL096589" ext-link-type="DOI">10.1029/2021GL096589</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx66"><?xmltex \def\ref@label{{Wilkinson et al.(2016)}}?><label>Wilkinson et al.(2016)</label><?label wilkinson2016fair?><mixed-citation>
Wilkinson, M. D., Dumontier, M., Aalbersberg, I. J., et al.: The FAIR Guiding Principles for scientific data management and stewardship, Scientific Data, 3, 1–9, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx67"><?xmltex \def\ref@label{{Xiong et al.(2015)}}?><label>Xiong et al.(2015)</label><?label xiong2015assessing?><mixed-citation>
Xiong, X., Grunwald, S., Myers, D. B., Kim, J., Harris, W. G., and Bliznyuk, N.: Assessing uncertainty in soil organic carbon modeling across a highly heterogeneous landscape, Geoderma, 251, 105–116, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx68"><?xmltex \def\ref@label{{Yin et al.(2022)Yin, Zuo, MacKie, and Caers}}?><label>Yin et al.(2022)Yin, Zuo, MacKie, and Caers</label><?label yin2022mapping?><mixed-citation>Yin, Z., Zuo, C., MacKie, E. J., and Caers, J.: Mapping high-resolution basal topography of West Antarctica from radar data using non-stationary multiple-point geostatistics (MPS-BedMappingV1), Geosci. Model Dev., 15, 1477–1497, <ext-link xlink:href="https://doi.org/10.5194/gmd-15-1477-2022" ext-link-type="DOI">10.5194/gmd-15-1477-2022</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx69"><?xmltex \def\ref@label{{Youngman and Stephenson(2016)}}?><label>Youngman and Stephenson(2016)</label><?label youngman2016geostatistical?><mixed-citation>Youngman, B. D. and Stephenson, D. B.: A geostatistical extreme-value framework for fast simulation of natural hazard events, P. Roy. Soc. A-Math. Phy., 472, 20150855, <ext-link xlink:href="https://doi.org/10.1098/rspa.2015.0855" ext-link-type="DOI">10.1098/rspa.2015.0855</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx70"><?xmltex \def\ref@label{{Zuo et al.(2020)Zuo, Yin, Pan, MacKie, and Caers}}?><label>Zuo et al.(2020)Zuo, Yin, Pan, MacKie, and Caers</label><?label zuo2020tree?><mixed-citation>Zuo, C., Yin, Z., Pan, Z., MacKie, E. J., and Caers, J.: A Tree-Based Direct Sampling Method for Stochastic Surface and Subsurface Hydrological Modeling, Water Resour. Res., 56, e2019WR026130, <ext-link xlink:href="https://doi.org/10.1029/2019WR026130" ext-link-type="DOI">10.1029/2019WR026130</ext-link>, 2020.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html><span style="" class="text typewriter">GStatSim</span> V1.0: a Python package for geostatistical interpolation and conditional simulation</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>Almeida and Journel(1994)</label><mixed-citation>
      
Almeida, A. S. and Journel, A. G.: Joint simulation of multiple variables with a Markov-type coregionalization model, Math. Geol., 26, 565–588, 1994.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Broomhead and Lowe(1988)</label><mixed-citation>
      
Broomhead, D. S. and Lowe, D.: Radial basis functions, multi-variable functional interpolation and adaptive networks, Tech. rep., Royal Signals and Radar Establishment Malvern, United Kingdom, 1988.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Carle(1999)</label><mixed-citation>
      
Carle, S. F.: T-PROGS: Transition probability geostatistical software, Version 2.1, Department of Land, Air and Water Resources, University of California, Davis, 1999.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Chiles and Delfiner(2009)</label><mixed-citation>
      
Chiles, J.-P. and Delfiner, P.: Geostatistics: modeling spatial uncertainty, Vol. 497, John Wiley &amp; Sons, <a href="https://doi.org/10.1007/s11004-012-9429-y" target="_blank">https://doi.org/10.1007/s11004-012-9429-y</a>, 2009.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Chu et al.(2021)Chu, Hilger, Culberg, Schroeder, Jordan, Seroussi, Young, Blankenship, and Vaughan</label><mixed-citation>
      
Chu, W., Hilger, A. M., Culberg, R., Schroeder, D. M., Jordan, T. M., Seroussi, H., Young, D. A., Blankenship, D. D., and Vaughan, D. G.: Multisystem synthesis of radar sounding observations of the Amundsen Sea sector from the 2004–2005 field season, J. Geophys. Res.-Earth, 126, e2021JF006296, <a href="https://doi.org/10.1029/2021JF006296" target="_blank">https://doi.org/10.1029/2021JF006296</a>, 2021.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Cockett et al.(2015)Cockett, Kang, Heagy, Pidlisecky, and Oldenburg</label><mixed-citation>
      
Cockett, R., Kang, S., Heagy, L. J., Pidlisecky, A., and Oldenburg, D. W.: SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications, Comput. Geosci., 85, 142–154, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Cooper et al.(2019)Cooper, Jordan, Schroeder, Siegert, Williams, and Bamber</label><mixed-citation>
      
Cooper, M. A., Jordan, T. M., Schroeder, D. M., Siegert, M. J., Williams, C. N., and Bamber, J. L.: Subglacial roughness of the Greenland Ice Sheet: relationship with contemporary ice velocity and geology, The Cryosphere, 13, 3093–3115, <a href="https://doi.org/10.5194/tc-13-3093-2019" target="_blank">https://doi.org/10.5194/tc-13-3093-2019</a>, 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Costa and Soares(2009)</label><mixed-citation>
      
Costa, A. C. and Soares, A.: Homogenization of climate data: review and new perspectives using geostatistics, Math. Geosci., 41, 291–305, 2009.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>CReSIS(2022)</label><mixed-citation>
      
CReSIS: CReSIS Radar Depth Sounder, Digital Media, <a href="http://data.cresis.ku.edu/" target="_blank"/> (last access: 1 August 2022), 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Cressie(1990)</label><mixed-citation>
      
Cressie, N.: The origins of kriging, Math. Geol., 22, 239–252, 1990.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Cressie and Hawkins(1980)</label><mixed-citation>
      
Cressie, N. and Hawkins, D. M.: Robust estimation of the variogram: I, J. Int. Ass. Math. Geol., 12, 115–125, 1980.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Daly et al.(2010)Daly, Quental, and Novak</label><mixed-citation>
      
Daly, C., Quental, S., and Novak, D.: A faster, more accurate Gaussian simulation, in: Proceedings of the Geocanada Conference, Calgary, AB, Canada, 10–14, <a href="https://www.searchanddiscovery.com/pdfz/abstracts/pdf/2014/90172cspg/abstracts/ndx_daly.pdf.html" target="_blank"/> (last access: 28 June 2023), 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Deutsch and Journel(1992)</label><mixed-citation>
      
Deutsch, C. V. and Journel, A. G.: Geostatistical software library and user's guide, Oxford University Press, 1–375, 1992.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Dimitrakopoulos and Luo(2004)</label><mixed-citation>
      
Dimitrakopoulos, R. and Luo, X.: Generalized sequential Gaussian simulation on group size <i>ν</i> and screen-effect approximations for large field simulations, Math. Geol., 36, 567–591, 2004.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Emery and Maleki(2019)</label><mixed-citation>
      
Emery, X. and Maleki, M.: Geostatistics in the presence of geological boundaries: Application to mineral resources modeling, Ore Geol. Rev., 114, 103124, <a href="https://doi.org/10.1016/j.oregeorev.2019.103124" target="_blank">https://doi.org/10.1016/j.oregeorev.2019.103124</a>, 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Feyen and Caers(2006)</label><mixed-citation>
      
Feyen, L. and Caers, J.: Quantifying geological uncertainty for flow and transport modeling in multi-modal heterogeneous formations, Adv. Water Resour., 29, 912–929, 2006.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Franke(1982)</label><mixed-citation>
      
Franke, R.: Scattered data interpolation: tests of some methods, Math. Comput., 38, 181–200, 1982.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>GMS(2021)</label><mixed-citation>
      
GMS: GMS 10.6 Editions &amp; Pricing, <a href="https://www.aquaveo.com/software/gms-pricing" target="_blank"/> (last access: 1 August 2022), 2021.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Goovaerts(1998)</label><mixed-citation>
      
Goovaerts, P.: Ordinary cokriging revisited, Math. Geol., 30, 21–42, 1998.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Goovaerts(1999)</label><mixed-citation>
      
Goovaerts, P.: Geostatistics in soil science: state-of-the-art and perspectives, Geoderma, 89, 1–45, 1999.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Gwinner et al.(2009)Gwinner, Scholten, Spiegel, Schmidt, Giese, Oberst, Heipke, Jaumann, and Neukum</label><mixed-citation>
      
Gwinner, K., Scholten, F., Spiegel, M., Schmidt, R., Giese, B., Oberst, J., Heipke, C., Jaumann, R., and Neukum, G.: Derivation and validation of high-resolution digital terrain models from Mars Express HRSC data, Photogramm. Eng. Rem. S., 75, 1127–1142, 2009.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Haas and Dubrule(1994)</label><mixed-citation>
      
Haas, A. and Dubrule, O.: Geostatistical inversion-a sequential method of stochastic reservoir modelling constrained by seismic data, First break, 12, <a href="https://doi.org/10.3997/1365-2397.1994034" target="_blank">https://doi.org/10.3997/1365-2397.1994034</a>, 1994.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Harris et al.(2020)</label><mixed-citation>
      
Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H., Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., Gérard-Marchant, P., Sheppard, K., Reddy, T., Weckesser, W., Abbasi, H., Gohlke, C., and Oliphant, T. E.: Array programming with NumPy, Nature, 585, 357–362, 2020.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Journel(1999)</label><mixed-citation>
      
Journel, A. G.: Markov models for cross-covariances, Math. Geol., 31, 955–964, 1999.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Journel and Huijbregts(1976)</label><mixed-citation>
      
Journel, A. G. and Huijbregts, C. J.: Mining geostatistics, Academic Press, 600 pp., ISBN-10:&thinsp;0123910501, 1976.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Journel and Rossi(1989)</label><mixed-citation>
      
Journel, A. G. and Rossi, M.: When do we need a trend model in kriging?, Math. Geol., 21, 715–739, 1989.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Kelkar and Perez(2002)</label><mixed-citation>
      
Kelkar, M. and Perez, G.: Applied geostatistics for reservoir characterization, Society of Petroleum Engineers, 274 pp., ISBN-10:&thinsp;1555630952, 2002.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Kitanidis(1997)</label><mixed-citation>
      
Kitanidis, P. K.: Introduction to geostatistics: applications in hydrogeology, Cambridge University Press, 272 pp., ISBN:&thinsp;9780521587471, 1997.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>Krige(1951)</label><mixed-citation>
      
Krige, D. G.: A statistical approach to some basic mine valuation problems on the Witwatersrand, J. S. Afr. I. Min. Metall., 52, 119–139, 1951.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Lark(2012)</label><mixed-citation>
      
Lark, R. M.: Towards soil geostatistics, Spat. Stat.-Neth., 1, 92–99, 2012.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Law et al.(2023)</label><mixed-citation>
      
Law, R., Christoffersen, P., MacKie, E., Cook, S., Haseloff, M., and Gagliardini, O.: Complex motion of Greenland Ice Sheet outlet glaciers with basal temperate ice, Science Advances, 9, eabq5180, <a href="https://doi.org/10.1126/sciadv.abq5180" target="_blank">https://doi.org/10.1126/sciadv.abq5180</a>, 2023.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>MacGregor et al.(2015)MacGregor, Fahnestock, Catania, Paden, Prasad Gogineni, Young, Rybarski, Mabrey, Wagman, and Morlighem</label><mixed-citation>
      
MacGregor, J. A., Fahnestock, M. A., Catania, G. A., Paden, J. D., Prasad Gogineni, S., Young, S. K., Rybarski, S. C., Mabrey, A. N., Wagman, B. M., and Morlighem, M.: Radiostratigraphy and age structure of the Greenland Ice Sheet, J. Geophys. Res.-Earth, 120, 212–241, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib33"><label>MacKie et al.(2020)</label><mixed-citation>
      
MacKie, E., Schroeder, D., Caers, J., Siegfried, M., and Scheidt, C.: Antarctic topographic realizations and geostatistical modeling used to map subglacial lakes, J. Geophys. Res.-Earth, 125, e2019JF005420, <a href="https://doi.org/10.1029/2019JF005420" target="_blank">https://doi.org/10.1029/2019JF005420</a>, 2020.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib34"><label>MacKie et al.(2022)</label><mixed-citation>
      
MacKie, E., Field, M., Wang, L., Yin, Z., Schoedl, N., and Hibbs, M.: GStatSim, Version 1.0, Zenodo [code], <a href="https://doi.org/10.5281/zenodo.7274640" target="_blank">https://doi.org/10.5281/zenodo.7274640</a>, 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib35"><label>MacKie et al.(2021)</label><mixed-citation>
      
MacKie, E. J., Schroeder, D. M., Zuo, C., Yin, Z., and Caers, J.: Stochastic modeling of subglacial topography exposes uncertainty in water routing at Jakobshavn Glacier, J. Glaciol., 67, 75–83, 2021.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib36"><label>Mälicke(2022)</label><mixed-citation>
      
Mälicke, M.: SciKit-GStat 1.0: a SciPy-flavored geostatistical variogram estimation toolbox written in Python, Geosci. Model Dev., 15, 2505–2532, <a href="https://doi.org/10.5194/gmd-15-2505-2022" target="_blank">https://doi.org/10.5194/gmd-15-2505-2022</a>, 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib37"><label>Mariethoz(2010)</label><mixed-citation>
      
Mariethoz, G.: A general parallelization strategy for random path based geostatistical simulation methods, Comput. Geosci., 36, 953–958, 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib38"><label>Matheron(1963)</label><mixed-citation>
      
Matheron, G.: Principles of geostatistics, Econ. Geol., 58, 1246–1266, 1963.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib39"><label>McKinney(2010)</label><mixed-citation>
      
McKinney, W.: Data structures for statistical computing in python, in: Proceedings of the 9th Python in Science Conference, Austin, TX, 445, 51–56, 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib40"><label>Müller et al.(2022)</label><mixed-citation>
      
Müller, S., Schüler, L., Zech, A., and Heße, F.: <span style="" class="text typewriter">GSTools</span> v1.3: a toolbox for geostatistical modelling in Python, Geosci. Model Dev., 15, 3161–3182, <a href="https://doi.org/10.5194/gmd-15-3161-2022" target="_blank">https://doi.org/10.5194/gmd-15-3161-2022</a>, 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib41"><label>Murphy(2014)</label><mixed-citation>
      
Murphy, B. S.: PyKrige: development of a kriging toolkit for Python, in: AGU fall meeting abstracts, San Francisco, December 2014, H51K-0753, <a href="https://geostat-framework.readthedocs.io/en/latest/" target="_blank"/> (last access: 29 June 2023), 2014.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib42"><label>Neven et al.(2021)Neven, Dall'Alba, Juda, Straubhaar, and Renard</label><mixed-citation>
      
Neven, A., Dall'Alba, V., Juda, P., Straubhaar, J., and Renard, P.: Ice volume and basal topography estimation using geostatistical methods and ground-penetrating radar measurements: application to the Tsanfleuron and Scex Rouge glaciers, Swiss Alps, The Cryosphere, 15, 5169–5186, <a href="https://doi.org/10.5194/tc-15-5169-2021" target="_blank">https://doi.org/10.5194/tc-15-5169-2021</a>, 2021.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib43"><label>Ng et al.(2018)Ng, Ignéczi, Sole, and Livingstone</label><mixed-citation>
      
Ng, F. S., Ignéczi, Á., Sole, A. J., and Livingstone, S. J.: Response of surface topography to basal variability along glacial flowlines, J. Geophys. Res.-Earth, 123, 2319–2340, 2018.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib44"><label>Nunes et al.(2012)Nunes, Soares, Schwedersky, Dillon, Guerreiro, Caetano, Maciel, and Leon</label><mixed-citation>
      
Nunes, R., Soares, A., Schwedersky, G., Dillon, L., Guerreiro, L., Caetano, H., Maciel, C., and Leon, F.: Geostatistical inversion of prestack seismic data, in: Ninth International Geostatistics Congress, Oslo, Norway, June, 2012, 1–8, <a href="http://geostats2012.nr.no/pdfs/1747134.pdf" target="_blank"/> (last access: 29 June 2023), 2012.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib45"><label>Nussbaumer et al.(2018)Nussbaumer, Mariethoz, Gravey, Gloaguen, and Holliger</label><mixed-citation>
      
Nussbaumer, R., Mariethoz, G., Gravey, M., Gloaguen, E., and Holliger, K.: Accelerating sequential gaussian simulation with a constant path, Comput. Geosci., 112, 121–132, 2018.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib46"><label>Oh and Kwon(2001)</label><mixed-citation>
      
Oh, S.-H. and Kwon, B.-D.: Geostatistical approach to Bayesian inversion of geophysical data: Markov chain Monte Carlo method, Earth Planets Space, 53, 777–791, 2001.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib47"><label>Parizek et al.(2013)</label><mixed-citation>
      
Parizek, B., Christianson, K., Anandakrishnan, S., Alley, R., Walker, R., Edwards, R., Wolfe, D., Bertini, G., Rinehart, S., Bindschadler, R., and Nowicki, S. M. J.: Dynamic (in) stability of Thwaites Glacier, West  Antarctica, J. Geophys. Res.-Earth, 118, 638–655, 2013.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib48"><label>Pebesma(2004)</label><mixed-citation>
      
Pebesma, E. J.: Multivariable geostatistics in S: the gstat package, Comput. Geosci., 30, 683–691, 2004.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib49"><label>Pedregosa et al.(2011)Pedregosa, Varoquaux, Gramfort, Michel, Thirion, Grisel, Blondel, Prettenhofer, Weiss, Dubourg, Vanderplas, Passos, Cournapeau, Brucher, Perrot, and Duchesnay</label><mixed-citation>
      
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E.: Scikit-learn: Machine Learning in Python, J. Mach. Learn. Res., 12, 2825–2830, 2011.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib50"><label>Porter et al.(2018)</label><mixed-citation>
      
Porter, C., Morin, P., Howat, I., Noh, M.-J., Bates, B., Peterman, K., Keesey, S., Schlenk, M., Gardiner, J., Tomko, K., Willis, M., Kelleher, C., Cloutier, M., Husby, E., Foga, S., Nakamura, H., Platson, M., Wethington Jr., M., Williamson, C., Bauer, G., Enos, J., Arnold, G., Kramer, W., Becker, P., Doshi, A., D'Souza, C., Cummens, P., Laurier, F., and Bojesen, M.: ArcticDEM, Version 3, Harvard Dataverse [data set], <a href="https://doi.org/10.7910/DVN/OHHUKH" target="_blank">https://doi.org/10.7910/DVN/OHHUKH</a>,  2018.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib51"><label>Pyrcz et al.(2021)Pyrcz, Jo, Kupenko, Liu, Gigliotti, Salomaki, and Santos</label><mixed-citation>
      
Pyrcz, M., Jo, H., Kupenko, A., Liu, W., Gigliotti, A., Salomaki, T., and Santos, J.: GeostatsPy, <a href="https://github.com/GeostatsGuy/GeostatsPy" target="_blank"/> (last access: 1 June 2022), 2021.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib52"><label>Pyrcz and Deutsch(2014)</label><mixed-citation>
      
Pyrcz, M. J. and Deutsch, C. V.: Geostatistical reservoir modeling, Oxford University Press, 384 pp., ISBN:&thinsp;978-0199731442, 2014.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib53"><label>Remy(2005)</label><mixed-citation>
      
Remy, N.: S-GeMS: the stanford geostatistical modeling software: a tool for new algorithms development, in: Geostatistics Banff 2004, edited by: Leuangthong, O. and Deutsch, C. V., Springer, 865–871, <a href="https://doi.org/10.1007/978-1-4020-3610-1_89" target="_blank">https://doi.org/10.1007/978-1-4020-3610-1_89</a>, 2005.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib54"><label>Remy et al.(2009)</label><mixed-citation>
      
Remy, N., Boucher, A., and Wu, J.: Applied geostatistics with SGeMS: A user's guide, Cambridge University Press, <a href="https://doi.org/10.1017/CBO9781139150019" target="_blank">https://doi.org/10.1017/CBO9781139150019</a>, 2009.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib55"><label>Sarra and Kansa(2009)</label><mixed-citation>
      
Sarra, S. A. and Kansa, E. J.: Multiquadric radial basis function approximation methods for the numerical solution of partial differential equations, Advances in Computational Mechanics, 2, 220 pp., 2009.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib56"><label>Seroussi et al.(2017)Seroussi, Nakayama, Larour, Menemenlis, Morlighem, Rignot, and Khazendar</label><mixed-citation>
      
Seroussi, H., Nakayama, Y., Larour, E., Menemenlis, D., Morlighem, M., Rignot, E., and Khazendar, A.: Continued retreat of Thwaites Glacier, West Antarctica, controlled by bed topography and ocean circulation, Geophys. Res. Lett., 44, 6191–6199, 2017.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib57"><label>Shamsipour et al.(2010)Shamsipour, Marcotte, Chouteau, and Keating</label><mixed-citation>
      
Shamsipour, P., Marcotte, D., Chouteau, M., and Keating, P.: 3D stochastic inversion of gravity data using cokriging and cosimulation, Geophysics, 75, I1–I10, 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib58"><label>Shmaryan and Journel(1999)</label><mixed-citation>
       Shmaryan, L. and Journel, A.: Two Markov models and their application, Math. Geol., 31, 965–988, 1999.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib59"><label>Solow(1986)</label><mixed-citation>
      
Solow, A. R.: Mapping by simple indicator kriging, Math. Geol., 18, 335–352, 1986.


    </mixed-citation></ref-html>
<ref-html id="bib1.bib60"><label>Strebelle(2002)</label><mixed-citation>
      
Strebelle, S.: Conditional simulation of complex geological structures using multiple-point statistics, Math. Geol., 34, 1–21, 2002.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib61"><label>Torrence(2019)</label><mixed-citation>
      
Torrence, C.: DC Polar Stereographic Projection lon/lat conversion: polar_convert, <a href="https://github.com/nsidc/polarstereo-lonlat-convert-py/" target="_blank"/> (last access: 1 March 2023), 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib62"><label>Van Rossum et al.(2001)</label><mixed-citation>
      
Van Rossum, G., Warsaw, B., and Coghlan, N.: PEP 8–style guide for python code, Python.org, 1565, <a href="https://peps.python.org/pep-0008/" target="_blank"/> (last access: 1 September 2022), 2001.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib63"><label>Virtanen et al.(2020)</label><mixed-citation>
      
Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J.,   van der Walt, S. J., Brett, M., Wilson, J., Jarrod Millman, K.,  Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., Carey, C. J., Polat, I.,
Feng, Y., Moore, E. W., VanderPlas,J., Laxalde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E. A., Harris, C. R., Archibald, A. M., Ribeiro, A. H., Pedregosa, F., van Mulbregt, P., and SciPy 1.0 Contributors: SciPy 1.0: fundamental algorithms for scientific computing in Python, Nat. Methods, 17, 261–272, 2020.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib64"><label>Volkova and Merkulov(2019)</label><mixed-citation>
      
Volkova, A. and Merkulov, V.: Iterative Approach of Gravity and Magnetic Inversion through Geostatistics, in: Petroleum Geostatistics 2019, vol. 2019, European Association of Geoscientists &amp; Engineers, 1–5, <a href="https://doi.org/10.3997/2214-4609.201902257" target="_blank">https://doi.org/10.3997/2214-4609.201902257</a>, 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib65"><label>Wernecke et al.(2022)</label><mixed-citation>
      
Wernecke, A., Edwards, T. L., Holden, P. B., Edwards, N. R., and Cornford, S. L.: Quantifying the impact of bedrock topography uncertainty in Pine Island Glacier projections for this century, Geophys. Res. Lett., 49, e2021GL096589, <a href="https://doi.org/10.1029/2021GL096589" target="_blank">https://doi.org/10.1029/2021GL096589</a>, 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib66"><label>Wilkinson et al.(2016)</label><mixed-citation>
      
Wilkinson, M. D., Dumontier, M., Aalbersberg, I. J., et al.: The FAIR Guiding Principles for scientific data management and stewardship, Scientific Data, 3, 1–9, 2016.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib67"><label>Xiong et al.(2015)</label><mixed-citation>
      
Xiong, X., Grunwald, S., Myers, D. B., Kim, J., Harris, W. G., and Bliznyuk, N.: Assessing uncertainty in soil organic carbon modeling across a highly heterogeneous landscape, Geoderma, 251, 105–116, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib68"><label>Yin et al.(2022)Yin, Zuo, MacKie, and Caers</label><mixed-citation>
      
Yin, Z., Zuo, C., MacKie, E. J., and Caers, J.: Mapping high-resolution basal topography of West Antarctica from radar data using non-stationary multiple-point geostatistics (MPS-BedMappingV1), Geosci. Model Dev., 15, 1477–1497, <a href="https://doi.org/10.5194/gmd-15-1477-2022" target="_blank">https://doi.org/10.5194/gmd-15-1477-2022</a>, 2022.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib69"><label>Youngman and Stephenson(2016)</label><mixed-citation>
      
Youngman, B. D. and Stephenson, D. B.: A geostatistical extreme-value framework for fast simulation of natural hazard events, P. Roy. Soc. A-Math. Phy., 472, 20150855, <a href="https://doi.org/10.1098/rspa.2015.0855" target="_blank">https://doi.org/10.1098/rspa.2015.0855</a>, 2016.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib70"><label>Zuo et al.(2020)Zuo, Yin, Pan, MacKie, and Caers</label><mixed-citation>
      
Zuo, C., Yin, Z., Pan, Z., MacKie, E. J., and Caers, J.: A Tree-Based Direct Sampling Method for Stochastic Surface and Subsurface Hydrological Modeling, Water Resour. Res., 56, e2019WR026130, <a href="https://doi.org/10.1029/2019WR026130" target="_blank">https://doi.org/10.1029/2019WR026130</a>, 2020.

    </mixed-citation></ref-html>--></article>
