State-space Model. Eduardo Rossi University of Pavia. November Rossi State-space Model Fin. Econometrics / 53

Similar documents
State-space Model. Eduardo Rossi University of Pavia. November Rossi State-space Model Financial Econometrics / 49

X t = a t + r t, (7.1)

A Practical Guide to State Space Modeling

Part I State space models

ARIMA Modelling and Forecasting

Time-Varying Parameters

ECO 513 Fall 2008 C.Sims KALMAN FILTER. s t = As t 1 + ε t Measurement equation : y t = Hs t + ν t. u t = r t. u 0 0 t 1 + y t = [ H I ] u t.

TIME SERIES ANALYSIS. Forecasting and Control. Wiley. Fifth Edition GWILYM M. JENKINS GEORGE E. P. BOX GREGORY C. REINSEL GRETA M.

Week 5 Quantitative Analysis of Financial Markets Characterizing Cycles

July 31, 2009 / Ben Kedem Symposium

7 Day 3: Time Varying Parameter Models

State-Space Model in Linear Case

Lecture 16: State Space Model and Kalman Filter Bus 41910, Time Series Analysis, Mr. R. Tsay

Forecasting with ARMA

Financial Econometrics and Volatility Models Estimation of Stochastic Volatility Models

Lecture 4: Least Squares (LS) Estimation

Prof. Dr. Roland Füss Lecture Series in Applied Econometrics Summer Term Introduction to Time Series Analysis

Switching Regime Estimation

Multivariate GARCH models.

Università di Pavia. Forecasting. Eduardo Rossi

Exogeneity and Causality

Measurement Errors and the Kalman Filter: A Unified Exposition

Class: Trend-Cycle Decomposition

Parameter Estimation for ARCH(1) Models Based on Kalman Filter

Lecture 2: Univariate Time Series

GARCH Models Estimation and Inference

at least 50 and preferably 100 observations should be available to build a proper model

Multivariate probability distributions and linear regression

Introduction to Stochastic processes

Econ 623 Econometrics II Topic 2: Stationary Time Series

Univariate Nonstationary Time Series 1

Trend-Cycle Decompositions

Estimation of Dynamic Regression Models

Linear models and their mathematical foundations: Simple linear regression

Discrete time processes

Chapter 9: Forecasting

Generalized Autoregressive Score Smoothers

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Estimating Missing Observations in Economic Time Series

Statistics 910, #15 1. Kalman Filter

Chapter 6. Maximum Likelihood Analysis of Dynamic Stochastic General Equilibrium (DSGE) Models

Cointegrated VAR s. Eduardo Rossi University of Pavia. November Rossi Cointegrated VAR s Financial Econometrics / 56

Research Division Federal Reserve Bank of St. Louis Working Paper Series

STRUCTURAL TIME-SERIES MODELLING

Linear Models and Estimation by Least Squares

Appendix A: The time series behavior of employment growth

Empirical Market Microstructure Analysis (EMMA)

Identifying Aggregate Liquidity Shocks with Monetary Policy Shocks: An Application using UK Data

Multivariate State Space Models: Applications

Vector autoregressions, VAR

Time Series Models and Inference. James L. Powell Department of Economics University of California, Berkeley

Siem Jan Koopman Marius Ooms

Ch. 15 Forecasting. 1.1 Forecasts Based on Conditional Expectations

Title. Description. var intro Introduction to vector autoregressive models

GARCH Models Estimation and Inference

Econ 423 Lecture Notes: Additional Topics in Time Series 1

Class 1: Stationary Time Series Analysis

ECON 3150/4150, Spring term Lecture 6

Some Time-Series Models

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Discussion of Bootstrap prediction intervals for linear, nonlinear, and nonparametric autoregressions, by Li Pan and Dimitris Politis

Labor-Supply Shifts and Economic Fluctuations. Technical Appendix

Time Series I Time Domain Methods

Statistics Homework #4

4 Derivations of the Discrete-Time Kalman Filter

Linear Dynamical Systems

Time Series: Theory and Methods

Economics Department LSE. Econometrics: Timeseries EXERCISE 1: SERIAL CORRELATION (ANALYTICAL)

ENGR352 Problem Set 02

Dynamic Regression Models

ECE 541 Stochastic Signals and Systems Problem Set 9 Solutions

The Kalman Filter. An Algorithm for Dealing with Uncertainty. Steven Janke. May Steven Janke (Seminar) The Kalman Filter May / 29

