23
Building and Employing a SOE Model using IRIS-Toolbox for Matlab Michal Andrle IMF/RES Economic Modeling Unit Washington, D.C. March 10-11, 2011 Michal Andrle (IMF/RES) Building and Employing a SOE Model 1 / 23

Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Building and Employing a SOE Modelusing IRIS-Toolbox for Matlab

Michal Andrle

IMF/RES Economic Modeling Unit

Washington, D.C. March 10-11, 2011

Michal Andrle (IMF/RES) Building and Employing a SOE Model 1 / 23

Page 2: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

OutlineThe goal of the talk/course is to provide a ’hands on’ experience of building a smallopen economy model.

1. Building a SOE modelI infrastructure & software – quick reviewI reviewing stylised factsI motivating the model structure

2. The Model – parameterization & propertiesI parametrization, evaluating IRFsI pseudo-real time forecasting properties, model’s moments

3. Creating scenarios & baseline forecastI topical scenarios exercisesI determining initial conditions, output-gap estimation, interpreting historyI conditioning on exogenous assumptionsI imposing expert judgementI detailed analytics of the forecast dynamics (decomposition)

Focus on both economics & technique/infrastructure development. We’ll work with the model code and run scenarios. . .

Michal Andrle (IMF/RES) Building and Employing a SOE Model 2 / 23

Page 3: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Technical Infrastructure & SoftwareThe project is based on the following components:

1. MATLABI linear algebra numerical software, OOP support, weakly-typed, interpreted

language and computing system (based on Fortran, C++ & Java)I understanding ‘object-oriented approach’ – exercises, getting the intuition

2. IRIS-ToolboxI Matlab-based Object-Oriented toolbox for DSGE modelling and time seriesI enriches Matlab with new types/objects (time series, model, database,. . . )

3. LATEX, GITI LATEX used as a back-end for generating PDF reportsI GIT distributed version control system keeps track of our project, changes

and branches

Michal Andrle (IMF/RES) Building and Employing a SOE Model 3 / 23

Page 4: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Stylised Facts (Indonesia)

...TBA

Michal Andrle (IMF/RES) Building and Employing a SOE Model 4 / 23

Page 5: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Model

The model is a reduced-form DNK model in line with GPM-philosophyTheoretical motivation with New Keynesian monetary economics

Flexible & pragmatic approach for forecasting and policy analysis

Focus on business cycle frequencies

Deviations from a canonical IMF’s GPM-SOEAccounting for a trend in real exchange rate

Explicit treatment of administrated/regulated prices

Rest-of-the-World (RoW) block treated as closed economy GPM

Minor variations in dynamic specification

Michal Andrle (IMF/RES) Building and Employing a SOE Model 5 / 23

Page 6: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – A Bird’s Eye View

Simplified version of core behavioral relationships:

yt = β1yt+1 + β2yt−1 − β3(it − πt+1) + β4y∗t + β5zt + εyt (1)

πt = λ1πt+1 + (1 − λ1)πt−1 + λ3yt + λ4zt + επt (2)

it = γ1it−1 + (1 − γ1)[it + γ2(π4t+3 − π4t+3) + γ3yt

]+ εi

t (3)

it = i∗t + set+1 − st + premt (4)

Trend-cyclical structure: Xt = Xt + xt

the model does not feature complete trend-cycle dichotomy

flexible trend specification; either AR(1) or version of LLT model

Xt = Xt−1 + Gt + εXt εX

t ∼ N(0, σ2X ) (5)

Gt = ρGt−1 + (1 − ρ)Gss + εGt εG

t ∼ N(0, σ2G) (6)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 6 / 23

Page 7: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – A Bird’s Eye View (ii)

Trend Real-Exchange Rate AppreciationTrend real exchange rate appreciation featured in many transition economies (productivitygains in non-traded goods, HBS effect)

Hybrid-Uncovered Interest Parity (UIP) needs to be modified

it = i?t + set+1 − st + premt (7)

set+1 = σst+1 + (1− σ)

{st−1 + (dz t − π∗t + πt )

}(8)

Steady-state key arbitrage relationship:

r = r∗ + dz + prem ⇐⇒ i − i∗ = prem + ds + π∗ − π (9)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 7 / 23

