Coder Social home page Coder Social logo

arzuisiktopbas / a_yen_for_the_future Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6.78 MB

The time-series tools (Time Series Forecasting and Linear Regression Modeling ) in order to predict future movements in the value of the Japanese yen versus the U.S. dollar.

Jupyter Notebook 100.00%
arima-models series-forecasting garch

a_yen_for_the_future's Introduction

A Yen for the Future

by Arzu Isik Topbas

image source:freepik

I tested the many time-series tools that I have learned in order to predict future movements in the value of the Japanese yen versus the U.S. dollar. I used two main models Time Series Forecasting and Linear Regression Modeling.


1 - Time-Series Forecasting

Time-Series Forecasting

In the long term, It seems that the Japanese Yen is strengthening against the Dollar. On the other hand, there are a lot of short-term ups and downs.

1. Decomposition using a Hodrick-Prescott Filter

I used The Hodrick-Prescott Filter to decompose the "Settle" price into two seperate series: noise and trend. It seems that there's a lot of short term fluctuations that deviate around the trend.

SettlevsTrend

The Noise plot gave us a visualization of where the most noise is on this chart. These points can be correllated with volatile periods in the market.

Noise

2. Forecasting Returns using an ARMA Model

I created an ARMA model and fit it to the returns data. Note. I set the AR and MA ("p" and "q") parameters to p=2 and q=1: order=(2, 1)

In the summary table, the p-values for each lag are not statistically significant. The model is not a good fit given the p-value exceeds 0.05.

Arma

Arma

3. Forecasting the Settle Price using an ARIMA Model

I created an ARIMA model by using the "Settle" price data. For autoregressive (AR) the parameter p was set to 5, for differences the parameter d was set to 1 and, for the moving average (MA) the parameter q was set to 1 making order=(5,1,1).

Again, based on the summary table, the p-values for each lag did not show to be statistically significant - none are less than 0.05.

Arima

Based on the ARIMA model, we can see that an increase in the Yen over the dollar is expected for the 5 day period.

Arima

4. Forecasting Volatility with GARCH

I created a Garch model and fit it to the returns data. Note. Similar to ARMA, I set the AR and MA ("p" and "q") parameters to p=2 and q=1: order=(2, 1) In the summary table,the p-values are greater than 0.05 and therefore statistically significant.

Garch

Based on the GARCH forecast plot , volatility risk of the Yen will increase each day for the next 5 days.

Garch

Conclusions

According to ARMA and ARIMA models, the Japanese Yen will increase relative to the US dollar, however, there might be an unreliable coefficient that might cause misleading result because the p-values are greater than 0.05. Thus, I would not buy the Japanese Yen.

Based on the GARCH forcast, volatility risk of the Yen will increase each day.

Again, due to p- values are not less than 0.05, I do not feel confident in using these models for trading.

2 - Linear Regression Forecasting

I build a Scikit-Learn linear regression model to predict Yen futures ("settle") returns with lagged Yen futures returns and categorical calendar seasonal effects (e.g., day-of-week or week-of-year seasonal effects).

The model has a root mean square error of 0.415% on out-of-sample data and 0.5962% on in-sample data. Hence, the model performs better with data that it has not worked with before.

Linear_reg

The In-Sample data and the Out of Sample results is highly deviant from each other.Because the root mean square error of 0.415% on out-of-sample data is smaller than the root mean square error of 0.5962% on in-sample data, it is considered that the model is Overfitting.

a_yen_for_the_future's People

Contributors

arzuisiktopbas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.