Lecture 4: Dynamic models

FaMIDAS: A Mixed Frequency Factor Model with MIDAS structure

Elements of Multivariate Time Series Analysis

Machine learning - HT Maximum Likelihood

Forecasting economic time series using unobserved components time series models

Functional time series

Instrumental Variables

Introduction to Estimation Methods for Time Series models. Lecture 1

ECON/FIN 250: Forecasting in Finance and Economics: Section 6: Standard Univariate Models

1 Motivation for Instrumental Variable (IV) Regression

Adaptive State Estimation Robert Stengel Optimal Control and Estimation MAE 546 Princeton University, 2018

ECON/FIN 250: Forecasting in Finance and Economics: Section 7: Unit Roots & Dickey-Fuller Tests

Sample Exam Questions for Econometrics

Non-Stationary Time Series and Unit Root Testing

Factor Analysis and Kalman Filtering (11/2/04)

Generalized Autoregressive Score Models

Volatility. Gerald P. Dwyer. February Clemson University

GARCH Models Estimation and Inference. Eduardo Rossi University of Pavia

Chapter 3 - Temporal processes

TAKEHOME FINAL EXAM e iω e 2iω e iω e 2iω

The Slow Convergence of OLS Estimators of α, β and Portfolio. β and Portfolio Weights under Long Memory Stochastic Volatility

A new unscented Kalman filter with higher order moment-matching

TREND ESTIMATION AND THE HODRICK-PRESCOTT FILTER

Estimating the term structure of mortality

Nonlinear Parameter Estimation for State-Space ARCH Models with Missing Observations

If we want to analyze experimental or simulated data we might encounter the following tasks:

Vector Auto-Regressive Models

Univariate Time Series Analysis; ARIMA Models

Transcription:

State-space Model Eduardo Rossi University of Pavia November 2014 Rossi State-space Model Fin. Econometrics - 2014 1 / 53

Outline 1 Motivation 2 Introduction 3 The Kalman filter 4 Forecast errors 5 State smoothing 6 Disturbance smoothing 7 Missing observations 8 Forecasting 9 Initialization 10 Parameter estimation 11 Linear Gaussian state space model 12 Examples of S-S specifications UC models in S-S form ARIMA in S-S form 13 Kalman filter recursions Rossi State-space Model Fin. Econometrics - 2014 2 / 53

Motivation Example Basic linear regression model y t = x tβ + ɛ t t = 1,..., T x t is observed. Latent factor model: y t = s tλ + u t where s t is a (K 1) vector of unobserved or latent factors, and λ is the vector of factor loadings. Rossi State-space Model Fin. Econometrics - 2014 3 / 53

Motivation Latent factor models The latent factor class of model is encountered frequently in economics and finance and prominent examples include 1 multi-factor models of the term structure of interest rates, 2 dating of business cycles, 3 the identification of ex ante real interest rates, 4 real business cycle models with technology shocks, 5 the APT model 6 models of stochastic volatility. A number of advantages stem from being able to identify the existence of a latent factor structure underlying the behaviour of economic and financial time series. 1 it provides a parsimonious way of modelling dynamic multivariate systems. (the curse of dimensionality arises even in relatively small systems of unrestricted VARs). 2 it avoids the need to use ad hoc proxy variables for the unobservable variables which can result in biased and inconsistent parameters estimates. Rossi State-space Model Fin. Econometrics - 2014 4 / 53

Motivation Latent factor models Despite the fact that it is latent, the factor s t can nonetheless be characterized via the time series properties of the observed dependent variables. The system of equations capturing this structure is commonly referred to as state-space (S-S) form and the technique that enables this identification and extraction of latent factors is known as the Kalman filter. An important assumption underlying the Kalman filter is that of normality of the disturbance terms impacting on the system. The assumption of normality makes it possible to summarize the entire distribution of the latent factors using conditional means and variances alone. Consequently, these moments feature prominently in the derivations of the recursions that define the Kalman filter. For the case in which the assumption of normality of the disturbance terms is inappropriate, a quasi-maximum likelihood estimator may be available. Rossi State-space Model Fin. Econometrics - 2014 5 / 53

