This project utilizes Time Series analysis, along with a Linear Regression model to forecast the price of the Japanese Yen vs. the US Dollar. ARMA, ARIMA, and GARCH forecasting models included, also using the decompisition of the Hodrick-Prescott filter. The In-Sample and Out-of-Sample performance metrics used to evaluate Linear Regression model. The financial departments of large companies often deal with foreign currency transactions while doing international business. As a result, they are always looking for anything that can help them better understand the future direction and risk of various currencies. Hedge funds, too, are keenly interested in anything that will give them a consistent edge in predicting currency movements.
Linear Regression Forecast Line Plot
The Following has been utilized in analysing historical data for the Yen:
- Hodrick-Prescott Filter
- ARMA Model
- ARIMA Model
- GARCH
The dataset contained the following data related to the Yen from 1990-2019:
- Apply the Hodrick-Prescott Filter by decomposing the "Settle" price into two separate series
- Create a dataframe of just the settle price, and add columns for "Noise" and "Trend" series
- Plot the Settle Price vs. the Trend Price for 2015 to the present
- Create a series using "Settle" price percentage returns, drop any nan's, and then create model Below are the results of the ARMA model
In the above ARMA model, the autoregressive term has a p-value (.42) that is greater than the significance level of 0.05.
pd.DataFrame(results.forecast(steps=5)[0]).plot(title="5 Day Returns Forecast")
In the above ARIMA, the autoregressive term has a p-value (.65) that is greater than the significance level of 0.05. With both models showing a p-value higher than 0.05, we can conclude that the coefficient for the autoregressive term is NOT statistically significant, and should NOT be kept in the model.
- Time-Series Notebook
- Linear Regression Notebook
- Yen Data CSV File
- Data Preparation (Creating Returns and Lagged Returns and splitting the data into training and testing data)
- Fitting a Linear Regression Model.
- Making predictions using the testing data.
- Out-of-sample performance.
- In-sample performance.
- Load Yen futures return data, create a lagged return column using the .shift() function
- The following dataset was produced
- Assembled actual y data (Y_test) with predicted y data into two columns in a dataframe
After splitting into Training and Testing data, I ran the Linear Regression model Assembled actual y data (Y_test) with predicted y data into two columns in a dataframe
- Decomposition using a Hodrick-Prescott Filter (Decompose the Settle price into trend and noise).
- Forecasting Returns using an ARMA Model.
- Forecasting the Settle Price using an ARIMA Model.
- Forecasting Volatility with GARCH.
When partaking in an analysis, I try to find three questions to conclude the findings. This project consisted of the use of Time Series Analysis, with that my first question was Based on my Time Series Analysis, Would I buy the Yen now? For me to conclude my findings, I would first need to ask myself, Is the risk of the Yen expected to increase or decrease? To come to my conclusion I could therefore use the evaluation based on the model. My final question would be Would I feel comfortable using this model for trading?
With this model, the out-of-sample data performed slightly better than the in-sample data. The out-of-sample had a Root Mean Squared Error(RMSE) of 0.415, while the in-sample data has a Root Mean Squared Error(RMSE) of 0.596. Using the ARMA Model to forecast the returns, then using the ARIMA Model to forecast the settle price. After that applying the GARCH Volatility Model for future volatility. Concluding, based on the evaluation from the models, I would buy the Yen, knowing that the future rate would increase.