GRETL. (Gnu Regression, Econometrics and. Time-series Library)



Similar documents
Booth School of Business, University of Chicago Business 41202, Spring Quarter 2015, Mr. Ruey S. Tsay. Solutions to Midterm

Promotional Forecast Demonstration

Time Series Analysis

Time Series - ARIMA Models. Instructor: G. William Schwert

KSTAT MINI-MANUAL. Decision Sciences 434 Kellogg Graduate School of Management

Analysis of the Volatility of the Electricity Price in Kenya Using Autoregressive Integrated Moving Average Model

Vector Time Series Model Representations and Analysis with XploRe

Software Review: ITSM 2000 Professional Version 6.0.

The SAS Time Series Forecasting System

Sales forecasting # 2

TIME SERIES ANALYSIS

Exam Solutions. X t = µ + βt + A t,

ITSM-R Reference Manual

Advanced Forecasting Techniques and Models: ARIMA

JOHANNES TSHEPISO TSOKU NONOFO PHOKONTSI DANIEL METSILENG FORECASTING SOUTH AFRICAN GOLD SALES: THE BOX-JENKINS METHODOLOGY

Time Series Analysis

Graphical Tools for Exploring and Analyzing Data From ARIMA Time Series Models

Time Series Analysis: Basic Forecasting.

Forecasting of Paddy Production in Sri Lanka: A Time Series Analysis using ARIMA Model

Rob J Hyndman. Forecasting using. 11. Dynamic regression OTexts.com/fpp/9/1/ Forecasting using R 1

Time Series Analysis

TIME SERIES ANALYSIS

Analysis and Computation for Finance Time Series - An Introduction

Examples. David Ruppert. April 25, Cornell University. Statistics for Financial Engineering: Some R. Examples. David Ruppert.

COMP6053 lecture: Time series analysis, autocorrelation.

Data analysis and regression in Stata

Threshold Autoregressive Models in Finance: A Comparative Approach

Time Series Analysis and Forecasting

THE UNIVERSITY OF CHICAGO, Booth School of Business Business 41202, Spring Quarter 2014, Mr. Ruey S. Tsay. Solutions to Homework Assignment #2

Time Series Analysis with R - Part I. Walter Zucchini, Oleg Nenadić

Time Series Analysis of Aviation Data

Forecasting the US Dollar / Euro Exchange rate Using ARMA Models

Search Marketing Cannibalization. Analytical Techniques to measure PPC and Organic interaction

Chapter 9: Univariate Time Series Analysis

SPSS Guide: Regression Analysis

Descriptive Statistics

Forecasting the PhDs-Output of the Higher Education System of Pakistan

Time Series Laboratory

about is Ox, developed by J.A. Doornik at Nuffield College, Oxford, United Kingdom.

Time Series Analysis

Forecasting Using Eviews 2.0: An Overview

How To Model A Series With Sas

Does the interest rate for business loans respond asymmetrically to changes in the cash rate?

Some useful concepts in univariate time series analysis

Using JMP Version 4 for Time Series Analysis Bill Gjertsen, SAS, Cary, NC

Bill Burton Albert Einstein College of Medicine April 28, 2014 EERS: Managing the Tension Between Rigor and Resources 1

Studying Material Inventory Management for Sock Production Factory

Doing Multiple Regression with SPSS. In this case, we are interested in the Analyze options so we choose that menu. If gives us a number of choices:

Unit root properties of natural gas spot and futures prices: The relevance of heteroskedasticity in high frequency data

Directions for using SPSS

Time-Series Regression and Generalized Least Squares in R

Studying Achievement

Application of ARIMA models in soybean series of prices in the north of Paraná

IS THERE SEASONALITY IN THE SENSEX MONTHLY RETURNS? I M Pandey Indian Institute of Management Ahmedabad Vastrapur, Ahmedabad India

Multiple Linear Regression

Data Mining Techniques Chapter 5: The Lure of Statistics: Data Mining Using Familiar Tools

IBM SPSS Forecasting 22

Introduction to Regression and Data Analysis

MGT 267 PROJECT. Forecasting the United States Retail Sales of the Pharmacies and Drug Stores. Done by: Shunwei Wang & Mohammad Zainal

Turkey s Energy Demand

9th Russian Summer School in Information Retrieval Big Data Analytics with R

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Data Analysis Tools. Tools for Summarizing Data

Module 5: Statistical Analysis

Chapter 25 Specifying Forecasting Models