Motivation Term Structure of Interest Rates In the case of a single latent factor, K = 1, the term structure model for interest rates is r i,t = λ i s t + u i,t i = 1,..., N N maturities (e.g. three months, one year, three years, five years, seven years, and ten years). s t is a latent factor and u i,t i.i.d.n(0, σi 2 ). The disturbance term, u i,t, allows for idiosyncratic movements in the i-th yield which are not explained by movements in the factor. This set of equations can be written as a single equation in matrix form as Rossi State-space Model Fin. Econometrics - 2014 6 / 53

Introduction Introduction Basic model for representing a time series is the additive model: y t = µ t + γ t + ɛ t t = 1,..., T µ t is a slowly varying component called the trend; γ t is a periodic component of fixed period called seasonal; ɛ t is the error Rossi State-space Model Fin. Econometrics - 2014 7 / 53

Introduction Local level model Consider µ t = α t y t = α t + ɛ t ɛ t N(0, σ 2 ɛ ) α t = α t 1 + η t η t N(0, σ 2 η) where ɛ t and η t are all mutually independent and are independent of α 1. The purpose The object of the methodology is to infer relevant properties of the α t s from a knowledge of the observations y 1,..., y T. Rossi State-space Model Fin. Econometrics - 2014 8 / 53

Introduction Local level model We assume initially that where a 1, P 1, σ 2 ɛ and σ 2 η are known. The model for y t is non-stationary. α 1 N (a 1, P 1 ) The local level model is an example of a linear Gaussian state space model The variable α t is called the state and is unobserved. Rossi State-space Model Fin. Econometrics - 2014 9 / 53

The Kalman filter The Kalman filter The object of filtering is to update the knowledge of the system each time a new observation y t is brought in. Let and assume that Y t 1 = {y 1,..., y t 1 } α t Y t 1 N (a t, P t ) If a t and P t are known we can calculate a t+1 and P t+1 when y t is brought in. Since a t+1 = E[α t+1 Y t ] = E[α t + η t Y t ] = E[α t Y t ] P t+1 = Var[α t+1 Y t ] = Var[α t + η t Y t ] = Var[α t Y t ] + σ 2 η Rossi State-space Model Fin. Econometrics - 2014 10 / 53

The Kalman filter The Kalman filter Define v t = y t a t = y t E[α t Y t 1 ] and F t = Var(v t ). Then E[v t Y t 1 ] = E[α t + ɛ t a t Y t 1 ] = a t a t = 0 thus E[v t ] = E[E[v t Y t 1 ]] = 0 and Cov[v t, y j ] = E[v t y j ] = E[E[v t Y t 1 ]y j ] = 0 so v t and y j are independent for j = 1, 2,..., t 1. When Y t is fixed Y t 1, y t are fixed v t and Y t 1 are fixed, and viceversa. Rossi State-space Model Fin. Econometrics - 2014 11 / 53

The Kalman filter The Kalman filter Consequently, E[α t Y t ] = E[α t Y t 1, v t ] Var[α t Y t ] = Var[α t Y t 1, v t ] Since all variables are normally distributed, the E[α t Y t ] and Var[α t Y t ] are given by standard formulae from multivariate normal regression theory. Rossi State-space Model Fin. Econometrics - 2014 12 / 53

The Kalman filter The Kalman filter Suppose that x, y and z are random vectors of arbitrary orders that are jointly normally distributed where Σ = with Σ yz = Σ zy = 0 x y z Σ xx Σ xy Σ xz Σ yx Σ yy Σ yz Σ zx Σ zy Σ zz N (µ p, Σ) = Σ xx Σ xy Σ xz Σ yx Σ yy 0 Σ zx 0 Σ zz Rossi State-space Model Fin. Econometrics - 2014 13 / 53

The Kalman filter The Kalman filter Multivariate normal regression E[x y, z] = E[x y] + Σ xy Σ 1 yy z Var[x y, z] = Var[x y] Σ xy Σ 1 yy Σ xy Rossi State-space Model Fin. Econometrics - 2014 14 / 53

The Kalman filter The Kalman filter Proof. By standard multivariate regression theory E[x w] = µ x + Σ xw Σ 1 ww (w µ w ) Var[x w] = Σ xx Σ xw Σ 1 wwσ xw But with w = (y, z ) : Σ ww = because Σ yz = 0, and Σ xw = [Σ xy Σ xz ] [ ] Σyy 0 0 Σ zz [ Σ 1 ] [ yy 0 y µy E[x y, z] = µ x + [Σ xy Σ xz ] 0 Σ 1 zz z = µ x + Σ xy Σ 1 yy (y µ y ) + Σ xz Σ 1 zz z ] since µ z = 0. Rossi State-space Model Fin. Econometrics - 2014 15 / 53