Page 8: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – A Bird’s Eye View (iii)

Administrative pricesExogenous process for contribution of administrated prices to headline CPI

Weight of admin. prices in headline 18%

In practise, not ‘truly’ exogenous – hydrocarbons and energy prices,. . .

Parameter “ρ” co-determines ‘expectations-spillovers’ and the transmission mechanism

πt = απnett + (1 − α)πadm

t + εwt (10)

πadmt = ρπadm

t−1 + (1 − ρ)πss + εadmt (11)

Commodity prices

TBA

Michal Andrle (IMF/RES) Building and Employing a SOE Model 8 / 23

Page 9: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – Parametrization (i)

There are three groups of parameters

Steady-state parameters & ‘equilibriums’– inflation targets, equilibrium real interest rate, potential output growth,. . .

Dynamic parameters– persistence, output gap & exchange rate loadings,. . .

Stochastic parameters– std. errors of shocks and measurement errors

Calibration vs. EstimationShort, noisy and unreliable data

The economy evolves very quickly, the model is built for recent and future economicdevelopment

Identification problems, which Bayesian methods do not solve

Michal Andrle (IMF/RES) Building and Employing a SOE Model 9 / 23

Page 10: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – Parametrization (ii)

Parameterization is tested by reviewing many model properties:

(i) Economics of Impulse Response Function (IRF)

(ii) Transfer function properties in time and frequency domain

(iii) Quasi real-time historical forecasting performance

(iv) Interpretation of historical shock decomposition

(v) . . .

Best is the enemy of the ‘good’. . .

Michal Andrle (IMF/RES) Building and Employing a SOE Model 10 / 23

Page 11: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model – Impulse Response Function (iii)

Impulse Response Functions (IRF) – ‘hands on exercises’Demand & Supply/Cost-push ShocksExchange rate, monetary policy, administrated pricesUnderstanding disinflation in the model, ...

5 10 15 20

0

0.1

0.2

0.3

Nominal interest rate, (%)

5 10 15 20

−0.1

0

0.1

0.2

Real Interest Rate, (%)

5 10 15 20

−0.05

0

0.05

0.1

0.15

0.2

0.25

CPI Inflation, YoY (%)

5 10 15 20

0

0.2

0.4

0.6

0.8

1

Output Gap, (%)

5 10 15 20

0

0.1

0.2

0.3

CPI Inflation, (QoQ %)

5 10 15 20

−0.5

0

0.5

1

GDP Growth, (YoY %)

5 10 15 20

0

1

2

3

4

GDP Growth, (QoQ %)

5 10 15 20

−0.8

−0.6

−0.4

−0.2

0

Real Exchange Rate Gap, (%)

5 10 15 20

−2

−1.5

−1

−0.5

0

0.5

ER Depreciation, (%)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 11 / 23

Page 12: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

The Model — Properties evaluation. . . (iv)

1999:4 2001:4 2003:4 2005:4 2007:4 2009:4 2011:40

2

4

6

8

10

12

14

16

18

20CPI Inflation (YoY, %)

1999:4 2001:4 2003:4 2005:4 2007:4 2009:4 2011:41

2

3

4

5

6

7GDP Growth (YoY, %)

2000:4 2001:4 2002:4 2003:4 2004:4 2005:4 2006:4 2007:4 2008:4 2009:4−10

−5

0

5

10

15

20CPI Inflation (YoY,%)

IC+TargetygapcpidybarprempadmRoWetasrermp−shockother1−rest−

0 5 10 15 20 25 30 350

0.2

0.4

0.6

0.8

1

1.2

1.4Output Gap (FEVD,normalized)

RES_YGAPRES_CPIRES_YGAP_STARRES_CPI_STARRES_I

Michal Andrle (IMF/RES) Building and Employing a SOE Model 12 / 23

Page 13: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Building Scenarios – Exercises & Analysis

Falling behind the curve – delayed monetary policyI monetary accommodation dynamics implicationsI the role of anticipations and credibilityI understanding economics and mathematics of reactions to anticipated events

Administrative prices – expectations spilloversI expectation spillovers – the persistence of beliefsI the role of forcing terms in conditioning on exogenous variables

