An Analysis of the Time Series of the PepsiCo, Inc. (PEP) Share Price and a Prediction of its Development

. The paper deals with the topic of stock time series and their forecasts. The aim of the paper is to provide a detailed analysis of the time series of PepsiCo, Inc. (PEP) shares and subsequently, to use machine tools to predict its further development. The results of the paper in their first part identify the boundaries of RSI indicators for the oversold or overbought market and moreover, with the help of these indicators, predict further possible development of the time series. Daily share price data from PepsiCo, Inc. from the end of April 2019 to the end of April 2020 are used. Two indicators have been recorded since the beginning of 2020. The first one, recorded at the end of January, recommended the trader to sell the position, and further developments suggest that this step would be correct, as stock values then began to fall sharply. The second indicator was identified at the beginning of March, when the world was shaken by the coronavirus crisis, and this indicator recommended the trader to buy a position. Further developments indicated that this would be the right move, as stock values rose in the following period. Moreover, the moving average method is employed as well. Values are calculated for 50, 100 and 200 days. With this tool, only one recommendation is identified, in March 2020, when the fast moving average intersected both slower moving averages, and the ideal solution was to sell the position, which could be described as the right step with the further development of the time series, because stock values began to fall again after this period.


Introduction
The issue of stocks is currently one of the most topical matters, due to the coronavirus pandemics. Most companies are closed down or produce only at half capacity, which reduces their market value. Countries have closed their borders as a result of the pandemics, which leads to a slowdown in most economies [1]. In the current situation, these restrictions seem logical and proportionate, but in the long run, they may have a much greater and more devastating impact on national economies. It will start with the collapse of smaller companies that do not have the capital to compensate for the absence of sales for months, despite the fact that they still have fixed and other expenses. This will be followed by the downfall of companies that could produce, but because 80% of their customers are larger companies that have also stopped their production, they will have no one to sell to and will be forced to stop [2][3][4]. This will lead to redundancies, the inability of people to provide for their families, foreclosures, loss of housing etc. However, every pandemics subsides over time and the aforementioned fall of shares may be an opportunity for investors to buy shares and increase their financial resources. In the current situation, however, it is very difficult to analyse and predict the future development of stocks. Despite the fact that the world already has experience with the economic crisis, the situation is different now.
The stock time series indicates how the stock value of a particular company has changed over time and helps to retrospectively evaluate contexts that may not be clear at first glance [5][6]. This data, often plotted, help people predict future developments in the data studied and prepare for these situations in advance. However, the reliability of the forecast is determined by various other factors and often may not correspond to actual developments. The purpose of predicting the time series of a stock is to create a model that, based on mathematical data, will provide an indicative outline of future developments. Time series can be divided into short-term and long-term ones [7][8]. Short-term periods are shorter than one year. For example, the time series can be analysed daily, weekly, monthly, etc. Longterm time series indicate a research period of one year or more. Another division of time series is interval and instantaneous. Interval time series are those that report data for a predetermined interval that we want to monitor. It can be, for example, the volume of the company's production in one month. Instantaneous time series are data for a specific moment, not an interval [9][10][11]. This variant can document, for example, the number of inhabitants of the Czech Republic at a specific point in time, e.g. 31 December 2019.
The purpose of this paper is to analyse time series o of PepsiCo, Inc. (PEP) shares. The company was founded in 1898 in the United States of America and entered the Czech market in 1993. It is the second most important producer of soft drinks in the world and its leading product is the world-famous cola flavoured lemonade, Pepsi. Among other things, the company sells beverages such as Mirinda, 7UP or, for example, the energy drink Rockstar.
The aim of the paper is to provide an analysis of selected methods of time series machine prediction on the example of the PepsiCo, Inc. share price development.