The Kalman filter The Kalman filter Since Var[x w] = Σ xx Σ xw Σ 1 wwσ xw [ Σ 1 Var[x y, z] = Σ xx [Σ xy Σ xz ] yy 0 0 Σ 1 zz ] [ Σ xy = ( Σ xx Σ xy Σ 1 yy Σ ) xy Σxz Σzz 1 Σ xz = Var[x y] Σ xz Σ 1 zz Σ xz Σ xz ] Rossi State-space Model Fin. Econometrics - 2014 16 / 53

The Kalman filter The Kalman filter It follows that E[α t Y t ] = E[α t Y t 1, v t ] = E[α t Y t 1 ] + Cov[α t, v t ] Var[v t ] 1 v t Now, Cov[α t, v t ] = E [α t (y t a t )] = E[α t (α t + ɛ t a t )] = E[αt 2 + α t ɛ t α t a t ] = E[E[αt 2 Y t 1 ]] + E[α t ɛ t ] E[E[α t Y t 1 ]a t ] = E[E[αt 2 Y t 1 ]] E[E[α t Y t 1 ] 2 ] = E [Var[α t Y t 1 ]] = P t and F t Var[v t ] = Var[α t + ɛ t a t ] = Var[α t a t ] + Var[ɛ t ] = E[(α t a t ) 2 ] + Var[ɛ t ] = E[E[(α t a t ) 2 Y t 1 ]] + Var[ɛ t ] = E [Var[α t Y t 1 ]] + Var[ɛ t ] = P t + σɛ 2 Rossi State-space Model Fin. Econometrics - 2014 17 / 53

The Kalman filter The Kalman filter Thus, since a t = E[α t Y t 1 ] or E[α t Y t ] = E[α t Y t 1, v t ] = a t + P t F t v t E[α t Y t ] = E[α t Y t 1, v t ] = a t + K t v t where K t P t F t is the regression coefficient of α t on v t. We have Var[α t Y t ] = Var[α t Y t 1, v t ] = Var[α t Y t 1 ] Cov[α t, v t ] 2 Var[v t ] 1 = P t P 2 t F t = P t (1 K t ) Rossi State-space Model Fin. Econometrics - 2014 18 / 53

The Kalman filter The Kalman filter The full set of relations for updating from time t to time t + 1: v t = y t a t F t = P t + σ 2 ɛ a 1 and P 1 are assumed to be known. K t = P t F t a t+1 = a t + K t v t P t+1 = P t (1 K t ) + ση 2 t = 1,..., T Rossi State-space Model Fin. Econometrics - 2014 19 / 53

Forecast errors Forecast errors The Kalman Filter (KF) residual v t = Y t a t and its variance F t are the one-step-ahead forecast error and the one-step-ahead forecast variance of y t Y t 1. The joint density of {y 1,..., y T } is p(y 1,..., y T ) = p(y 1 ) T p(y t Y t 1 ) the density of {v 1,..., v T }, provided that v t = y t a t is given by p(v 1,..., v T ) = p(y 1,..., y T ) y t v t T = p(v t ) t=1 t=2 Consequently, {v 1,..., v T } are mutually independent. Rossi State-space Model Fin. Econometrics - 2014 20 / 53

Forecast errors Error recursions Define the state estimation error as with x t = α t a t Var(x t ) = P t the state estimation errors and the forecast errors are linear functions of the initial state error x 1 and the disturbances ɛ t and η t. v t = x t + ɛ t where x t+1 = α t+1 a t+1 = α t + η t a t K t v t = x t + η t K t (x t + ɛ t ) = L t x t + η t K t ɛ t L t = 1 K t = σ 2 ɛ /F t Rossi State-space Model Fin. Econometrics - 2014 21 / 53

State smoothing Smoothed state Smoothing Estimation of α 1,..., α n given the entire sample Y n = (y 1,..., y n ). The conditional density α t Y n N ( α t, V t ) where the smoothed state α t = E(α t Y n ) and the smoothed state variance V t = Var[α t Y n ]. The operation of calculating α 1, α 2,..., α n is called state smoothing. Rossi State-space Model Fin. Econometrics - 2014 22 / 53