Reserve requirements & risk-premiumsI simulating ‘reserve-requirements’ changes in reduced form DNK model (?)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 13 / 23

Page 14: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast

Analyzing the initial state of the economyI output-gap and potential output growthI real exchange rate trend, risk premiumsI interpreting the history using the model,. . .

Conditioning informationI foreign economy development, inflation target, regulated pricesI implementing ‘now-casts’ and near-term forecastsI imposing expert-judgement

Forecast dynamics decomposition and analysisI factors behind the forecast, delta-accounting w.r.t previous forecastI sensitivity analysis & scenarios

Michal Andrle (IMF/RES) Building and Employing a SOE Model 14 / 23

Page 15: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Initial StateThree basic approaches

UnivariateI ad-hoc detrending methods, pros & consI HP/Leser filter, imposing prior restrictions

Multivariate UC models with ad-hoc detrendingI pros & consI IMF’s ’ModYUC’ model, structure and properties

Model consistent filter & ‘structural’ shocks identificationI most challenging, consistent and insightful variantI running counter-factual simulations

Michal Andrle (IMF/RES) Building and Employing a SOE Model 15 / 23

Page 16: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Initial State (ii)

Univariate detrendingStochastic trends extracted by band-pass or high pass Filtering (e.g. HP filter)Not much economics, business cycle identified with frequency-domain arguments (e.g.6-32 quarters cycles)Plain/naive HP filter features very unpleasant ‘end-point properties’ and is ill-suited forreal-time analysisContrary to common belief, the HP/band-pass filter does not induce spurious cycles. HP isnot very ‘sharp’ filter, its gain is quite smooth

Prior-Consistent (LRX) filter with prior restrictions (exercise)User can impose the trend growth rate or the size of the gap with arbitrary precisionRe-formulate the LLT problem with additional constraints, see e.g. Berg et al. (2006b)

min{Tt}T1

=T∑

t=1

[(Yt − Tt )

2 + λ(∆2Tt )2]

+ (12)

+∑i∈PY

λYi {(Yi − Ti )− Y fix

i }2 +

∑j∈PT

λTj {(Tj − Tj−1)− Gfix

j }2

Michal Andrle (IMF/RES) Building and Employing a SOE Model 16 / 23

Page 17: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Initial State (ii)

Multivariate methods of trend-cyclical decompositionCombination of stochastic-trends with restrictions based on economic theory, most often aPhillips Curve and ‘Okun’s Law’

Can employ multiple indicators of ‘output gap’ – capacity utilisation, unemployment,. . . tosearch for co-cycles and phase-shifts

Most convenient to cast into state-space form, particularly due to very easy handling ofmissing observations

Model-Consistent Estimation of Initial ConditionsIdentification of unobserved variables using the complete REE model

The State-Space form of the ARIMBI model analyzed using the insights from Kalman &WK filtering

Allows to interpret the past development of the economy using the model optics and carryout counterfactual scenarios

Output-gap estimates are consistent with the model and may/should differ from naivead-hoc approaches

For theory of Kalman and WK filters, see Anderson and Moore (1979) and Wiener (1949)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 17 / 23

Page 18: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Initial State (iii)

Initial Conditions (exercises & discussion)Counterfactuals – acatual vs. model-based estimates of policy rates‘Full-filter’ estimate vs. HP estimates of output-gapHistorical shock decompositions – taking the challenge

2001:1 2002:1 2003:1 2004:1 2005:1 2006:1 2007:1 2008:1 2009:1 2010:16

8

10

12

14

16

18Nominal Policy Rate: Actual vs. Implied

actualimplicit

1999:4 2001:4 2003:4 2005:4 2007:4 2009:4 2011:4−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5Estimated Output−Gap

arimbi−filterhp−filter

2000:4 2001:4 2002:4 2003:4 2004:4 2005:4 2006:4 2007:4 2008:4 2009:4−10

−5

0

5

10

15

20CPI Inflation (YoY,%)

IC+TargetygapcpidybarprempadmRoWetasrermp−shockother1−rest−

Michal Andrle (IMF/RES) Building and Employing a SOE Model 18 / 23

Page 19: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Conditioning Information

Conditioning informationThe forecast features endogenous interest rate responseConditioning on selected variables and pieces of information

