Will the mighty Chinggis continue to fall? Source: Wikimedia Commons

Forecasting USD-MNT Exchange Rate — Part 1: Prophet

A time series analysis

Robert Ritz
Nov 13, 2018 · 8 min read

Since moving to Mongolia in 2013 inflation has been very visible to me. In five years the price of a can of Coca Cola (imported from Hong Kong) has nearly doubled. In fact nearly everything that is imported seems to have gotten more expensive. At the same time, prices for meat, potatoes, and other locally produced items seemed to not have the same increase.

The reason for this seems to be the strength (or weakness) of Mongolia’s currency, the tugrik (MNT). Of course, saying the exchange rate is the cause is less valuable than proving it. So let’s take a look at prices for Mongolian produced s staple food products compared to the exchange rate.

Since 2011 domestically produced food prices have remained steady.

From the chart we can see there hasn’t been a noticeable increase to staple food prices since 2011. There is a clear seasonal trend to meat prices, with winter being the low and summer being the high. This is not a surprise to many Mongolians, who know that herders slaughter the weaker animals before the winter can kill them, causing an increase in supply (and a corresponding decrease in price, à la macroeconomics). Onions, flour, and potato prices are very consistent, with very little variation. I couldn’t find data on increasing prices for imported goods, so you will have to trust me that this is the case.

Up up and away!

Looking at the USD-MNT exchange rate, there is a very clear trend since 2008 of large and steady increases. An easy way (at least for me) to think about this rate is to view it as the price of the US dollar (USD) in Mongolian tugriks (MNT). This is important because while domestically produced food items haven’t increased in price, nearly everything else Mongolians purchase is imported. This depreciation of the MNT has wide impacts for citizens, whose currency has less power, and for businesses, which often import their equipment or production input.

Time Series Forecasting with Prophet

For this article I will forecast the USD-MNT rate using a time series method developed by Facebook called Prophet. It isn’t as accurate as more detailed and advanced methods like ARIMA, but it has some key advantages:

  • Fast: with the time to build one ARIMA model I can run several Prophet models
  • Accuracy: it is accurate enough for quick analytical tasks that don’t require high accuracy
  • Simple: it is very simple to use and configure, making the entire experience better

Prophet uses an additive model that fits seasonal effects (daily, weekly, yearly) with holidays and non-linear trends. Put simply, it tries to find the time based patterns in your data (and the parts not time based) and then fits a curve accordingly. One way to think about it is drawing a reasonable line through a series of points to make a trend and then predict the future. Part 2 will use other machine learning methods.

The Forecast

The top of our USD-MNT data.

Our input data goes from January 1, 2008 to October 2, 2018. Given the date and the price, we will forecast 180 days in the future.

A 90% confidence interval is calculated to show an upper and lower level of predictions. The idea behind this confidence interval is that 90% of the actual data will fall in this range. However, in practice this is often quite tricky and sometimes gives the impression of very high accuracy. A good way to think of a 90% interval is to imagine that in 1 of every 10 days, predictions will fall outside this range.

Putting this data and our parameters through Prophet gives us the following predictions for the subsequent 180 days.

Looking at the recent data from 2018 shows a forecast line that is not entirely consistent with our real data. Further, our forecast shows a leveling out while our most recent real data shows a sharp increase. This recent increase could be an outlier, but we can test this later.

Also, not the 90% confidence interval shaded in blue. Going forward more than a few months shows a very large range, with predictions at 180 days going from 2,169 to 2,731. Even though this isn’t exactly inspiring of trust, Prophet has a few other tricks up its sleeve that are very useful, namely identifying seasonality. The two plots below are, to me, the most useful things Prophet can do.

On the left is a plot of the yearly trend of the USD-MNT exchange rate. It shows a clear trend of decreasing in the summer and increasing in the winter. Pay attention to the largest spike, during the time of Lunar New Year. This tells a clear story of foreign cash coming in during the tourist season, and a peak of spending during the Lunar New Year, when Mongolians spend significant sums of money during that celebration.

On the right is the weekly trend. This shows that, on average, the USD-MNT exchange rate decreases on Monday and increases each day after, peaking on Thursday. If you are looking to do short term forex speculation, this is key information. It should also be noted that a trend is shown for Saturday and Sunday, however no prices are given those days. Those trends are merely an interpolation from Monday and Friday data.