FORECAST MODEL USING ARIMA FOR STOCK PRICES OF AUTOMOBILE SECTOR. Aloysius Edward. 1, JyothiManoj. 2

USE OF ARIMA TIME SERIES AND REGRESSORS TO FORECAST THE SALE OF ELECTRICITY

Payroll. 4. Print Checks. Table of Contents Print Checks...2 All...3 Department...4 Print Single Posting...5

Multiple Regression in SPSS This example shows you how to perform multiple regression. The basic command is regression : linear.

Predicting Indian GDP. And its relation with FMCG Sales

Note 2 to Computer class: Standard mis-specification tests

IBM SPSS Forecasting 21

Simple Linear Regression Inference

TIME-SERIES ANALYSIS, MODELLING AND FORECASTING USING SAS SOFTWARE

Network Traffic Modeling and Prediction with ARIMA/GARCH

Factors affecting online sales

Forecasting areas and production of rice in India using ARIMA model

Readers will be provided a link to download the software and Excel files that are used in the book after payment. Please visit

Modeling and forecasting regional GDP in Sweden. using autoregressive models

Time Series in Mathematical Finance

Preholiday Returns and Volatility in Thai stock market

3.1 Stationary Processes and Mean Reversion

Forecasting Analytics. Group members: - Arpita - Kapil - Kaushik - Ridhima - Ushhan

4. Simple regression. QBUS6840 Predictive Analytics.

Univariate Time Series Analysis; ARIMA Models

4 Other useful features on the course web page. 5 Accessing SAS

Do Electricity Prices Reflect Economic Fundamentals?: Evidence from the California ISO

Chapter 7 Section 7.1: Inference for the Mean of a Population

Transcription:

1 GRETL (Gnu Regression, Econometrics and Time-series Library)

2 In this project you should analyze generated and real data. Analysis of each set of data should contain: a) Descriptive statistics. b) Time series plot. c) Checking of normality. d) If data are non-stationary take, for example log-differences to assure stationarity. e) Descriptive statistics, time series plot, checking of normality, analysis of stationarity of new data. f) Analysis of correlogram, finding AR and MA processes order. g) Estimating ARMA processes (in gretl) h) Compare estimated models using information criterions. i) Choosing the best ARMA model. j) Estimating ARMA-GARCH processes (in Ox) k) Compare estimated models using information criterions. l) Choosing the best ARMA-GARCH model.

3 Projekty oddajemy w wersji papierowej. Kazdy projekt bedzie "broniony" indywidualnie. W projekcie prosze zamiescic kolejne kroki dochodzenia do ostatecznego modelu (co obserwujemy, jakie modele beda rozpatrywane w zwiazki z tym, jakie sa kryteria wyboru optymalnego modelu itd, warto porobic troche rysunkow) Which financial time series features do you observe? Which class of models do you chose and why? What are the probably orders of the models? Which model is the best for given data? Is it really the best existing model? wygenerowane dane pochodza z modeli poznanych na wykladzie -ARMA + szeroka klasa modeli GARCH z roznymi efektami + rozne rozklady warunkowe rzedy modeli sa zdroworozsadkowe czyli zawiaraja sie w ARMA(2,2), GARCH(2,1) proponowane narzedzia do analizy to GRETL oraz OX z pakietem G@rch

4 1. How to get and install gretl a) Go to page http://gretl.sourceforge.net/ or www.gretl.pl and download gretl (Section Gretl for Windows, gretl-1.9.6.exe)

5 b) Install gretl with default parameters After that, gretl will be installed, but usually in Polish language, to run gretl in English language you have to click: Narzędzia -> Ustawienia -> Ogólne or Tools -> Preferences -> General Choose Wybór języka dla GUI -> English

Choose Wybór języka dla GUI -> English or Language Preserence -> Polish 6

7 2. To load data to gretl from ASCI (text) file, you have to choose from menu: File -> Open data -> Import -> Text/CSV When gretl loads chosen file it will open window with question about structure of data. Answer Yes a) Choose Time series, then click Forward b) Choose Daily (5 days), then click Forward c) Type 1970/01/01 as a starting date, then click Forward (any other date will do) d) Click Apply (if everything is OK).

8

9

right mouse button 10

11 3. To load data to gretl from Excel file: File -> Open data -> Import -> Excell Gretl will open first window, click Yes. Then it will open next window with the same question like previous, so you have to choose the same steps.