State smoothing Smoothed state The forecast errors v 1,..., v n are mutually independent and are a linear transformation of y 1,..., y n the errors (v t,..., v n ) are independent of (y 1,..., y t 1 ) with zero means. when y 1,..., y n are fixed Y t 1, v t,..., v n are fixed and vice versa. E[x y, z] = E[x y] + Σ xz Σ 1 zz z α t = E[α t Y n ] = E[α t Y t 1, v t,..., v n ] = E[α t Y t 1 ] + Cov[α t, (v t,..., v n ) ] Var[(v t,..., v n ) ] 1 (v t,..., v n ) 1 Cov(α t, v t ) F t 0 v t = a t +..... Cov(α t, v n ) 0 F n v n n = a t + Cov(α t, v j )F 1 j v j j=t Rossi State-space Model Fin. Econometrics - 2014 23 / 53

State smoothing Smoothed state Cov(α t, v j ) = Cov(x t, v j ) for j = t,..., n and Cov(x t, v t ) = E[x t (x t + ɛ t )] = Var(x t ) = P t Cov(x t, v t+1 ) = E[x t (x t+1 + ɛ t+1 )] = E[x t (L t x t + η t K t ɛ t )] = P t L t Similarly, Cov(x t, v t+2 ) = P t L t L t+1. Cov(x t, v n ) = P t L t L t+1... L n 1 Rossi State-space Model Fin. Econometrics - 2014 24 / 53

State smoothing Smoothed state Substituting in α t : where α t = v t v t+1 v t+2 a t + P t + P t L t + P t L t L t+1 +... F t F t+1 F t+2 = a t + P t r t 1 r t 1 = v t F t + L t v t+1 F t+1 + L t L t+1 v t+2 F t+2 +... + L t L t+1... L n 1 v n F n is a weighted sum of innovations after t 1. r n = 0 since no observations are available after time n. Rossi State-space Model Fin. Econometrics - 2014 25 / 53

State smoothing Smoothed state The value of r t 1 can be evaluated using the backward recursion r t 1 = v t F t + L t r t t = n, n 1,..., 1 The smoothed stare can be calculated by the backwards recursion (smoothing state recursion) with r n = 0. r t 1 = v t F t + L t r t α t = a t + P t r t 1 t = n, n 1,..., 1 Rossi State-space Model Fin. Econometrics - 2014 26 / 53

State smoothing Smoothed state variance The error variance of the smoothed state V t = Var[α t Y n ] = Var[α t Y t 1, v t,..., v n ] = Var[α t Y t 1 ] Cov[α t, (v t,..., v n ) ] Var[(v t,..., v n ) ] 1 Cov[α t, (v t,..., v n ) ] 1 Cov(α t, v t ) F t 0 Cov(α t, v t ) = P t....... Cov(α t, v n ) 0 F n Cov(α t, v n ) n = P t Cov[(α t, v j )] 2 F 1 j j=1 Given that Cov(α t, v j ) = Cov(x t, v j ) for j = t,..., n and Cov(x t, v t ) = P t Cov(x t, v t+1 ) = P t L t Rossi State-space Model Fin. Econometrics - 2014 27 / 53

State smoothing Smoothed state variance We can obtain V t = P t Pt 2 N t 1 where N t 1 = 1 + L 2 1 t + L 2 t L 2 1 t+1 +... + L 2 t L 2 t+1... L 2 1 n 1 F t F t+1 F t+2 N t = 1 + L 2 1 t+1 + L 2 F t+1 F t+1l 2 1 t+2 +... + L 2 t+2 F t+1l 2 t+2... L 2 1 n 1 t+3 N n = 0. N t 1 can be calculated using the backward recursion F n F n N t 1 = 1 F t + L 2 t N t N t = Var(r t ) since the forecast errors v t are independent. Rossi State-space Model Fin. Econometrics - 2014 28 / 53

State smoothing Smoothed state variance The error variance of the smoothed state can be calculated by the backwards recursion N t 1 = 1 F t + L 2 t N t V t = P t P 2 t N t 1 t = n,..., 1 From the standard error V t of α t we can construct confidence intervals for α t for t = 1,..., n. It is also possible to derive the smoothed covariances between the states Cov(α s, α t Y n ), t s. Rossi State-space Model Fin. Econometrics - 2014 29 / 53

Disturbance smoothing Disturbance smoothing Smoothed observation disturbance smoothed state disturbance ɛ t = E[ɛ t Y n ] = y t α t η t = E[η t Y n ] = α t+1 α t the estimates of ɛ t and η t are useful for detecting outliers and structural breaks. Rossi State-space Model Fin. Econometrics - 2014 30 / 53

