• No results found

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

N/A
N/A
Protected

Academic year: 2021

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

Copied!
40
0
0

Loading.... (view fulltext now)

Full text

(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)

(4)

1. How to get and install gretl

a) Go to page

http://gretl.sourceforge.net/ or www.gretl.pl

and download gretl

(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

(6)

Choose Wybór j

ę

zyka dla GUI -> English

or Language Preserence -> Polish

(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)

(8)
(9)
(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

(12)

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

(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:

(14)
(15)

8. Checking of normality:

Variable -> Frequency distribution

Variable -> Frequency distribution-> Against Normal

-10 -8 -6 -4 -2 0 2 4 6 -4 -3 -2 -1 0 1 2 3 4 Normal quantiles

Q-Q plot for rates y = x

(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

-1 -0.5 0 0.5 1 0 2 4 6 8 10 12 14 16 lag

ACF for Data

+- 1.96/T^0.5 -1 -0.5 0 0.5 1 0 2 4 6 8 10 12 14 16 lag

PACF for Data

+- 1.96/T^0.5

(18)

10. Estimating ARMA processes:

a) Model -> Time series -> ARIMA…

b) Choose dependent variable.

(19)

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

(20)

11. You can save the residuals of model by choosing

(21)

-0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0 2 4 6 8 10 12 14 16 lag

ACF for uhat6

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

PACF for uhat6

(22)
(23)
(24)
(25)
(26)

0 5 10 15 20 25 30 -0.04 -0.02 0 0.02 0.04 0.06 Density Data Data N(0.0037189,0.01697) Test statistic for normality:

Chi-squared(2) = 42.977 pvalue = 0.00000

Example

(27)

Example – data_gretl.xls

-0.2 -0.1 0 0.1 0.2 0 2 4 6 8 10 12 14 16 lag

ACF for Data

+- 1.96/T^0.5 -0.2 -0.1 0 0.1 0.2 0 2 4 6 8 10 12 14 16 lag

PACF for Data

(28)
(29)
(30)

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

(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

(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)
(37)

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 -3 -2 -1 0 1 2 3 Density uhat6 N(0.01685,1.0021) Test statistic for normality:

Chi-squared(2) = 3.736 pvalue = 0.15440

(38)
(39)

-0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0 5 10 15 20 lag ACF for usq6

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

+- 1.96/T^0.5

(40)

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 -3 -2 -1 0 1 2 3 Density uhat6 uhat6 N(0.01685,1.0021) Test statistic for normality:

Chi-squared(2) = 3.736 pvalue = 0.15440

if it is not Gaussian distribution we need t-Student

distribution or skewed t-St

References

Related documents

This predictive, correlational study is designed to examine the relationship between the technology efficacy of gender, generation (baby boomers, millennials, and generation X), and

Dalam paper ini, fokus penelitiannya adalah penerapan ciri untuk mesin pengklasifikasi ekspresi wajah dari citra statis dengan pengklasifikasian menggunakan jaringan

Ekspres Tren Tur Karti cost 210 TRY - Sleeping Car Train Tour Card (Yatakli Tren Tur Karti) allows holder to travel free on the entire Turkish rail network for 30 days

Specialty section: This article was submitted to Cellular Biochemistry, a section of the journal Frontiers in Chemistry Received: 18 December 2015 Accepted: 22 April 2016 Published:

Below are key principles for Operators when providing information to the public about Games Bets. The key principles are relevant to all forms of promotion, marketing,

The population surveyed included all students of foreign languages in courses that use the language lab at Southern Illinois University at Carbondale, a large

In t his article, brand equity is approached from the consumers’ point of view i.e., consumer -based brand equity (CBBE) in the context of two beer brands offered in Poland –

To put the question a different way, she is almost one standard deviation above the average height; how many standard deviations above the average weight should we expect her to