5. With loaded and set data you can: a) Get a time series plot: click with right mouse button second variable name (first is a constant added by gretl) and choose Time series plot b) Get a descriptive statistics: click with right mouse button and choose Descriptive statistics c) Get a correlogram: click with right mouse button and choose Correlogram (you have to choose a proper lag, in most cases the default lag will be good) After choosing lag two windows will open, first with graph of autocorrelation and partial autocorrelation, second with coefficient of autocorrelation and partial autocorrelation functions (with significance of each coefficient). 12

13 6. Transformations of variables: a) returns: Add -> Define new variable In opened window type: new_variable = (x x(-1))/x(-1) where x name of variable b) logarithmic returns: Add -> Log differences of selected variables

14

15 8. Checking of normality: Variable -> Frequency distribution Variable -> Frequency distribution-> Against Normal Q-Q plot for rates 6 y = x 4 2 0-2 -4-6 -8-10 -4-3 -2-1 0 1 2 3 4 Normal quantiles

16 The lower the p-value, the less likely the result is if the null hypothesis is true, and consequently the more "significant" the result is, in the sense of statistical significance. One often rejects the null hypothesis when the p-value is less than 0.05 or 0.01, corresponding respectively to a 5% or 1% chance of rejecting the null hypothesis when it is true (Type I error).

17 9. Checking AR and MA processes order: Variable -> Correlogram other data than APATOR!! ACF for Data 1 +- 1.96/T^0.5 0.5 0-0.5-1 0 2 4 6 8 10 12 14 16 lag PACF for Data 1 +- 1.96/T^0.5 0.5 0-0.5-1 0 2 4 6 8 10 12 14 16 lag

18 10. Estimating ARMA processes: a) Model -> Time series -> ARIMA b) Choose dependent variable.

H0: parameter insignificant p-value<0.05 reject H0 19

20 11. You can save the residuals of model by choosing Save->Residuals in the window with models characteristics

21 ACF for uhat6 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 2 4 6 8 10 12 14 16 lag PACF for uhat6 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 2 4 6 8 10 12 14 16 lag

TEST of ARCH effect in residuals 22

GARCH models 23

GARCH model 24

Example data_gretl.xls 25

Density 26 Example data_gretl.xls 30 Test statistic for normality: Chi-squared(2) = 42.977 pvalue = 0.00000 Data N(0.0037189,0.01697) 25 20 15 10 5 0-0.04-0.02 0 0.02 0.04 0.06 Data

27 Example data_gretl.xls ACF for Data 0.2 +- 1.96/T^0.5 0.1 0-0.1-0.2 0 2 4 6 8 10 12 14 16 lag PACF for Data 0.2 +- 1.96/T^0.5 0.1 0-0.1-0.2 0 2 4 6 8 10 12 14 16 lag

28

29

30 Residual ACF 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 5 10 15 20 lag Residual PACF 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 5 10 15 20 lag

31

32 check the normality of ARMA residuals do the ARCH test

33 Test for normality of residual - Null hypothesis: error is normally distributed Test statistic: Chi-square(2) = 21.7633 with p-value = 1.88e-005

34

35 Test for ARCH of order 5 - Null hypothesis: no ARCH effect is present Test statistic: LM = 92.6072 with p-value = P(Chi-square(5) > 92.6072) = 1.90273e-018 Test for ARCH of order 5 coefficient std. error t-ratio p-value ---------------------------------------------------------- alpha(0) 0.000137679 1.99112e-05 6.915 8.41e-012 *** alpha(1) 0.175695 0.0316164 5.557 3.53e-08 *** alpha(2) 0.0596048 0.0318745 1.870 0.0618 * alpha(3) 0.0377358 0.0319088 1.183 0.2372 alpha(4) 0.120201 0.0318733 3.771 0.0002 *** alpha(5) 0.105740 0.0316159 3.345 0.0009 ***

36

Density standardized residuals 0.45 0.4 Test statistic for normality: Chi-squared(2) = 3.736 pvalue = 0.15440 uhat6 N(0.01685,1.0021) 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0-3 -2-1 0 1 2 3 uhat6 37

squared residuals of ARMA model 38

39 squared standardized residuals ACF for usq6 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 5 10 15 20 lag PACF for usq6 0.08 0.06 0.04 0.02 0-0.02-0.04-0.06-0.08 +- 1.96/T^0.5 0 5 10 15 20 lag

Density 40 if it is not Gaussian distribution we need t-student distribution or skewed t-st leverage effect OX + G@rch 0.45 0.4 Test statistic for normality: Chi-squared(2) = 3.736 pvalue = 0.15440 uhat6 N(0.01685,1.0021) 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0-3 -2-1 0 1 2 3 uhat6