GithubHelp home page GithubHelp logo

maitree7 / time_series_analysis Goto Github PK

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

Time Series Analysis - Yen for the Future

Jupyter Notebook 100.00%
time-series-analysis arma arima-forecasting garch-models linear-regression

time_series_analysis's Introduction

Unit 10โ€”A Yen for the Future

Yen Photo

Background

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.

In this assignment, we tested many time-series tools in order to predict future movements in the value of the Japanese yen versus the U.S. dollar.

Following tasks:

  1. Time Series Forecasting
  2. Linear Regression Modeling

Files

Time-Series Starter Notebook

Linear Regression Starter Notebook

Yen Data CSV File


Time-Series Forecasting

Determining whether there are any predictable behavior based on the historical Dollar-Yen Exchange rate futures data and applying time series analysis and modeling

Following tasks were performed:

  1. Decomposition using a Hodrick-Prescott Filter (Decompose the Settle price into trend and noise).

    settle_trend

    Noise

  2. Forecasting Returns using an ARMA Model.

    ARMA_model

    5-day-frcst-ARMA

  3. Forecasting the Settle Price using an ARIMA Model.

    ARIMA_model

    5-day-frcst-ARIMA

  4. Forecasting Volatility with GARCH.

    garch_model

    Volatility

Use the results of the time series analysis and modeling to answer the following questions:

  1. Based on your time series analysis, the Yen prices are increasing for the short term.
  2. The risk is expected to increase for the Yen
  3. For ARMA & ARIMA models, p < 0.05 and also, AIC & BIC values are way high. These are not the best models for trading.

Linear Regression Forecasting

Built 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).

Following tasks performed:

  1. Data Preparation (Creating Returns and Lagged Returns and splitting the data into training and testing data)
  2. Fitting a Linear Regression Model.
  3. Making predictions using the testing data.
predictions = model.predict(X_test)

predicted_return predicted_return_plot

  1. Out-of-sample performance.
Out-of-sample Root Mean Squared Error (RMSE): 0.41521640820129047
  1. In-sample performance.
In-sample Root Mean Squared Error (RMSE): 0.5663352320297497

Use the results of the linear regression analysis and modeling to answer the following question:

  • Does this model perform better or worse on out-of-sample data compared to in-sample data?
RMSE for Out-of-sample is lower (0.415) as compared to in-sample (0.566). Model performs better on out-of-sample data 

time_series_analysis's People

Contributors

maitree7 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.