<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Nearest Neighbour-Based Data Augmentation for Time Series Forecasting</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Duncan Wallace</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eoin Delaney</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mark T. Keane</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Derek Greene</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Insight Centre for Data Analytics, University College Dublin</institution>
          ,
          <country country="IE">Ireland</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>School of Computer Science, University College Dublin</institution>
          ,
          <country country="IE">Ireland</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>VistaMilk SFI Research Centre, University College Dublin</institution>
          ,
          <country country="IE">Ireland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Accurate forecasting in many industries, such as dairy production, is a key challenge to improve investment decisions, market planning, energy use, and environmental protection. As most real-world phenomena take place over time, many prediction tasks involve the use of time series or collections thereof. In this study, we propose a nearestneighbour data augmentation approach which draws on information from a set of related time series. Given an input series, we identify other series which have similar pro les using a k-nearest neighbour approach, and use their data to augment the input series. This has the e ect of both smoothing outlying observations and lling missing observations. We show that, by combining this method with a criterion to re ne the cases for which augmentation is to be applied, overall forecasting accuracy can be improved. Our approach is evaluated on diverse real-world time series data from a number of di erent domains.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Time series data has attracted a signi cant research e ort in recent years,
perhaps because of its centrality in accurate forecasting in a variety industry
settings, from nancial services to smart agriculture. Many di erent approaches to
time series prediction have been proposed, along with di erent methods for data
pre-processing and augmentation [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. However, the reliability of real-world time
series forecasting is often impacted by the presence of noise, incomplete data,
and outliers [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. In our work on developing precision-agriculture applications {
on dairy production forecasting { we have encountered all of these problems. For
instance, dairy production forecasting is based upon data that is in uenced by
external factors such as weather, calving rates and disease. This data is also
subject to missing values arising from discrepancies in milk-collection practices and
technical implementation di culties [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Thus, methods to address these issues
and thereby improve forecasting robustness constitute important undertakings.
      </p>
      <p>
        One technique to enhance the performance of time series forecasting is the
application of a k-nearest neighbours (k-NN) approach, which is typically
applied to reduce noise and the impact of outliers on training sets. The use of k-NN
can additionally improve training set quality when the volume of observations
Copyright 2021 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0)
is limited. Recent research has, to the best of our knowledge, used perturbed
examples of existing observations to generate neighbours for the application of
this approach, as opposed to using real-world occurrences [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref5">5</xref>
        ][
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. However, in
the context of time series analysis, for many applications we might have multiple
distinct series, each corresponding to a di erent entity. For instance, in the
context of milk production, we might have a large collection of series, each of which
represents data for a di erent farm associated with the same dairy processor.
      </p>
      <p>
        To harness this additional information provided for a collection of entities,
we propose using an approach motivated by k-NN regression, which attempts
to make a prediction for a continuous target by averaging cases in the same
neighbourhood. In our case, we generate a forecast for a given input series by
incorporating information coming from an aggregated set of forecasts generated
for neighbouring entities. Speci cally, we apply this approach using the popular
Prophet forecasting algorithm [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] to explore its potential e ectiveness in data
smoothing, and to a lesser extent data interpolation. We perform a detailed
evaluation using ve real-world datasets from four di erent application domains.
      </p>
      <p>Our analysis considers the importance of both the neighbourhood size k and the
volume of available data. Our ndings presented in Section 4 indicate that not
all data is suited to this augmentation approach. Therefore, we also provide a
means to pro le entities, using a validation window, to ensure that augmentation
is applied to instances more suited its application. Using a combination of k-NN
regression and this ltering criterion, we observe improved accuracy across all
datasets, when compared to baseline forecasts produced by Prophet alone.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        The standard de nition of time series forecasting assumes the existence of a set
of time-ordered observations of a variable Y , denoted y1; y2; : : : yt, where yi is
the value of Y measured at time i, and de nes the predictive task as trying to
forecast the future values of this variable for time stamps s &gt; t. Many variants of
this general task exist, including the use of other measured variables as potential
predictors of the future values of the target series Y . Still, the general assumption
is that there is an unknown function that \maps" past observations to future
values of Y . The learning goal is to approximate a function using some prediction
error criterion and a historical record of observed values. The predictors used
for forecasting the future values of Y are usually the most recent observations of
Y , as the basic assumption of time series forecasting is that of the existence of
some form of correlation between successive observations of the series. This is the
methodology employed in most approaches to time series forecasting, including
the well-known ARIMA models [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. This strategy assumes that future values of
the series are only dependent on a limited number of previous values.
      </p>
      <p>
        High-dimensional multivariate data can sometimes produce superior
forecasting results to those achieved using linear time series. For instance, in the
context of single-farm prediction of milk production, the most successful models
are the surface tting model and the NARX (Nonlinear autoregressive model
with exogenous inputs (RMSE 75.5kg, 365 day horizon)) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], using features such
as Days-In-Milk (i.e., how many days a cow has been lactating) and the NCM
(number of cows milked) in the herd. In this same farming context some studies
have used as many as twelve features including genetics, feed and grazing
management information of the individual cows. However, such high-resolution data
is not readily available for most commercial farms. Consequently, multivariate
time series forecasting will typically require domain speci c approaches, and may
exhibit scalability issues.
      </p>
      <p>
        One popular time series forecasting procedure is Prophet [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], which is based
on an additive regression model that includes a seasonal component and a
piecewise linear or logistic growth curve trend. The platform includes seasonality
e ects for non-linear data and automatically detects changes in trends by
selecting change points from the data. To this end it has had proven applicability in
relation to large scale forecasting requirements and has outperformed ARIMA
in a range of di erent tasks, including predicting COVID-19 cases numbers [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]
and making long-range predictions in the context of animal disease spread [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>
        The k-nearest neighbour algorithm is a well-known non-parametric method
used for classi cation and regression. It has been labelled as a lazy learner as
the algorithm does not learn a discriminative function, but rather stores the
instances for later use. Given some features or explanatory variables of a new
instance to be regressed on, k-NN nds the k training instances that are closest
to the new instance according to some distance metric.In the context of time
series data, k-NN has been employed in a range of disparate ways. For instance,
its use can be witnessed in local prediction: by breaking down domains into
local neighbourhoods and tting to each neighbourhood separately. This type
of methodology can be found in bootstrapping as far back as Jayawardena and
Lai [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], or more recent variants such as that found in Wu at al.'s paper
concerning support vector regression, where the weighted averaging of k neighbours
is adopted and the weight function made proportional to the inverse of square
Euclidean distances between Y (t) and Y (t0) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In particular, many papers
speci cally consider time series nearest neighbours from a position of a lack of
extant real-world neighbours within their datasets. As noted by Mart nez et al.,
there has been limited application of k-NN regression to time series forecasting
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This may be speci cally exacerbated by a dearth of datasets in some
domains that provide collections of related time series for k-NN to be performed
upon. However, later in Section 3.2, we highlight a number of domains where
collections of related series are readily available.
3
3.1
      </p>
    </sec>
    <sec id="sec-3">
      <title>Methods and Materials</title>
      <sec id="sec-3-1">
        <title>Proposed Method</title>
        <p>
          A variety of techniques have been proposed for manipulating time series
representations to improve the outputs of downstream tasks. While data
augmentation has largely been used to generate additional training data in the context
of image datasets, Oh et al. [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] considered producing additional time series for
classi cation, using an interpolation-based approach. In the context of time
series forecasting, a more common approach for producing robust estimates has
been to construct ensembles of multiple models [
          <xref ref-type="bibr" rid="ref13 ref14">13, 14</xref>
          ]. Such approaches can
either be used to improve the performance of a group of models, or reduce the
likelihood of an unfortunate selection of a poor model. A feature of many
realworld data sources is the presence of both noise and missing values. Therefore,
we employ two di erent augmentation methodologies to improve predictive
performance in such an environment. We use the k-NN algorithm in the form of
data augmentation of data series to reduce noise and erratic values, while k-NN
for data interpolation is also performed to ll in missing values for a given series.
Data augmentation. Given a collection of related time series fT1; : : : ; Tng,
representing n di erent entities, we produce a forecast for an individual series
Ti as follows. Firstly, we identify its k nearest neighbouring entities using
unweighted Euclidean distance over time series of equal length. Next, we produce
an augmented time series for each entity that comprises the arithmetic mean
of observances, or interpolated instance in the event of a missing value. The
arithmetic mean of time series was chosen as augmentation method as the
uctuations between the real world datasets chosen (such as meteorological or dairy
production) were on a linear rather than logarithmic scale. The resulting
augmented series Ti0 was then used as the input data for a standard forecasting
model. In our case, we employ Prophet, which has, to be best of our knowledge,
never been tested with k-NN augmentation.
        </p>
        <p>Selection criteria. Early experimentation indicated that data augmentation
was not universally appropriate for every entity in a dataset. Consequently, we
have developed an approach for ltering out entities that are less suited to
augmentation. These might correspond to entities for which forecasting accuracy is
already high, or outliers for which relevant neighbouring cases are unavailable.
We can consider the time-series to be composed of distinct windows, with the
term `window' referring to a slice of the time series (which in the given datasets
corresponds with a single year). Using a single window of the data as a validation
set, we apply augmentation for a range of values of k, followed by the
forecasting model in each case. We can then determine whether applying k-NN resulted
in any positive change in forecasting performance (e.g., as measured by mean
absolute error (MAE)), and, if it did, what value of k produced the best result.
If no value of k produced a positive change then the entity is ltered from the
augmentation process. We refer to the entities for which augmentation is applied
as \contested", and those for which it is not applied as \uncontested".4 However,
if the approach produced a positive result when using only one value of k, an
4 Given that we are interested in the e ectiveness of both the ltering technique,
and data augmentation, we consequently adopt this terminology to add clarity and
distinguish between the original results that form our baselines, which are entirely
unaugmented, and the test results which consist of both augmented and
unaugmented cases.
Select and clean</p>
        <p>data
Calculation
of k nearest
neighbours</p>
        <p>Produce
augmented time
seires using each
value of n</p>
        <p>Did
augmentation
improve validation
set forecast?
NO</p>
        <p>YES</p>
        <p>Overal evaluation
Filter from
augmentation
process
Would
augmentation
haveimproved
subsequent
forecasts?
missing value
apply interpolation
viaclosest
neighbour</p>
        <p>Apply
augmentation
using most
successful value</p>
        <p>of n
Did forecast
accuracy
improve?
NO</p>
        <p>YES</p>
        <p>NO
'uc_loss' result
'uc_won' result
'loss' result</p>
        <p>YES
'won' result
additional check was performed to see if the di erence in MAE for this entity's
validation window was above average (across all entities for the validation
window). If this happened to be the case, then such entities were also discarded for
use with the proposed approach. A comparison between entities which were and
were not selected using this basis will be provided in Section 4.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Datasets</title>
        <p>We now discuss ve di erent datasets from domains where collections of related
entities, represented as time series, naturally occur. We chose a diverse range of
domains in order to prove the applicability of our approach. With the exception
of the socioeconomic dataset, each of these domains is represented as univariate
time series (while the lattermost, for the purposes of this research, is split into
two separate univariate datasets).</p>
        <p>
          Agricultural data. Our rst dataset concerns milk production from 400 farms
in Ireland for one dairy processor, as measured across four consecutive years. This
will be referred to as the `dairy' dataset in our experiments. Cases describe daily
readings for the volume of milk collected on each farm. Each farm constitutes a
separate entity and the predicted variable is the volume of milk collected from
each entity. In any given year, milk supply forecasting is a fundamental driver for
the dairy sector. Dairy processors use their forecasts to establish pricing levels,
contracts with supplier farms, and the production requirements for their
factories. Forecasting consequently strongly in uences farm management (the
prevention of under or over production, and also the manner of production adopted),
the consumption of resources in the sector (e.g. fertiliser use, tanker-transport
use for milk collections), and the processing e ciency of factories (avoiding waste
from surplus milk supplies). Processors can drive sustainability changes through
accurate and precise forecasting. However, such forecasting is highly challenging
for many reasons: the forecast must be made over 1000s of farms which di er in
their herd-pro les; the land farmed and farm-management practices is for the
full year in advance, not incrementally as the year unfolds; and planning can
encounter disruption from climate-change and disease outbreaks.
Meteorological data. The second dataset used here, involves the monthly
average temperatures, recorded in degrees Fahrenheit, of 18 major cities from
regions spread across the world, dating from the years 2000 and 2013. This
corresponds to a subset of the Berkeley Earth climate change dataset [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]. This
publicly available data, referred to as the `weather' dataset in our experiments,
concerns locations ranging from a latitude of 59.33 North to 37.78 South [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
With values of southern latitudes considered negative, the mean latitude was
24.06 with a standard deviation of 39.3. Entities in this dataset represent
individual cities, and the forecast variable is the monthly mean temperature of the
given entity, over a window of a particular year. This type of mid- to long-range
meteorological forecasting based upon temperature is very important for many
economic sectors While the time-scale used in the course of this research was
too small for longer climate-trend observation, improved methods to towards
this end also have a bearing on the analysis of wider climate change modelling.
Socioeconomic data. The third dataset relates to the Local Area
Unemployment Statistics (LAUS) program of the Bureau of Labor Statistics (BLS) of the
United States. This consists of monthly estimates of civilian non-institutional
population, labour force participation rates, and employment-population ratios
for the 50 states and the District of Columbia from January 1976 onwards. Two
separate datasets for this exist: one which is seasonally-adjusted (excluding
civilian non-institutional population ages 16 and older) and one which is not (raw
number of unemployed). These two datasets will be referred to as `employment
adj' and `employment' respectively within tables. The seasonally-adjusted
gures are determined by the BLS using the seasonal components of the LAUS
labour force. For our purposes we used a subset of both these data, representing
a range of 13 years, from which we obtained both our training and testing sets
[
          <xref ref-type="bibr" rid="ref17">17</xref>
          ]. These two datasets consider states to be individual entities with the
forecast variable being the number of unemployed people within each state (which,
depending on the dataset, may have been seasonally adjusted). Forecasting of
unemployment gures (particularly non-seasonal) is di cult due to the large
number of external factors that have a bearing on these numbers. Sudden
increases in non-seasonal unemployment often represent economic shocks triggered
by unpredictable macroeconomic events. Being able to accurately forecast
unemployment numbers therefore has a bearing on the capacity to predict recessions
and larger economic cycles.
        </p>
        <p>
          Energy data. The fth and nal dataset considered relates to the Natural Gas
Gross Withdrawals and Production, measured in monthly million cubic feet per
day, as compiled by the U.S. Energy Information Administration (EIA) [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]. This
encompasses 18 separate entities (16 US states, the Federal O shore production
in the gulf of Mexico, and a conglomeration of all other US territories). This
dataset will be referred to as `gas' in our experimental results. The forecast
variable relates to the gross withdrawal amount. Despite being subject to arguably
fewer external factors than some of the earlier discussed datasets, accurate
forecasting of gas production is nevertheless very problematic. Gas production is not
entirely insulated from economic processes, and is dependent on a resource the
volume of which is often di cult to estimate and whose extraction is non-trivial.
Political policy may also have a signi cant bearing on production levels
(particularly in recent years on the subject of fracking). All of these aspects contribute
to signi cant issues when attempting to provide accurate forecasts.
4
4.1
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Experimental Evaluations</title>
      <sec id="sec-4-1">
        <title>Method</title>
        <p>Measures. Using the datasets described earlier we evaluated our proposed
method using several measures. The principle measure used was the mean
absolute error (MAE), in which a lower gure indicates a better performance.
The baseline method in the experiments is the non-augmented Prophet forecast
model applied to a single query time series.</p>
        <p>Setup. For the purposes of our experiments, the rst three windows in each
dataset were used as training data, the next window as a validation set, and the
subsequent windows as test data (the latter of which is used for Tables 3-4). For
each window of the test data, we have a predicted and actual value. Forecasts
were generated for each entity to provide a base rate and then further forecasts
generated using training data composed as as an arithmetic mean for a range of
neighbours. The base rate in these evaluations was the non-augmented predicted
value provided by Prophet. The window of observations and predictions was then
advanced by one period, with the length of a period being equal to a calendar
year. The process was then repeated again ab initio, until the methodology was
run over the full length of the respective dataset.</p>
        <p>A potential limitation when using Euclidean distance as a metric to measure
time series similarity is that when large absolute distances exist between di erent
time series, it becomes harder to identify time series with similar trends and
seasonality. In order to deal with this issue, we applied a normalisation in which
the time series being compared were scaled, in proportion to the ratio of means.
Missing data can also be an issue for forecasting in real-world datasets. While a
potential solution to this can be to ll a missing value with the preceding day's
value, in our method we instead replace the missing value with a mean of the
values of k-nearest entities (i.e., interpolation).</p>
        <p>Prophet has no native means to handle multiple entities' time-series-data for
tting an individual entity's time series forecast, so our proposed approach is
consequently applied prior to the provision of data to the model. Prophet allows
the use of a custom list of holidays and seasonalities in the model. However, the
use of holidays as a parameter is only appropriate for time series whose values are
discredited to days as opposed to months or years. As only one of our datasets
contained daily data (the agricultural dataset), and the importance of holidays
in this context was unclear, we do not utilise this functionality in our forecasts.
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Results and Discussion</title>
        <p>Number of neighbours. In our experiments, we consider augmentation using
k 2 [1; 5] neighbours. As outlined in Section 3.1, the validation window was
used to establish whether or not the baseline forecasts would be \contested"
using the data augmented via the proposed k-NN approach (i.e., whether or not
additional neighbours should be used). However, the validation window is also
used to establish what value of k should be used to this end. A frequency count
of the value of k which produced the best result within the validation window
was performed for all entities which passed the selection criterion. The results
of this for each dataset can be viewed in Table 2. When the number of entities
to provide this summation of k values was at least double the range of k values
available (i.e., a clear majority), a global value of k was used for all further
forecasts for that dataset (otherwise a local value of k was used).</p>
        <p>Table 3 shows the di erence in performance between these forecasts when
the uncontested baseline forecasts are used, versus when the selection criteria
determines that the augmentation approach should be used. In the table, uc lost
and uc won refer to the uncontested cases which have not been augmented, and
whether or not the proposed approach would have produced superior or inferior</p>
        <p>Dataset
results had it been used. These results relate to the test data of all chosen entities,
where the maximum value is the number of windows multiplied by the number
of entities for a given dataset. Where the augmentation approach is adopted we
can also see, for a given forecast, whether or not the change has resulted in an
increase or decrease in accuracy (i.e., won and lost respectively).</p>
        <p>Table 3 reveals considerable di erences between datasets. For instance, the
dairy dataset would have seen overall more forecasts improve than deteriorate
through k-NN without augmentation applied to its data, but the weather dataset
would have seen two thirds of its non-augmented forecasts obtain worse results
than that of the baseline. Overall, the proposed selection criteria appears to
have achieved a reliable basis for excluding many of the forecasts less suited to
an augmentation approach. Indeed, only one dataset (employment adj.) shows
more cases chosen by the selection criteria su ering from reduced accuracy than
the number of those bene ting.</p>
        <p>Moving beyond a simple count of wins and losses to the overall magnitude of
these changes (Table 4), again we observe that uncontested forecasts, which fail
the selection criteria, in general would have seen a performance decrease with
the application of k-NN. Overall, we can see that there is not a single dataset in
which the overall MAE declines for the selected forecasts. An overall summary
of this information is given in Table 5. We report both the average MAE and the
average reduction in error across entities that conform to the selection criteria.</p>
        <p>If we look at a single sample entity in Fig. 2 that quali es for the application
of the augmentation approach in the weather dataset (speci cally depicting
Warsaw, with y-axis representing MAE value), we can see the approach's accuracy
relative to both the baseline Prophet MAE and the hypothetical performance
using di erent values of k. Using the validation window corresponding to 2001,
all values of k showed improvement over the baseline Prophet forecast, and as
the weather dataset applies a local rather than universal value for k on the test
set, the value of k that performed best in this instance was chosen (k = 5).
While the forecasting performance for all values of k broadly match the peaks
and troughs of the baseline, signi cant improvement can be seen across the
different windows. In this case the nearest neighbours which combine to provide the
augmentation training data for MAE5 are, in ascending order: Wroclaw, Kiev,
Kherson, Stockholm, and Uppsala.</p>
        <p>Fig. 3 shows augmentation performance for a single farm from the dairy
dataset where x axis represents time, and y axis represents volume of milk
produced in litres. In the plot we can see how close the di erent augmentation
approaches (y^1-y^5), as well as the baseline Prophet forecasting (y^) come to
predicting the actual production values (y) for this window. As the dairy dataset
utilised a global value of k, y^5 was the model chosen for all entities that were
selected for augmentation. Notably, not all values of k in this instance achieve
improved results over the baseline, with both y^1 and y^2 being generally inferior
to the baseline. However, y^5 provides a good match for the actual production
values of this farm.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions and Future Work</title>
      <p>Despite the strong performance of the baseline Prophet algorithm, our ndings
indicate that potential improvements can be made with an aggregation approach
to the training data using a k-NN methodology, in situations where we have
multiple related entities represented as time series. Our results indicate that, while
this has demonstrable bene t, it is by no means universally successful.
Nevertheless, there is clear promise o ered by using di erent time series with similar
pro les, in domains where forecasting is challenging due to noisy or missing data.</p>
      <p>Although this work has established the potential use of this methodology,
questions remain concerning the potential use of di erent distance metrics for
the measurement of neighbours, and whether the use of additional validation
windows could provide su cient data to adapt a more precise aggregation
technique. While the various datasets explored provided a diverse ranges of entities,
it was beyond the scope of this research to establish how many entities are
required for this methodology to be e ective. Furthermore, we intend to extend
this research by considering how k-NN in this context can ultimately aid in
providing use explanations of forecasting outputs to end users.</p>
      <p>Acknowledgements. This publication has emanated from research conducted
with the nancial support of (i) SFI and the Department of Agriculture, Food
and Marine on behalf of the Government of Ireland to the VistaMilk Research
Centre under Grant Number 16/RC/3835, and (ii) SFI to the Insight Centre for
Data Analytics under Grant Number 12/RC/2289 P2.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Ganapathy</given-names>
            <surname>Mahalakshmi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S</given-names>
            <surname>Sridevi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Shyamsundar</given-names>
            <surname>Rajaram</surname>
          </string-name>
          .
          <article-title>A survey on forecasting of time series data</article-title>
          .
          <source>In Proc. ICCTIDE'16</source>
          , pages
          <fpage>1</fpage>
          <article-title>{8</article-title>
          . IEEE,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Chris</surname>
          </string-name>
          <article-title>Chat eld. Time-series forecasting</article-title>
          . CRC Press,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Nicolas</given-names>
            <surname>Urruty</surname>
          </string-name>
          , Delphine Tailliez-Lefebvre, and
          <string-name>
            <given-names>Christian</given-names>
            <surname>Huyghe</surname>
          </string-name>
          .
          <article-title>Stability, robustness, vulnerability and resilience of agricultural systems. a review</article-title>
          .
          <source>Agronomy for sustainable development</source>
          ,
          <volume>36</volume>
          (
          <issue>1</issue>
          ):
          <fpage>15</fpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>K.W.</given-names>
            <surname>Lau</surname>
          </string-name>
          and
          <string-name>
            <given-names>Q.H.</given-names>
            <surname>Wu</surname>
          </string-name>
          .
          <article-title>Local prediction of non-linear time series using support vector regression</article-title>
          .
          <source>Pattern Recognition</source>
          ,
          <volume>41</volume>
          (
          <issue>5</issue>
          ):
          <volume>1539</volume>
          {
          <fpage>1547</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>AW</given-names>
            <surname>Jayawardena</surname>
          </string-name>
          and
          <string-name>
            <given-names>Feizhou</given-names>
            <surname>Lai</surname>
          </string-name>
          .
          <article-title>Analysis and prediction of chaos in rainfall and stream ow time series</article-title>
          .
          <source>Journal of hydrology</source>
          ,
          <volume>153</volume>
          (
          <issue>1-4</issue>
          ):
          <volume>23</volume>
          {
          <fpage>52</fpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Francisco Mart nez,
          <article-title>Mar a Pilar Fr as, Mar a Dolores Perez, and Antonio Jesus Rivera. A methodology for applying k-nearest neighbor to time series forecasting</article-title>
          .
          <source>Arti cial Intelligence Review</source>
          ,
          <volume>52</volume>
          (
          <issue>3</issue>
          ),
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Sean</surname>
          </string-name>
          J Taylor and Benjamin Letham. Forecasting at scale.
          <source>The American Statistician</source>
          ,
          <volume>72</volume>
          (
          <issue>1</issue>
          ):
          <volume>37</volume>
          {
          <fpage>45</fpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Ana</given-names>
            <surname>Maria Bianco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M Garcia</given-names>
            <surname>Ben</surname>
          </string-name>
          , EJ Martinez,
          <article-title>and V ctor J Yohai. Outlier detection in regression models with ARIMA errors using robust estimates</article-title>
          .
          <source>Journal of Forecasting</source>
          ,
          <volume>20</volume>
          (
          <issue>8</issue>
          ):
          <volume>565</volume>
          {
          <fpage>579</fpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Fan</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <surname>Michael D Murphy</surname>
            , Laurence Shalloo, Elodie Ruelle,
            <given-names>and John Upton.</given-names>
          </string-name>
          <article-title>An automatic model con guration and optimization system for milk production forecasting. Computers and</article-title>
          electronics in agriculture,
          <volume>128</volume>
          :
          <fpage>100</fpage>
          {
          <fpage>111</fpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Arko</given-names>
            <surname>Barman</surname>
          </string-name>
          .
          <article-title>Time series analysis and forecasting of covid-19 cases using LSTM and ARIMA models</article-title>
          . arXiv preprint arXiv:
          <year>2006</year>
          .13852,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Cong</surname>
            <given-names>Xie</given-names>
          </string-name>
          , Haoyu Wen, Wenwen Yang, Jing Cai, Peng Zhang, Ran Wu,
          <string-name>
            <given-names>Mingyan</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and Shuqiong</given-names>
            <surname>Huang</surname>
          </string-name>
          .
          <article-title>Trend analysis and forecast of daily reported incidence of hand, foot and mouth disease in hubei, china by prophet model</article-title>
          .
          <source>Scienti c reports</source>
          ,
          <volume>11</volume>
          (
          <issue>1</issue>
          ):1{
          <issue>8</issue>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Cheolhwan</surname>
            <given-names>Oh</given-names>
          </string-name>
          , Seungmin Han, and
          <string-name>
            <given-names>Jongpil</given-names>
            <surname>Jeong</surname>
          </string-name>
          .
          <article-title>Time-series data augmentation based on interpolation</article-title>
          .
          <source>Procedia Computer Science</source>
          ,
          <volume>175</volume>
          :
          <fpage>64</fpage>
          {
          <fpage>71</fpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>Mariana</given-names>
            <surname>Oliveira</surname>
          </string-name>
          and
          <string-name>
            <given-names>Luis</given-names>
            <surname>Torgo</surname>
          </string-name>
          .
          <article-title>Ensembles for time series forecasting</article-title>
          .
          <source>In Asian Conference on Machine Learning</source>
          , pages
          <volume>360</volume>
          {
          <fpage>370</fpage>
          .
          <string-name>
            <surname>PMLR</surname>
          </string-name>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Shaolong</surname>
            <given-names>Sun</given-names>
          </string-name>
          , Yunjie Wei, and
          <string-name>
            <given-names>Shouyang</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <article-title>Adaboost-lstm ensemble learning for nancial time series forecasting</article-title>
          .
          <source>In International Conference on Computational Science</source>
          , pages
          <volume>590</volume>
          {
          <fpage>597</fpage>
          . Springer,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>R. A.</given-names>
            <surname>Rohde</surname>
          </string-name>
          and
          <string-name>
            <surname>Z. Hausfather.</surname>
          </string-name>
          <article-title>The berkeley earth land/ocean temperature record</article-title>
          .
          <source>Earth System Science Data</source>
          ,
          <volume>12</volume>
          (
          <issue>4</issue>
          ):
          <volume>3469</volume>
          {
          <fpage>3479</fpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <article-title>Climate change: Earth surface temperature data</article-title>
          . https://www.kaggle.com/ berkeleyearth/climate
          <article-title>-change-earth-surface-temperature-data</article-title>
          .
          <source>Accessed: 2021-01-30.</source>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <article-title>States and selected areas: Employment status of the civilian noninstitutional population, january 1976 to date</article-title>
          . https://www.bls.gov/web/laus/ststdsadata.txt. Accessed:
          <fpage>2021</fpage>
          -01-30.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <article-title>Natural gas gross withdrawals and production</article-title>
          . https://www.eia.gov/dnav/ng/ hist/ngm_epg0_
          <article-title>fgw_nus_mmcfdm</article-title>
          .htm. Accessed:
          <fpage>2021</fpage>
          -01-30.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>