Académique Documents
Professionnel Documents
Culture Documents
1 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
2 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
tsclean()
3 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
decompose() stl()
adf.test()
4 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
(p, d, q)
Y
p
φ1 φ 2
d I(d)
et q
yd Y d c
5 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
(p, d, q)
1 library('ggplot2')
2 library('forecast')
3 library('tseries')
4
5 daily_data = read.csv('day.csv', header=TRUE, stringsAsFactors=FALSE)
6 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
1 daily_data$Date = as.Date(daily_data$dteday)
2
3 ggplot(daily_data, aes(Date, cnt)) + geom_line() + scale_x_date('month'
4 xlab("")
7 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
8 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
m
Y k
m = 2k + 1
M
A(q) M A(q)
9 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
10 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
St T E
11 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
(P, D, Q)
stl()
stl()
allow.multiplicative.trend=TRUE
seasadj()
forecast
ts()
12 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
13 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
14 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
(d = 2)
15 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
M A (q)
AR(p)
16 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
1 Acf(count_ma, main='')
2
3 Pacf(count_ma, main='')
d=1
17 of 32 1/27/2019, 4:35 PM
Introduction to Forecasting with ARIMA in R https://www.datascience.com/blog/introduction-to-forecasting-with-arim...
p q
18 of 32 1/27/2019, 4:35 PM