I RoW: foreign interest rate, inflation and pricesI Inflation target evolutionI Evolution of exogenous trends & equilibrium values (potential output, etc.)

Imposing expert judgmentImposing values of selected macro-variables by a specified path of structuralshocks

I key question is selecting a particular shock to create a ‘story’ (e.g. demand or supplyhigher inflation pressures?)

Hard-tunes vs. ‘Soft-tunes/WZ’I Hard-tunes – point fix of a variable by a point shock impulseI Soft-tunes/Waggoner-Zha – select ‘most likely’ set of shocks

Algorithm used is a generalization of Waggoner and Zha (1999) allowing for anticipated shocks, described in Andrle(2007)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 19 / 23

Page 20: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Baseline Forecast – Dynamics & Analysis

Apart from economic reasoning, formal methods help toUnderstand and communicate the dynamics behind the baselineExplain deviations from the previous forecast and thusProvide clear picture why new interest rate path is projected

2010:4 2011:2 2011:4 2012:2 2012:4 2013:2 2013:4−1.5

−1

−0.5

0

0.5

1

1.5Baseline Forecast Dynamics: Nominal Policy Rate (ppt. dev from SS)

Past Infl.RoW (a)IR perist.FX premRoW (b)Infl. Targetrer gapcommod. pricesEquilibrium RIRother

For details & actual use, see Andrle et. al (2009a) and CNB Infl. ReportsMichal Andrle (IMF/RES) Building and Employing a SOE Model 20 / 23

Page 21: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Thank you for your attention.

Michal Andrle (IMF/RES Modeling Unit)

Michal Andrle (IMF/RES) Building and Employing a SOE Model 21 / 23

Page 22: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

Hands-On Exercises in Matlab

List of core exercises:(i) Object-oriented programming – a primer (talking cats & dogs. . . ?)

(ii) Inspecting the model object & databases

(iii) Importance of version control for the project, examples (GIT, SVN, etc.)

(iv) Writing (understanding and modifying) a flexible IRFs simulator & reporting

(v) Running IRFs with multiple parameterizations, sensitivity analysis

(vi) Building scenarios– falling behind the curve, administrated prices, RoW, . . .

(vii) Initial conditions identification– HP/Leser filter with priors, Kalman filter basics, shock-decompositions

– running historical counter-factual, missing observations

(viii) Simulation dynamics decompositions– baseline forecast delta-accounting, new vs. old forecast, scenario comparison

Michal Andrle (IMF/RES) Building and Employing a SOE Model 22 / 23

Page 23: Building and Employing a SOE Model - MICHAL ANDRLE · 2018. 9. 7. · Outline The goal of the talk/course is to provide a ’hands on’ experience of building a small open economy

References1. Anderson, B.D.O. and J.B. Moore: Optimal Filtering, Prentice-Hall, N.J., 1979

2. Andrle, M., T. Hledik, O. Kamenik and J. Vlcek: Implementing the New Structural Model of the Czech National Bank , CNBWP No. 2, 2009a

3. Andrle, M., Ch. Freedman, R. Garcia-Saltos, D. Hermawan, D. Laxton and H. Munandar: Adding Indonesia to the GlobalProjection Model, IMF WP/09/253, 2009b

4. Andrle, M.: Simulating linear state-space models, Czech National Bank mimeo, 2007

5. Berg, A., P. Karam, and D. Laxton: A Practical Model-Based Approach to Monetary Policy Analysis – Overview, IMF WorkingPaper WP/06/80, 2006

6. Berg, A., P. Karam, and D. Laxton: Practical Model-Based Monetary Policy AnalysisA How-To Guide, IMF WP 06/81, 2006b

7. Waggoner, D. and T. Zha: Conditional Forecasts In Dynamic Multivariate Models, The Review of Economics and Statistics,MIT Press, vol. 81(4), pages 639-651, November

8. Wiener, N.: Extrapolation, Interpolation, and Smoothing of Stationary Time Series, MIT Press, 1949

9. Chacon, S.: Pro Git, Everything you need to know about the Git distributed source control tool, APress, 2009

Michal Andrle (IMF/RES) Building and Employing a SOE Model 23 / 23