• No se han encontrado resultados

p1_ts.pdf

N/A
N/A
Protected

Academic year: 2020

Share "p1_ts.pdf"

Copied!
30
0
0

Texto completo

(1)

UNIVARIATE BAYESIAN MODELING

Spanish Treasury Bills 12m

Enrique M. Quilis

(2)

CONTENTS

Exploratory analysis

AR modeling

Litterman prior

Calibration

Estimation

Estimation

Analysis

(3)

MATLAB CODE: Commands

>> cstr=cal(1987,6,12)

cstr =

beg_yr: 1987

beg_yr: 1987

beg_per: 6

freq: 12

(4)

SERIES

10 12 14 16

Jan850 Jan90 Jan95 Jan00 Jan05

(5)

MATLAB CODE: Commands

(6)

SERIES: CORRELOGRAMS

0.6 0.8 1

Sample autocorrelation coefficients

s a c f v a lu e s 0.6 0.8 1

Sample partial autocorrelation coefficients

s p a c f v a lu e s

0 10 20 30 -0.2 0 0.2 0.4 k-values s a c f v a lu e s

(7)

MATLAB CODE: Commands

>> pmax=14

pmax =

14

14

(8)

ORDER SELECTION

0.45 0.5 0.55 0.6 0.65

AIC

0.55 0.6 0.65 0.7

BIC

0 5 10 15

0.2 0.25 0.3 0.35 0.4

AR order

0 5 10 15

0.35 0.4 0.45 0.5

(9)

LITTERMAN PRIOR

Underlying model: univariate

autoregression with exogenous variables

t

h

t

p

1

h

h

t

t

b

'

x

z

u

z

=

+

+

+

=

(10)

LITTERMAN PRIOR

ARX model in compact notation:

1

[

]

t

t

t

t

p

t

t

u

X

u

z

L

x

1

'

b

z

+

=

+

(11)

LITTERMAN PRIOR

u

z

)

B

1

(

=

µ

+

Mean centered around a random walk with

drift:

t

t

u

z

)

B

1

(12)
(13)

LITTERMAN PRIOR: Variance

=

=

)

(

)

(

v

)

V

(

diag

2

σ

θ

µ

µ

=

=

h

)

)

