Professional Documents
Culture Documents
Forecasting Using Time Series Analysis
Forecasting Using Time Series Analysis
CONTENT
1. The introduction of time series
2. Some models of time series analysis
3. Time series analysis with R
Phân tích dữ liệu với R 4
1. Time Series
Time series: the structure of a data table with many different columns,
which requires to have a timestamp column and events that change
with that timestamp column.
E.g.:
⁃ Data about customers' purchasing demand by year, quarter, month, ...
⁃ Data on stock prices, trading volume by year, month, quarter, week, day, ...
⁃ ….
1. Time Series
Components
Phân tích dữ liệu với R 6
1. Time Series
Components
Phân tích dữ liệu với R 7
1. Time Series
+
E.g.: +
E.g.: + +
Phân tích dữ liệu với R 8
1. Time Series
Stationarity
Why is it necessary to
check for stationarity in
E(𝑌 ¿¿t)=μ¿
2 time series analysis?
dừng Var(𝑌 ¿¿t)=𝜎 ¿
Cov (𝑌 ¿ ¿t ,𝑌 t − p )=𝛾 p ∉t ¿
Phân tích dữ liệu với R 9
1. Time Series
Correlation
1st order:
2nd order:
1st&2nd order:
Phân tích dữ liệu với R 10
1. Time Series
White noise
E (𝜀¿¿t)=0¿
2
nhiễu trắng Var(𝜀¿¿t )=𝜎 ¿
Cov (𝜀¿ ¿t , 𝜀t − p )=0¿
MA (Moving Average) : modeling the relationship between the data and the
error relative to the average of the other lags expressed through the
parameter 'q' in the ARIMA model
ARIMA(p, d, q)
Phân tích dữ liệu với R 12
Find p?
?
𝐸𝑥𝑝 𝐴𝑢𝑔 =𝛼+ 𝛽1 𝐸𝑥𝑝 𝐽𝑢𝑙 + 𝛽 2 𝐸𝑥𝑝 𝐽𝑢𝑛 + 𝐸𝑟𝑟𝑜𝑟
Phân tích dữ liệu với R 13
ARIMA(p, d, q)
Phân tích dữ liệu với R 16
2 4
Preliminary Forecast
data analysis
Phân tích dữ liệu với R 17
• Forecast
5
Phân tích dữ liệu với R 18
S Series is stationary
t
a
t
i
o
n
a
r
y
Phân tích dữ liệu với R 20
S
t
a
t
i
o
n
a
r
y
Phân tích dữ liệu với R 21
ARIMA(p, d, q)
Finding ‘q’ via ACF plot
Phân tích dữ liệu với R 23