Giter Site home page Giter Site logo

time-series's Introduction

Time Series

Time series is a sequence of data points indexed in time order. Mathematically, a time series is a stochastic process with a discrete-time observation support. In this repository, we study several topics, such as ARIMA models, trend and seasonality. Each homework has a practical simulation and some theoretical questions.

The homeworks and assigments are coded in R language and the presentations and texts are in portuguese. If requested, the author can translate it.

R programming

R is the classic programming language for statistics. It has some limitations when compared to other languages, but some packages make it more worthy, as:

  1. ggplot: best tool for plotting in R
  2. tseries and zoo: good for dealing more easily with time series.
  3. forecast: the best when we speak about estimation and predictions of the models.

Homework 1

A pratical study of Car's Sales in Norway. In this study we practice the following modelling:

  • Decomposition in Seasonal, Trend and Remainder of a Time Series.
  • Polynomial regression for trend and seasonality.
  • Holt Winters and Exponential Smoothing

After each modelling, we compared the models using the Mean Absolute Percentage Error.

Above you can see the moving average decomposition and the final comparison among the models.

decomposition moving average

comparison among models

Homework 2

Identification of ARMA models, considering the Autocorrelation and Partial Autocorrelation of the series.

By looking the image, the behaviour of the graphic can identify, initially, a model.

acf and pacf

Homework 3

We have some theorical exercises about differenciation and stationarity of ARIMA process. Also we construct by simulation the distribution of the statistic of Adjusted Dickey-Fuller (ADF) Test. In the end we identify an ARIMA model for the ipca (inflation) series. We considered a variance stabilizer. So as to identify the model, we use the ACF and PACF graphics combined by the Information Criterion, as AIC, BIC and AICc.

ipca monthly

For each considered model, we studied the residuals of the estimated model.

residual analysis

Homework 4

We used the method Box-Jenkins in order to understand a time series as an ARIMA model. We can summarize it as:

  1. Box-Cox transformation to stabilize the variance.
  2. Identify the $ARIMA(p,d,q)$ model:
    1. Check the stationarity of the series with ADF test and differentiate if necessary ($d$ times)
    2. Visualize the ACF and PACF of the data.
    3. Compare AIC, BIC and AICc information and select $p$ and $q$.
  3. Estimation of the parameters of the model through maximum likelihood.
  4. Diagnose the residuals (remainder of the fitting):
    1. Visualize the residuals.
    2. Plot histogram, autocorrelation and partial autocorrelation.
    3. Ljung-Box's test for de-correlation and Jarque-Bera's test for kurtosis and skewness' normality.

Homework 5

More exercises about transformation of a time series. We study the Box-Jenkins method considering seasonality. In this case, it's important to use Kruskal-Wallis test for seasonality and differentiate $D$ times considering this. The information criterion and ACF can be used as well. As example, we used the expenses in coffees, restaurants and other in Australia.

eating Australia

Assignments

The assigments are application of this methods in more difficult series. It's suggested to have a look in the pdfs available in the assigment's folder.

time-series's People

Contributors

lucasmoschen avatar lucasresck avatar souzamatheusp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lucasresck

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.