(

g

(

)

(

v

)

V

(

diag

2

2

h

1

h

θ

θ

σ

φ

(14)

LITTERMAN PRIOR: Variance

θ

µ

>0

θ

b

>0

θ

>0

σ

derived from BARX(p) model (unrestricted

(15)

LITTERMAN PRIOR: Variance

Temporal decay

=

1

h

1

0

1

g

θ

θ

<

=

1

h

0

h

g

1

θ

(16)

LITTERMAN PRIOR: Variance

Temporal decay

0.6 0.7 0.8 0.9 1 Geometric 0.1 0.5 0.9 0.6 0.7 0.8 0.9 1 Harmonic 0.1 0.5 0.9

1 2 3 4 5 6 0 0.1 0.2 0.3 0.4 0.5 Lag

(17)

LITTERMAN PRIOR: Variance

0.6 0.8 1 1.2

Prior on phi parameters: th1=0.1 th2=0.5

1 1.5 2

Prior on phi parameters: th1=1 th2=0.5

0 1 2 3 4 5 6 7 -0.2

0 0.2 0.4 0.6

0 1 2 3 4 5 6 7 -1

(18)

LITTERMAN PRIOR: Calibration

1.325 1.33 1.335

MSE

1.326 1.328 1.33 1.332 1.334

0.01

0.41

0.91

1.41 0.01

0.41

0.91

1.41 1.31

1.315 1.32

th2 th1

(19)

LITTERMAN PRIOR: Calibration

1.315 1.316 1.317

MSE

1.3145 1.315 1.3155 1.316

0.01

0.01

0.10 1.31

1.311 1.312 1.313 1.314

(20)

LITTERMAN PRIOR: Calibration

θ

µ

θ

1

θ

2

σ

2

0.00

0.04

0.05

0.07

θ

µ

θ

1

θ

2

σ

2

(21)

MATLAB CODE: Prior generation

close all; clc; clear all;

% Yield on Letras 12m: 1987.06 - 2007.03 z = load('y1.prn');

% Exogenous variables rex.X = [];

% Intercept: yes (1) or not (0) rex.opC = 1;

% Basic variable rex.z = z;

% Order of AR model rex.p = 6;

%---% Generating Litterman prior

%Type of decay function: harmonic (1) or geometric (2) rex.type = 1;

rex.th_mu = 1000; rex.th_b = 1000; rex.th = [0.10 0.05];

(22)

LITTERMAN PRIOR: Calibration

0.6 0.7 0.8 0.9 1

Decay function: harmonic

0.6 0.8 1 1.2

Prior on phi parameters

0 1 2 3 4 5 6 7 0

0.1 0.2 0.3 0.4 0.5 0.6

Lag

0 1 2 3 4 5 6 7 -0.2

0 0.2 0.4 0.6

(23)

MATLAB OUTPUT: Estimation

********************************************************************** ARX MODEL: BAYESIAN ESTIMATION

********************************************************************** LITTERMAN PRIOR

Hyperparameters: tightness Intercept 0.0000 Exogenous 1000.0000 Decay function: harmonic

Global 0.1000 Decay 0.0500

********************************************************************** Number of observations : 239

Number of effective observations : 233 Number of effective observations : 233 Number of series : 1 Number of lags : 6

********************************************************************** mu: Estimate, standard deviation and t-ratio (read columnwise)

---0.0000 ---0.0000 0.0001

---phi: Lag, estimate, standard deviation and t-ratio (read columnwise)

(24)

MATLAB CODE: Estimation

********************************************************************** ARX MODEL: BAYESIAN ESTIMATION

**********************************************************************

---RESIDUALS: standard deviation 0.2693

---Model performance (read columnwise):

- log-likelihood - log-likelihood - AIC and BIC - BIC

---24.9411 0.2742 0.3779

(25)

MATLAB CODE: Estimation

0.2 0.4 0.6 0.8 1

Sample autocorrelation coefficients

s a c f v a lu e s 0.2 0.4 0.6 0.8 1

Sample partial autocorrelation coefficients

(26)

MATLAB CODE: Outliers

0.5 1 1.5

Jul87 Jan90 Jul92 Jan95 Jul97 Jan00 Jul02 Jan05

(27)

MATLAB CODE: Analytics

0 10 20 30 40 0

0.5 1 1.5 2

PHI-WEIGHTS

0 2 4 6 8

-1.5 -1 -0.5 0 0.5

PI-WEIGHTS

lag lag

-0.5 0 0.5 1

6 ROOTS

2 4 6 8 10

(28)

MATLAB CODE: Forecasting

close all; clc; clear all;

% Yield on Letras 12m: 1987.06 - 2007.03 z = load('y1.prn');

% Exogenous variables: unit step 1999.01 - 2007.12 (EMU) rex.X = [];

% Intercept: yes (1) or not (0) rex.opC = 1;

% Basic variable % Basic variable rex.z = z;

% Order of AR model rex.p = 6;

%---% Generating Litterman prior

%Type of decay function: harmonic (1) or geometric (2) rex.type = 1;

rex.th_mu = 0.0000000001; rex.th_b = 1000;

rex.th = [0.10 0.05];

rex.plt = 0; %Plots or no plots

(29)

MATLAB CODE: Forecasting

---% Calling estimation function

res = barx(rex,prior);

%---% Number of forecasts

rex.npred = 9;

% Preparing forecasts of exogenous variables % rex.Xf = ones(rex.npred,1);

rex.Xf = [];

% Generating forecasts fore = upredict(rex,res);

% Joining forecasts and data

zz = [z fore.zf]; zli = [z

fore.zf - fore.sf]; zls = [z

(30)

MATLAB CODE: Forecasting

4 4.5 5 5.5

Forecasts and +/- s.e.

2004 2005 2006 2007 1.5

2 2.5 3 3.5

Referencias

Documento similar

Based on this situation, the Ministry of Economy of the state began a study to propose a strategy for the integral development of this region, favoring enterprises that use mainly

University of Aston, Language Studies Unit Research Report, Department of Modern Languages.. Anguish as a

Regarded with the foreign penetration the effect depend on the level of banking competition in different countries, is a good policy to reduce the structural barriers in countries

Least Squares Initialisation (LSI) has the aim of improving the initial conditions of partially initialised systems by utilizing the information from observations of limited

This research was partially funded by the Spanish Government Ministry of Economy and Competitiveness through the DEFINES project grant number (TIN2016-80172-R) and the Ministry

Journal of Applied Research and Technology 16 (2018) 276-286. Angela Jennifa Sujana

Department of Energy; the Italian National Institute for Nuclear Physics (INFN); the German Federal Ministry for Education and Research (BMBF), under Contract No. 05 H09PDF; the

^ Collaborators included: 1) Indonesian Foresíry and Estáte Crops Research and Development Agency (FERDA) 2) Indonesian Ministry of Foresíry and Estáte Crops; 3) Center for