Literature research
The correct determination of a trend and its use is an absolutely key component for trading in shares, without which the investor can hardly succeed and value their financial resources. The value of every stock evolves in time and for the trader, it is important to determine the actual trend and, consequently, to make their decisions accordingly [12].
These trends are determined by the rising and falling elements of a stock. If the stock price rises and then turns and starts to fall, the highest point reached is called "high". Conversely, if the value of a stock falls and turns at a particular point and begins to rise, we call the lowest point "low" [13]. The first type of trend is the so-called "rising trend". It indicates that rising values of the particular stock are higher than the falling ones, which means that the value of a share is rising in the long run. In this case, it is a signal for the trader that the stock is developing appropriately and should, after evaluating other factors, be considered for a purchase [14]. In the opposite case, there is the so-called "declining trend" which means that the increasing values are inevitably shorter than the declining values and the long-term share value heads, in this case, rather downward. Consequently, businessmen thinking rationally should avoid the purchase of such stocks or evaluate other factors carefully [15]. The last type of stock trend is "sideways movement", which signals rising and falling values at roughly the same intervals, which in the long run means that the stock is moving at about the same level and its value is, therefore, not rising nor falling [16].
From the point of view of time, stock trends can be divided into long, medium and short-term. Long-term trends are sometimes referred to as key trends and have the most fundamental influence in analysing the value of a stock because they define the long-term development of the stock value. If this trend is increasing, the further developments can be expected to be similar. However, this is not a rule [17]. The medium-term trend takes place in a shorter time horizon than the long-term trend, which means that the medium-term trend may not only show the increasing values, but also the decreasing ones, even if the value of the stock increases in the long run. Out of the above-mentioned trends, it is the short-term trend that indicates the shortest period of time. This trend fluctuates the most because it is affected by "fresh" information published in hour or days. It gives the investor the opportunity to assess whether the long-term, medium-term and short-term trends are in line and their development is similar [18].
Another important element that has to be defined is the moving average (MA). This statistic figure can be calculated for any data set, however, in connection with the technical analysis, stock price data samples are taken into account the most often. The moving average is a numerical value of the arithmetic mean in the course of time [19]. This means that if it is necessary to calculate the moving average for one month, we will use thirty different stock prices from the previous thirty days and every other day the value of the moving average will change, because one day at the beginning will no longer be taken into account and will be replaced by the current day added to the data file [20].
For every investor, it is also important to be familiar with the RSI indicators. Using this tool, the relative strength of the market can be quickly and transparently calculated. The main criteria for measuring a market using indicators are either an overbought or vice versa an oversold market. The indicator values range from 0 to 100 %. Most investors prefer the limit at 80 % for an overbought market and 20 % for an oversold market [21]. In case that the value of the index exceeds 20% and more, the investor is informed that he should consider buying a share. Similarly, if the value of the index falls under 80%, the investor should consider selling the investment. RSI is an essential tool included nowadays in each analytical software, which helps businessmen read the stock time series [22][23].
Until recently, European investors were not familiar with the term candlestick graph and the related Japanese candle. It originated in Japan around the 18th century, when its founder, Munehisa Homma, was able to record a tremendous return on investment with its help. The candlestick graph is used with a specific time limit, often one day, and the candle itself has four parts that provide information about the minimum, maximum, opening and closing share prices in the observed time horizon [24]. The Japanese candle has a column structure and its colour varies depending on whether the value of the stock decreased or increased during the reviewed period. If the opening price is lower than the closing price, it means that the value of the stock increased during the day and the candle will therefore be green. In the opposite case, where the opening price is higher than the closing, the candle has the colour red and this represents a decrease in the value of the shares [25].
In general, traders deal with two types of analyses that can be used to monitor stock developments. The first type is the fundamental analysis. It deals mainly with data that comes from the macroeconomic sector of the company, the country etc. An example of data can be the gross domestic product rate of a country, the percentage of unemployment or, for example, the political situation of a particular country [26]. The second type is a technical analysis, which deals more with stock trends, RSI indicators etc. [27]. The main difference from the fundamental analysis lies in the fact that the technical analysis works with the assumption that history repeats itself. This means that a stock showing a long-term growth can be expected to grow further and respond accordingly to developments. This condition can be applied even to more complex situations, for example, if there was a situation A in the past followed by situation B, it can be assumed that now, when the market is in situation A, situation B will follow again. This piece of information can be of a key importance for a potential investor [28].
The stock time series can be evaluated with a wide range of tools. Experts agree that the basic practice is to monitor trend graphs, whether short-term, medium-term or long-term. Furthermore, in the scientific literature, it is also stated that it is important to monitor the RSI indicators, which can make it easier for the investor to decide whether to buy or sell a share. There is also a mention of the famous candle graphs, which facilitate the clarity of the most common daily results. Furthermore, the difference between fundamental and technical analysis is often described. Experts present the opinion that the technical analysis is more accurate and reliable. Therefore, this paper will deal with the technical analysis of the stock time series and its machine prediction.