Missing observations Missing observations Missing observations are very easy to handle in Kalman filtering. Suppose the observations y j, j = τ,..., τ 1 are missing for 1 < τ < τ n. The most ideal way to deal with it is to define a new series y t = y t t = 1,..., τ 1 y t = y t+τ τ t = τ,..., n n = n (τ τ) The model is the same local level model with y t = y t except that α τ = α τ 1 + η τ 1 where η τ 1 N (0, (τ τ)σ 2 η) Rossi State-space Model Fin. Econometrics - 2014 31 / 53

Missing observations Missing observations Filtering at time t = τ,..., τ 1 t 1 E[α t Y t 1 ] = E[α t Y τ 1 ] = E α τ + η j Y τ 1 = a τ and t 1 Var[α t Y t 1 ] = Var[α t Y τ 1 ] = Var α τ + η j Y τ 1 = P τ + (t τ)ση 2 giving j=τ j=τ a t+1 = a t P t+1 = P t + σ 2 η t = τ,..., τ 1 We can use the original KF for all t, by taking v t = 0 and K t = 0 at the missing time points. Rossi State-space Model Fin. Econometrics - 2014 32 / 53

Forecasting Forecasting Let y n+j be the minimum MSE forecast given the time series {y 1,..., y n }, j = 1, 2,..., J, with J > 0. Then y n+j = E[y n+j Y n ] The theory of forecasting for the local level model: we regard forecasting as filtering the observations (y 1,..., y n, y n+1,..., y n+j ) using KF and treating the last J observations y n+1,..., y n+j as missing. Letting a n+j = E[α n+j Y n ] P n+j+1 = P n+j + σ 2 η j = 1,..., J 1 with a n+1 = a n+1 and P n+1 = P n+1 obtained from the KF. Rossi State-space Model Fin. Econometrics - 2014 33 / 53

Forecasting Forecasting The forecast of y: for j = 1,..., J. y n+j = E[y n+j Y n ] = E[α n+j Y n ] + E[ɛ n+j Y n ] = a n+j F n+j = Var[y n+j Y n ] + Var[ɛ n+j Y n ] = P n+j + σ 2 ɛ The KF can be applied for t = 1,..., n + J where the observations at times n + 1,..., n + J are treated as missing. Rossi State-space Model Fin. Econometrics - 2014 34 / 53

Initialization Initialization How to start up the filter when nothing is known about the distribution of α 1. Diffuse prior: α 1 N(a 1, P 1 ) where a 1 is set at an arbitrary value and P 1. v 1 = y 1 a 1 substituting into the equations for a 2 and P 2 : F 1 = P 1 + σ 2 ɛ a 2 = a 1 + P 1 P 1 + σɛ 2 (y 1 a 1 ) ( P 2 = P 1 + 1 P 1 P 1 + σɛ 2 = P 1 P 1 + σɛ 2 σɛ 2 + ση 2 ) + σ 2 η letting P 1, we obtain a 2 = y 1, P 2 = σ 2 ɛ + σ 2 η, then we proceed with the KF (diffuse KF). Rossi State-space Model Fin. Econometrics - 2014 35 / 53

Parameter estimation Parameter estimation Since p(y 1,..., y n ) = p(y t 1 )p(y t Y t 1 ) the joint density of y 1,..., y n can be expressed as t = 2,..., n n p(y) = p(y t Y t 1 ) t=1 where p(y 1 Y 0 ) = p(y 1 ). p(y t Y t 1 ) = N (a t, F t ) v t = y t a t the log-likelihood is given by log L = log p(y) = n 2 log (2π) 1 2 n t=1 ( ) log F t + v2 t F t with v t and F t from the KF. This the prediction error decomposition of the likelihood. Estimation proceeds by numerically maximizing log L. Rossi State-space Model Fin. Econometrics - 2014 36 / 53

