Linear Gaussian Sae Space Models Srucural Time Series Models Level and Trend Models Basic Srucural Model (BSM Dynamic Linear Models Sae Space Model Represenaion Level, Trend, and Seasonal Models Time Varying Regression Model Exensions Mulivariae Time Series Analysis Bayesian Time Series Analysis Time Series Daa Analysis Using R 1
Srucural Time Series Models Local level Model y v v N 1, ~ (0, v 1 w, w ~ N(0, w Local Trend Model y v v N 1, ~ (0, v 1 1 w,, w, ~ N(0, 1 w,, w, ~ N(0, Time Series Daa Analysis Using R
Srucural Time Series Models Basic Srucural Model (BSM y v v N 1 1, 1, ~ (0, v 1 1 w,, w, ~ N(0, 1 w,, w, ~ N(0, p1 1, j, 1 w,, w, ~ N(0, j, j,..., p1 j, j, 1 Forecasing yˆ a b s, 1,,..., n 1 1 p yˆ a hb s, h 1,,... p nh n n n nh p Time Series Daa Analysis Using R 3
Dynamic Linear Models Observaion Equaion y F v, v ~ iid N(0, V m1 m p p1 m1 m1 m1 mm Sae Equaion G w, w ~ iid N(0, W 1 p1 p p p1 p1 p1 p 1 p p Iniial Sae Disribuion ~ N( m, C 0 0 0 ' ' E( v0 E( w0 0 E v w ' ( s 0, m p s Time Series Daa Analysis Using R 4
Dynamic Linear Models Local Level Model y v v N, ~ (0, v 1 w, w ~ N(0, w Sae Space Model Represenaion y F v G w ( m 1, p 1 1, F 1, G 1, V, W v w Time Series Daa Analysis Using R 5
Dynamic Linear Models Local Trend Model y v v N, ~ (0, v 1 1 w,, w, ~ N(0, 1 w,, w, ~ N(0, Sae Space Model Represenaion y F v G w ( m 1, p 1 1 1 1, 0 1 w 1, 1 1 0, F 1 0, G, V v, W 0 1 0 w Time Series Daa Analysis Using R 6
Dynamic Linear Models Time Varying Regression Parameers y x v v N, ~ (0, v 1 w,, w, ~ N(0, 1 w,, w, ~ N(0, Sae Space Model Represenaion 1 0 y x v F x G V 0 1 1 1,, v 1 0 w 1, w, 0, w, W 0 1 w 1, w, 0 Time Series Daa Analysis Using R 7
Dynamic Linear Models Model Esimaion y F v { y} G 1 w Filering (filered esimae of E( I { y,..., y } 1 Smoohing (smoohed esimae of E( I { y,..., y } T 1 T Time Series Daa Analysis Using R 8
Model Esimaion The Kalman Filer is a se of recursion equaions for deermining he opimal esimaes of given I. The filer consiss of wo ses of equaions: Predicion Equaion Updae Equaion Using he following noaions m E( I opimal esimaor of based on I C E m m I MSE marix of m ' [( ( Time Series Daa Analysis Using R 9
Predicion Equaions Model Esimaion Given m -1 and C -1 a -1, he opimal predicor of and is MSE marix are m E( I G m 1 1 1 C E[( m ( m I G C G W ' ' 1 1 1 1 1 The corresponding opimal predicor of y a -1 is y E[ y I ] F m 1 1 1 The predicive error and is MSE marix are e y y y F m F ( m v 1 1 1 E e e Q FC F V ' ' ( 1 Time Series Daa Analysis Using R 10
Updae Equaions Model Esimaion When new observaion y become available, he opimal predicor m -1 and is MSE marix are updaed using m m C F Q ( y F m ' 1 1 1 1 m C F Q e ' 1 1 1 C C C F Q FC ' 1 1 1 1 Noe : K C F Q Kalman Gain Marix ' 1 1 Kalman Gain Marix gives he weigh on new informaion e in he updae equaion for m. Time Series Daa Analysis Using R 11
Kalman Smooher Model Esimaion Once all daa I T is observed, he opimal esimaors E( I T can be compued using he backwards Kalman smoohing recursions E( I m m C ( m G m * T T 1 T 1 E[( m ( m I C C ( C C C ' * *' T T T T 1 T 1 C C G C * ' 1 1 1 The algorihm sars by seing m T T = m T and C T T = C T and hen proceed backwards for = T-1,,1. Time Series Daa Analysis Using R 1
Maximum Likelihood Esimaion For a linear Gaussian sae space model, le y denoe he parameers of he model (embedded in he sysem marices F, G, V, and W. The predicion error decomposiion of he Gaussian log-likelihood funcion is y ~ N( F ( y m ( y, Q ( y 1 1 e ( y y y y F ( y m ( y ~ N(0, Q ( y 1 1 1/ 1 ' 1 f ( y 1; y ( Q ( y exp e ( y Q ( y e ( y T ln L( y y ln f ( y I ; y 1 1 NT 1 1 yˆ arg max ln L( y y MLE N N ' 1 ln( ln Q ( y e ( y Q ( y e ( y 1 1 y Time Series Daa Analysis Using R 13
Forecasing The Kalman filer predicion equaions produces insample 1-sep ahead forecass and MSE marices. Ou-of-sample h-sep ahead predicions and MSE marices can be compued from he predicion equaions by exending he daa se y 1,, y T wih a se of h missing values. When y is missing he Kalman filer reduces o he predicion sep so a sequence of h missing values a he end of he sample will produce a se of h-sep ahead forecass Time Series Daa Analysis Using R
Forecasing One-Sep Ahead Forecas a = p, p+1, yˆ a b s 1 1 p yˆ a b s 1 0 0 0 1 p yˆ a b s... 1 1 1 p yˆ a b s p p1 p1 p1 0 ˆ y 1 1 1 MAE mean( ˆ 1 MAPE 100 mean( ˆ / y MSE RMSE yˆ mean( ˆ 1 mean( ˆ 1 1 1 RMSPE mean ˆ y 100 [( 1 / 1 ] Time Series Daa Analysis Using R 15
Example 1 (Coninued China Shanghai Common Sock High Frequency Daily Index Monhly Index Time Series Trend, Seasonaliy Dynamic Linear Model Correlaion wih Exchange Rae? Time Series Daa Analysis Using R 16
Example Chinese Yuan vs. U.S. Dollar Exchange Rae Time Series Trend Inervenion Dynamic Linear Model Correlaion wih Sock Marke? ARMA Time Series Daa Analysis Using R 17