Data and methods
For each analysis and prediction of the stocks time series, it is necessary to use specific data. All data necessary for this paper were obtained from the website yahoo! finance [29]. The data selection will include data in the annual time period with a daily frequency. The calculations will be performed using the closing price "close". The first value of the time share will be from 30th April 2019 and the last value will be the formula from 29th April 2020. An example of the data, in this case in a period of one year, can be seen in the following table. For illustrative purposes, the values of the monthly intervals are shown. The final calculations will be performed with daily data. One way to evaluate and analyse a time series of stocks is by using simple moving averages (SMAs). The difference between this tool and the usual arithmetic mean lies in the fact that the moving average changes with the passing time. Moving averages can be calculated for thirty, fifty or even a hundred days. The purpose of this quantity is the competence of the moving average to change with time. With the shift of time by one unit (most often a day), the oldest value is removed from the calculation and the formula is supplemented by the most current value (therefore "moving"). The values for this calculation are therefore irregular and changing, with only the number of time units for which the quantity is calculated. The tool can be used for any data set, which is to change over time, but in the field of technical analysis is most often used for price values. It is recommended to use the moving average especially when analysing a longer time series for which the use of the trend function would be insufficient. Experts recommend always using an odd number of moving values. The relationship that applies to the calculation of simple moving averages is as follows: Where: SMA = moving average value, P = share price in a specific time unit (most often the closing price of the day), n = total number of values (most often days).
Due to the fact that moving averages work with past data, these are delayed characteristics. For this reason, in addition to simple moving averages, a modified version of the calculation was created. These are exponential moving averages (EMA). While for simple moving averages all values have the same weight, in the calculations of exponential moving averages the weight of values is significant. In practice, this means that the old values have a lower weight for the calculation, and the weight then increases linearly the more current the data is. The latest data then have the most significant weight. However, this does not mean that exponential moving averages are better or more valuable indicators. It always depends on the current situation and the preference of the investor, which of these two types will suit them better.
The moving average characteristics can be compared with the current value of the stock. In the case where the stock price moves above the value of the moving average, it is a so-called bull trend (i.e. growth). The opposite is the bear trend which occurs when the stock price is below the moving average.
In practice, it is still possible to encounter strategies of two or three moving averages. In the case of two moving averages, one of them is "slow" and the other one is "fast". Slow means that the moving average describes more values that are in a shorter time interval, while the fast moving average generally describes the same time period, but the interval of its values is shorter. For example, if the values of the slow moving average are represented in daily intervals, the values of the fast moving average are stated in hours. In practice, this means that a fast MA outlines the trend curve more. The outputs of this strategy are as follows. If a faster MA crosses a slow one upwards, it is an indicator for the trader to purchase. In the opposite case, the faster MA crosses the slow MA downwards, it is an indicator for sales positions. The principle of the three moving averages strategy is very similar, with the difference that in addition to the slow and fast ones, there is also a medium moving average.
Analysing stock time series using RSI indicators is also a very common tool used in technical analysis. There is an inexhaustible number of indicators, but only a few of them are proven. This is a universal tool that can be used on any market for any length of the time period. The calculation of the RSI indicator is usually based on the closing price of the share and for its calculation, it is necessary to know or determine the appropriate period. The period provides information about how many specifically long time periods the calculation will contain. For example, if the period is twelve and the RSI indicator is required to be calculated in hourly graphs, the last twelve hours will be calculated. The relationship for calculating the RSI indicator is as follows: Where: RSI = RSI indicator value, RS = average closing price gain/average closing price loss.
To calculate the value, it is therefore necessary to first calculate the value of RS. In this particular case, mentioned above, it would be necessary to calculate how many closing prices out of a total of twelve were higher than their previous closing price and then divide this number by twelve. Furthermore, it needs to be found out how many closing prices were lower than their previous closing price and divide the value again by twelve. Finally, the result from the first point should be divided by the value from point two. In the case that there are more closing prices higher than their previous price than prices lower than their previous value, the RS result value will reach more than 1.
The resulting value of the RSI indicator will range in the interval 0-1 , which means 0-100%. The basic meaning of using RSI indicators can be found in deciding whether to buy a position or, conversely, give it up and sell it. The approach recommended by experts is that if the resulting value of RSI indicators exceeds the limit of 20% upwards, the price has gotten out of the oversold area and it is advantageous to make a purchase position. In the opposite case, when the value exceeds the limit of 80% downwards, the price reached the overbought area and is generally recommended to give up the position on the market. If the resulting value is between 20 and 80% and none of them exceeds, it is recommended to hold the position and wait for further changes in the share price on the market. However, experts warn that it is not optimal to make a purchase or sale immediately after the limit of 20 and 80% is exceeded. If one of these values is exceeded, it is recommended to wait until the stock price returns from overbought or oversold area and to then make a purchase or sale.