Parameter estimation Parameter estimation The log-likelihood in the diffuse case. All terms in the log-lik expression remain finite as P 1 with y fixed except the term for t = 1. To remove the influence of P 1 define the diffuse log-likelihood as: ( log L d = lim log L + 1 ) P 1 2 log P 1 ) = 1 2 lim P 1 n 2 log (2π) 1 2 ( log F 1 P 1 + v2 1 n t=2 F 1 ( ) log F t + v2 t F t since F 1 /P 1 1 and v 2 1/F 1 0 as P 1. P 1 does not depend on σ 2 ɛ and σ 2 η, the values of σ 2 ɛ and σ 2 η that maximize log L are identical to the values that maximize log L + 1 2 log P 1. Rossi State-space Model Fin. Econometrics - 2014 37 / 53

Linear Gaussian state space model Linear Gaussian state space model Linear Gaussian state space model is defined in three parts: State equation: Observation equation: Initial state distribution: α t+1 = T t α t + R t ζ t η t i.i.d.n (0, Q t ) y t = Z t α t + ɛ t ɛ t i.i.d.n (0, H t ) α 1 N (a 1, P 1 ) The matrices Z t, T t, R t, H t, Q t are independent of {ɛ 1,..., ɛ n } and {η 1,..., η n }. In many applications R t = I m, the theory remains valid if R t (m r). Rossi State-space Model Fin. Econometrics - 2014 38 / 53

Linear Gaussian state space model Linear Gaussian state space model The idea underlying the model is that the development of the system over time is determined by α t according to the state equation. Because α t cannot be observed directly we must base the analysis on observations y t. The matrices Z t, T t, R t, H t and Q t are initially assumed to be known and the error terms ɛ t and η t are assumed to be serially independent and independent of each other at all time points. Matrices Z t, and T t 1, are permitted to depend on y 1,..., y t 1 The initial state vector is assumed to be N (a 1, P 1 ) independently of ɛ 1,..., ɛ n and η 1,..., η n. a 1 and P 1 are assumed to be known. Rossi State-space Model Fin. Econometrics - 2014 39 / 53

Linear Gaussian state space model Linear Gaussian state space model State space model is linear and Gaussian: therefore properties and results of multivariate normal distribution apply; State vector α t evolves as a VAR(1) process; System matrices usually contain unknown parameters; Estimation has therefore two aspects: 1 measuring the unobservable state (prediction, filtering and smoothing); 2 estimation of unknown parameters (maximum likelihood estimation); State space methods offer a unified approach to a wide range of models and techniques: dynamic regression, ARIMA, UC models, latent variable models, spline-fitting and many ad-hoc filters; Rossi State-space Model Fin. Econometrics - 2014 40 / 53

Examples of S-S specifications Regression with Time Varying Coefficients Regressors in Z t = X t T t = I R t = I regression model with coefficient α t following a random walk. Rossi State-space Model Fin. Econometrics - 2014 41 / 53

Examples of S-S specifications UC models in S-S form Unobserved Component models Local level model: y t = µ t + ɛ t ɛ t N(0, σ 2 ɛ ) µ t+1 = µ t + η t η t N(0, σ 2 η) State equation: α t+1 = T t α t + R t ζ t ζ t i.i.d.n (0, Q t ) Observation equation: α t = µ t T t = 1 R t = 1 Q t = σ 2 η y t = Z t α t + ɛ t ɛ t i.i.d.n (0, H t ) Z t = 1 H t = σ 2 ɛ Rossi State-space Model Fin. Econometrics - 2014 42 / 53

Examples of S-S specifications UC models in S-S form Local linear trend model y t = µ t + ɛ t ɛ t N(0, σ 2 ɛ ) µ t+1 = µ t + ν t + η t η t N(0, σ 2 η) ν t+1 = ν t + ξ t ξ t N(0, σ 2 ξ) If ξ t = η t = 0 this entails ν t+1 = ν t = ν µ t+1 = µ t + ν y t = µ t + ɛ t µ t+1 = µ t + ν deterministic trend plus noise. Rossi State-space Model Fin. Econometrics - 2014 43 / 53

Examples of S-S specifications UC models in S-S form Local linear trend model State equation: α t = [ µt ν t Observation equation: α t+1 = T t α t + R t ζ t ζ t i.i.d.n (0, Q t ) ] [ ] [ ] [ ] 1 1 1 0 σ 2 T t = R 0 1 t = Q 0 1 t = η 0 0 σξ 2 y t = Z t α t + ɛ t ɛ t i.i.d.n (0, H t ) Z t = [ 1 0 ] H t = σ 2 ɛ Rossi State-space Model Fin. Econometrics - 2014 44 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA ARIMA(p,d,q): All ARIMA(p,d,q) models have a (non-unique) state space representation. y t = d x t α t = r = max (p, q + 1) y t = r j=1 φ(l)y t = θ(l)η t r 1 φ j y t j + η t + θ j η t j j=1 Z t = [1, 0, 0,..., 0] y t φ 2 y t 1 +... + φ r y t r+1 + θ 1 η t +... + θ r 1 η t r+2 φ 3 y t 1 +... + φ r y t r+2 + θ 1 η t +... + θ r 1 η t r+3. φ r y t 1 + θ r 1 η t Rossi State-space Model Fin. Econometrics - 2014 45 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA T t = φ 1 1 0... 0. φ r 1 0 0... 1 φ r 0 0... 0 R t = R = 1 θ 1. θ r 1 Observation equation: H t = 0 ɛ t = 0. ζ t = η t+1 y t = Z t α t Rossi State-space Model Fin. Econometrics - 2014 46 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA MA(1) model: Observation equation: y t = η t + θ 1 η t 1 y t = Z t α t Z t = [ 1 0 ] H t = 0 State equation: [ yt+1 ] = θ 1 η t+1 [ 0 1 0 0 ] [ ] [ yt 1 + θ 1 η t θ1 ] η t+1 Q t = σ 2 η Rossi State-space Model Fin. Econometrics - 2014 47 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA ARMA(2,1), r = 2, Observation equation: State equation: [ y t+1 φ 2 y t + θ 1 η t+1 y t = φ 1 y t 1 + φ 2 y t 2 + η t + θ 1 η t 1 y t = Z t α t Z t = [ 1 0 ] H t = 0 ] = [ φ1 1 φ 2 0 ] [ y t φ 2 y t 1 + θ 1 η t ] [ 1 + θ 1 ] η t+1 y t+1 = φ 1 y t + φ 2 y t 1 + θ 1 η t + η t+1 φ 2 y t + θ 1 η t+1 = φ 2 y t + θ 1 η t+1 Rossi State-space Model Fin. Econometrics - 2014 48 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA ARIMA(2,1,1): Observation equation: State equation: y t = φ 1 y t 1 + φ 2 y t 2 + η t + θ 1 η t 1 α t+1 = y t = [1, 1, 0] α t 1 1 0 0 φ 1 0 0 φ 2 0 α t + 0 1 θ 1 η t+1 State vector: α t = y t 1 y t φ 2 y t 1 + θ 1 η t Rossi State-space Model Fin. Econometrics - 2014 49 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA 1st equation 2nd equation 3rd equation y t = y t 1 + y t y t+1 = φ 1 y t + φ 2 y t 1 + η t+1 + θ 1 η t φ 2 y t + θ 1 η t+1 = φ 2 y t + θ 1 η t+1 Rossi State-space Model Fin. Econometrics - 2014 50 / 53

Examples of S-S specifications ARIMA in S-S form ARIMA ARIMA(2,2,1): 3rd equation 2 y t = φ 1 2 y t 1 + φ 2 2 y t 2 + η t + θ 1 η t 1 1 1 1 0 0 α t+1 = 0 1 1 0 0 0 φ 1 1 α t + 0 1 η t+1 0 0 φ 2 0 α t = y t 1 y t 1 2 y t φ 2 2 y t 1 + θ 1 η t θ 1 2 y t+1 = φ 1 2 y t + φ 2 2 y t 1 + η t+1 + θ 1 η t The need to facilitate the initialization explains why the S-S model is set in this form. The elements y 0 and y 0 are treated as diffuse random elements while the other elements, including 2 y t are stationary which have proper unconditional means and variances. Rossi State-space Model Fin. Econometrics - 2014 51 / 53

Kalman filter recursions Kalman filter recursions The unobserved state α t can be estimated from the observations with the Kalman filter: v t = y t Z t E[y t Y t 1 ] = y t Z t a t F t = Z t P t Z t + H t K t = T t P t Z tf 1 t a t+1 = T t a t + K t v t L t = T t K t Z t P t+1 = T t P t L t + R t Q t R t for t = 1,..., n and starting with given values for a 1 and P 1. Rossi State-space Model Fin. Econometrics - 2014 52 / 53

Kalman filter recursions Kalman filter recursions The contemporaneous filtering equations incorporate the computation of the state vector estimator a t t E[α t Y t ] and its variance P t t These equations are just a re-formulation of the Kalman filter and me given by M t = P t Z t a t t = a t + M t Ft 1 v t P t t = P t M t Ft 1 M t a t+1 = T t a t t P t+1 = T t P t t T t + R t Q t R t Rossi State-space Model Fin. Econometrics - 2014 53 / 53