Trend spotting ! TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
Trends Some time series do not e x hibit an y clear trends o v er time : TIME SERIES ANALYSIS IN R
Trends : linear E x amples of linear trends o v er time : TIME SERIES ANALYSIS IN R
Trends : rapid gro w th E x amples of rapid gro w th trends o v er time : TIME SERIES ANALYSIS IN R
Trends : periodic E x amples of periodic or sin u soidal trends o v er time : TIME SERIES ANALYSIS IN R
Trends : v ariance E x amples of increasing v ariance trends o v er time : TIME SERIES ANALYSIS IN R
Sample transformations : log () The log() f u nction can lineari z e a rapid gro w th trend : TIME SERIES ANALYSIS IN R
Sample transformations : diff () The diff() f u nction can remo v e a linear trend : TIME SERIES ANALYSIS IN R
Sample transformations : diff (…, s ) The diff(…, s) f u nction , or seasonal di � erence transformation , can remo v e periodic trends . diff(x, s = 4) TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
The w hite noise ( WN ) model TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
White noise White Noise ( WN ) is the simplest e x ample of a stationar y process . A w eak w hite noise process has : A �x ed , constant mean . A �x ed , constant v ariance . No correlation o v er time . TIME SERIES ANALYSIS IN R
White noise Time series plots of White Noise : TIME SERIES ANALYSIS IN R
White noise Time series plots of White Noise ? TIME SERIES ANALYSIS IN R
# Simulate n = 50 observations from the WN model WN_1 <- arima.sim(model = list(order = c(0, 0, 0)), n = 50) head(WN_1) -0.005052984 0.042669765 3.261154066 2.486431235 0.283119322 1.543525773 ts.plot(WN_1) TIME SERIES ANALYSIS IN R
# Simulate from the WN model with mean = 4, sd = 2 WN_2 <- arima.sim(model = list(order = c(0, 0, 0)), n = 50, mean = 4, sd = 2) ts.plot(WN_2) TIME SERIES ANALYSIS IN R
Estimating w hite noise # Fit the WN model with # Calculate the sample # arima()arima(WN_2, # mean and sample variance order = # of WN c(0, 0, 0)) mean(WN_2) Coefficients: 4.0739 intercept 4.0739 var(WN_2) s.e. 0.2698 sigma^2 estimated as 3.639 3.713 TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
The random w alk ( RW ) model TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
Random w alk Random Walk ( RW ) is a simple e x ample of a non - stationar y process . A random w alk has : No speci � ed mean or v ariance . Strong dependence o v er time . Its changes or increments are w hite noise ( WN ). TIME SERIES ANALYSIS IN R
Random w alk Time series plots of Random Walk : TIME SERIES ANALYSIS IN R
Random w alk The random w alk rec u rsion : Today = Y esterday + Noise More formall y: Y = Y + ϵ t −1 t t w here ϵ is mean z ero w hite noise ( WN ). t Sim u lation req u ires an initial point Y . 0 2 Onl y one parameter , the WN v ariance σ . ϵ TIME SERIES ANALYSIS IN R
Random w alk - I The random w alk process : Y = Y + ϵ t −1 t t w here ϵ is mean z ero WN t As Y − Y = ϵ → diff(Y) is WN t −1 t t TIME SERIES ANALYSIS IN R
Random w alk - II TIME SERIES ANALYSIS IN R
Random w alk w ith drift - I The random w alk w ith a dri �: Today = Constant + Y esterday + Noise More formall y: Y = c + Y + ϵ t −1 t t w here ϵ is mean z ero w hite noise ( WN ). t 2 T w o parameters , the constant c , and the WN v ariance σ . ϵ Y − Y = ? → WN w ith mean c ! t −1 t TIME SERIES ANALYSIS IN R
Random w alk w ith drift - II Time series plots of Random Walk w ith dri �: TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
Stationar y processes TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
Stationarit y Stationar y models are parsimonio u s . Stationar y processes ha v e distrib u tional stabilit y o v er time . Obser v ed time series : Fl u ct u ate randoml y. B u t beha v e similarl y from one time period to the ne x t . TIME SERIES ANALYSIS IN R
Weak stationarit y - I Weak stationar y : mean , v ariance , co v ariance constant o v er time . Y , Y , ... is a w eakl y stationar y process if : 1 2 Mean μ of Y is same ( constant ) for all t . t 2 Variance σ of Y is same ( constant ) for all t . t And …. TIME SERIES ANALYSIS IN R
Weak stationarit y - II Co v ariance of Y and Y is same ( constant ) for all ∣ t − s ∣ = h , t s for all h . Cov ( Y , Y ) = Cov ( Y , Y ) 2 5 7 10 since each pair is separated b y three u nits of time . TIME SERIES ANALYSIS IN R
Stationarit y: w h y? A stationar y process can be modeled w ith fe w er parameters . For e x ample , w e do not need a di � erent e x pectation for each Y t ; rather the y all ha v e a common e x pectation , μ . ¯ Estimate μ acc u ratel y b y . y TIME SERIES ANALYSIS IN R
Stationarit y: w hen ? Man y � nancial time series do not e x hibit stationarit y, ho w e v er : The changes in the series are o � en appro x imatel y stationar y. A stationar y series sho u ld sho w random oscillation aro u nd some �x ed le v el ; a phenomenon called mean - re v ersion . TIME SERIES ANALYSIS IN R
Stationarit y e x ample In � ation rates and changes in in � ation rates : TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
Recommend
More recommend