Results
Data containing values of PepsiCo, Inc. (PEP) shares from April 30, 2019 to April 29, 2020 were downloaded from the above-mentioned internet source. The data was subjected to mathematical calculations which are explained in the methodological part of the paper. All calculations, as well as the displayed graphs were created using Excel.
First, the RSI values were calculated using a fortnight period. The 20% limit was chosen for the overbought market and the 80% limit was chosen for the oversold market.
Subsequently, the moving averages were calculated. The time period chosen for the calculation was set at 50, 100 and 200 days. All types of moving averages were based on the closing share price. For a simpler presentation, the moving averages have been calculated for a period of two years, so that the values of the moving averages were displayed from the very first day in the inserted graph presenting the values of the last half year.
Last but not least, the graph shows also the trading volumes of shares with a period of one day in the lower part.

Discussion
Generally speaking, the values of most shares have fallen sharply since the beginning of 2020 due to the coronavirus crisis, and some stock market experts are talking about the worst values in the last seven years. The surveyed company PepsiCo, Inc. is no exception to this. This company was also affected by the coronavirus crisis, as it is evident in the values of shares and its trading volumes. This slump in the world stock market could have caused major problems, sometimes even bankruptcies for smaller businesses despite economic help from the government. However, huge companies such as Pepsi undoubtedly can get out of these problems without much difficulty and may even profit from this situation.
In the first part of the results, RSI indicators were examined. Limits of 80% were set for the overbought market and 20% for the oversold market, and the indicators were calculated with a period of fourteen days. It is clear from the documented graph that the development curve does not cross any of these boundaries at any time. This means that the value of the shares is neither in the oversold area nor in the overbought area. Therefore, the investor should not make any purchases if they are considering making an investment, and if they already own a certain volume of shares, they should not give up their positions and should wait for further development. In scientific literature, it is stated that investors often use different criteria for the boundaries of oversold or overbought market as well, namely 30% and 70%. Taking into consideration these limits, it can be argued that from the end of January to early February 2020, the boundary for an overbought market was crossed, which would be an indicator for the trader to sell their position. Looking at further developments, it is clear that this consideration would be correct, as stock values began to decline in the future. They reached their lowest levels at the beginning of March 2020, when the whole world was shocked by the above-mentioned coronavirus crisis and the shares were in the oversold area. In the following weeks, the world began to recover and the curve crossed the border of the oversold area, and at that moment it was an indicator for the investor to purchase. It is clear from further developments that the share values have grown even further, so this statement would be correct and profitable in this case as well. Currently, the values are around 50-60% and whether the limits are set at 20 and 80% or 30 and 70%, there are currently no clear indicators for buying or selling positions, so the recommendation is to wait and monitor further developments in stock values.
The second part of the results was devoted to examining the development of the trends, moving averages and trading volumes. Moving averages for 50, 100 and 200 days were calculated. From the above-mentioned graph, it can be concluded that the course of all examined trends did not oscillate much from the beginning of November 2019 to the beginning of March 2020 and more or less copied the stock prices. Only during January, it can it be argued that the fast average was close to the medium-fast, but did not intersect it and rose again. This situation, however, changed abruptly in the course of March 2020 and culminated in April 2020 when a 50-day (fast) moving average crossed both the slower moving averages (the 200 and 100 days). According to the recommendation outlined above, in a situation where the fast moving average crosses the slower one downwards, it is recommended to give up the position held and expect prices to fall. It is clear from further developments that the aforementioned fall in stock prices has indeed occurred so it can be concluded that the development would have been predicted correctly. For the next period, it seems to be the best recommendation to wait for a situation where the faster moving average, which is now below the medium-fast and below the slow, intersects one of these and indicates the right time for buying a position.
Due to the fact that both RSI indicators and moving averages for different periods and trading volumes do not currently produce any signal that would recommend an investor to buy or sell their positions, it is difficult to predict the further development of the time series. If the fundamental analysis was taken into account, it could be argued from the development so far that the stock values were at higher levels by the beginning of March 2020, then fell sharply due to the coronavirus pandemics and currently, they are recovering from the crisis and rising steadily. Unless another wave of the coronavirus crisis hits the world, further growth back to normal levels can be expected. At the moment, careful market monitoring and expectations of a signal to buy or sell positions seem to be the ideal solution. Both RSI indicators and moving averages for different periods and volumes of trades have proven in practice as tools that can be used to successfully analyse time series and investors can base their purchases and sales on them. Primarily the RSI indicators seem to be the most beneficial, as they estimated the further course correctly in all cases and thus would save money of the potential investor, or vice versa, earn them a fortune. Moving averages for 50, 100 and 200 days provided only one recommendation signal, however, even in this case the estimate was successful. Both of these methods appear to be functional at any time, however, in exceptional cases, such as the current coronavirus crisis, it is recommended to supplement them with a fundamental analysis that these tools do not take into account. Therefore, their prediction could be incorrect without supplementing the fundamental analysis.