Next, you can see the time series forecast with a red trend line shown. Major changes in the direction of the exchange rate are shown as vertical dashed red lines. Note that since late 2016 the currency trend stabilized. This coincides with Mongolia’s opening of dialog with the IMF, which would lead to the Extended Fund Facility.

Comparison to the Yuan and Euro

One area of further exploration is how these trends and forecasts compare to the Yuan and the Euro. Does the fact that China is Mongolia’s number one trading partner change the trends? Let’s take a look at the Yuan, Euro, and USD to MNT yearly trends to see if the summer winter cycle holds.

Note that CNY is on a secondary axis

It is clear that the summer winter cycle of appreciation and depreciation holds across these currencies. This isn’t surprising for many, who watch in hope during the summer as the Tugrik appreciates like the rising temperatures of summer. This hope is short lived, however, just like the summer. One can imagine short term loans via LendMN or other non-banking financial institutions possibly follow a similar trend to the one above.

Viewing the time series for the Euro and Yuan shows a similar story for the Tugrik. The Euro shows a more variable rate than the Dollar, however, showing possibly that the Euro itself has been less stable. The Yuan looks quite similar to the Dollar time series, with little variation.

Of note is that while the forecast for the USD-MNT for the next 180 days is relatively flat, the EUR-MNT forecast shows a steady increase. The CNY-MNT forecast also shows an increase.

Accuracy Check

Our data we used to train our model ended on October 2. While doing techniques like cross validation are useful to understand how accurate our forecasts are, nothing beats checking it against reality. Let’s see how our forecasts fared against the real world from October 2 to November 6.

It is clear that we are outside the confidence interval. This could mean we are very off in our forecast, or in the future the exchange rate could fall back inside the confidence interval. Only time will tell, and to be honest I don’t have significant confidence in forecasting exchange rates with this method.

Conclusions and Next Steps

Prophet is a great tool for doing fast, accurate enough forecasts for many datasets. For our time series they were somewhat accurate and we also received valuable seasonality information. Other methods such as ARIMA have been shown to be more accurate than Prophet, but I would call the reward to effort ratio to be higher for Prophet.

One major limitation of this time series analysis is that we are modeling with only two variables, time and price. The USD-MNT exchange rate is determined by many external factors, and this analysis cannot account for those variables.

In the next article we will attempt to forecast the USD-MNT exchange rate using a machine learning method that will incorporate outside (those external factors) data such as the balance of payments, foreign currency on reserve, and others. The results of this model will be matched against recent methods that aim to simply forecast exchange rates.

You can find the data, code, and charts for this post on Github here. Enjoyed the article? Give me a clap or comment below. You can also reach me at robertritz@outlook.com

Bonus: Beef and Mutton Price Forecasts

As a bonus let’s see Prophets forecast of beef and mutton prices 2 years in the future:

This is pretty different from what we saw with the Tugrik. The 2 year forecast shows a reduction in prices! I should note that the prices given are for beef and mutton with bones in Ulaanbaatar. If you want to see this fascinating dataset for yourself you can find it here.

Also, we can see a clear yearly trend of prices. Let’s quantify it with Prophet and also see the overall trend.

It should be noted that this general trend of decreasing temperatures can easily reverse with a particularly hard winter or even a dzud. Our dataset only accounts for time, and external factors such as weather, meat exports, and disease can impact the supply, and therefore price, of meat.

Ask yourself this question: If the MNT is depreciating and goods are costing more every year, why are meat and other locally produced food products not increasing with inflation?

Mongolian Data Stories

Using data analysis, visualization, and machine learning to tell Mongolia’s story. Interested in writing for Mongolian Data Stories? Send an email to Robert Ritz (editor of MDS) at robertritz@outlook.com.

Robert Ritz

Written by

Data Scientist and Director of LETU Mongolia. Keen observer of Mongolia.

Mongolian Data Stories

Using data analysis, visualization, and machine learning to tell Mongolia’s story. Interested in writing for Mongolian Data Stories? Send an email to Robert Ritz (editor of MDS) at robertritz@outlook.com.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade