### IP Telephony

```Time Series Analysis
Pros & cons
Jonas Mellin
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
1
Overview
• Linear state space model
• Trends & seasons
• Basic structural time series
– Combining parameters
•
•
•
•
•
Types of models
Usefulness
Parameter estimation
Pros & cons
R packages
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
2
Basic: Linear State Space
• State equation (first order AR eq.)
+1 =   +   ,
~  0,
• Observation equation
=   +  ,
~  0,
• Machine learning -> constants
• Extensible to multiple states, observations, lags
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
3
Trends
=  +  ,
~  0, 2
+1 =  +  +  ,
~  0, 2
+1 =  +  ,
~  0, 2

+1
1
= (1 0)  + ,
=
0

+1
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
1
1

+
4
Seasons
γ+1 = −
λ =
2π

2
[ ]
∗
( γ cos λ +γ sin λ )
=1
,=

1, … , [ ]
2
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
5
Basic structural time series
• Any combination of
– error, trend, and season
• For example
–  = μ + γ + ε
– α = μ υ γ γ−1 … γ−+2 ′
–  =  μ ,  γ ,  = ( μ ,  γ )
–  = ( μ ,  γ ),  = ( μ ,  γ )
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
6
μ = (1,0), [γ] = (1,0, … , 0)
μ
1
=
0
1
, γ
1
−1
1
= 0
0
μ = 2 ,
=
⋮
−1
0
1
0
⋯
⋱
⋯
−1
0
0
γ = 1,0, … , 0
2
0
0
2
,
1
⋮
−1
0
0
0
′
γ =2ω
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
7
Season (s=4)
• α = μ υ γ γ−1 γ−2 ′
•  = 1 0 1 0 0
1 1 0
0
0
1 0
0 1 0
0
0
0 1
•  = 0 0 −1 −1 −1 ,  = 0 0
0 0 1
0
0
0 0
0 0 0
1
0
0 0
2
0
0
•  = 0
2
0
0
0
2ω
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
0
0
1
0
0
8
Basic: Linear State Space: Recap
• State equation (first order AR eq.)
+1 =   +   ,
~  0,
• Observation equation
=   +  ,
~  0,
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
9
Types of model
•
•
•
•
•
Local model/structural time series
Linear/(non-linear) state space
Gaussian/(non-Gaussian)
Univariate/multivariate
Can model ARMA(p,q) and ARIMA(p,q)
– Box-Jenkins
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
10
Usefulness
•
•
•
•
•
•
•
Filtering
Smoothing
Estimating missing observations
Forecasting
Simulations
Compare and contrast models
Dynamic factor analysis
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
11
Parameter estimation
• Maximum likelihood estimation
– Loglikelihood
• log

= − log
2
2π −
1
2

=1(log
+
2
)

– Maximize this
• 2ε and 2 converge, given 1 or P1, where P1 is the
initial variance of y1
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
12
–
–
–
–
Mature
Generic
Models can be analyzed (why-perspective)
Multivariate analysis possible
– Cannot find optimal model itself,
• search-based optimization required
– More complex than ARMA, ARIMA
– Can be hard to specify relations
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
13
Examples of existing packages
• R language
• Multi-variate analysis
• Flexible
– KFAS
• Univariate analysis
• Less flexible
HELICOPTER – Initial presentation of HS/IF
Jonas Mellin, 2013
14
References
• Durbin, J 2012, Time series analysis by state space methods,
2nd ed., Oxford University Press, Oxford.
• Holmes, E, Ward, E & Wills, K 2013, MARSS: Multivariate
Autoregressive State-Space Modeling, viewed