Conclusion
The aim of this paper was to use selected tools to evaluate and predict the time series of PepsiCo, Inc. shares.
The methodology of the paper described various opinions of other authors and presented basic information that is used for analysing and forecasting time series of shares. In the methodological part, the most suitable tools were selected and both their essence and other more extensive strategies were outlined. Specifically, two main methods of stock time series analysis were chosen, namely moving averages and RSI indicators, or trading volumes of the company. In the results part, the previously outlined tools were elaborated in detail and the output of the calculations was presented, namely two graphs showing both the RSI indicators and the trading volumes, Japanese candles and three types of moving averages (50-day, 100-day, 200-day). In the next part, a discussion of the results was created from these outputs where the results were presented in a clear form. At the same time, this examination of past data provided a proof whether individual strategies, whether in the form of RSI indicators or moving averages, would provide a correct evaluation. Furthermore, it was assessed whether would be successful in investing provided that he acted accordingly. In the end, these strategies proved to be successful, and the further development of the share price corresponded with the prediction.
From the above-mentioned results, it can be argued that both of these tools, i.e. RSI indicators and moving averages for different periods, would work in practice and appear to be optimal helpers for time series analysis. In the case that it would be necessary to provide only one most suitable instrument, the RSI indicators would be the most favourable choice, for the reason that this method gave three specific indicators to buy or sell positions and in all these cases, the prediction was successful.
To conclude with, it can be argued that the stated goal of the paper was met using the above information and both RSI indicators and moving averages appear to be beneficial in the technical analysis of time series.