1. Kết nối dữ liệu

library(readxl)
setwd("d:/DATA2020/arimaVSholtwiner")
dulieu <-read_excel("dubao.xlsx")
dulieu <-ts(dulieu,star=c(2010,10), frequency = 12)
head(dulieu)
##           Month        Quy Time Total Revenues Rev Rev2
## [1,] 1317427200 1317427200   88              0   0    0
## [2,] 1320105600 1320105600   79              0   0    0
## [3,] 1322697600 1322697600   18              0   0    0
## [4,] 1325376000 1325376000   36              0   0    0
## [5,] 1328054400 1328054400   27              0   0    0
## [6,] 1330560000 1330560000   61              0   0    0

2 . Tìm p d q thủ công

# Vẽ đồ thị

#Dữ liệu gốc theo thời gian
plot.ts(dulieu[,5])

#Dữ liệu sai phân
plot.ts(diff(dulieu[,5]))

# tìm d

library(urca)

summary(ur.df(dulieu[,5], type=c("none")))
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression none 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -239052   -5749       0   49009  351289 
## 
## Coefficients:
##            Estimate Std. Error t value Pr(>|t|)    
## z.lag.1    -0.48435    0.10350  -4.680 9.03e-06 ***
## z.diff.lag -0.05695    0.10212  -0.558    0.578    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 98960 on 100 degrees of freedom
## Multiple R-squared:  0.2506, Adjusted R-squared:  0.2356 
## F-statistic: 16.72 on 2 and 100 DF,  p-value: 5.434e-07
## 
## 
## Value of test-statistic is: -4.6797 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau1 -2.58 -1.95 -1.62
summary(ur.pp(dulieu[,5], type=c("Z-tau"),model=c("constant")))
## 
## ################################## 
## # Phillips-Perron Unit Root Test # 
## ################################## 
## 
## Test regression with intercept 
## 
## 
## Call:
## lm(formula = y ~ y.l1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -168378  -46998  -46511   24229  365030 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 4.700e+04  1.064e+04   4.416 2.53e-05 ***
## y.l1        2.503e-01  9.740e-02   2.570   0.0116 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 90290 on 101 degrees of freedom
## Multiple R-squared:  0.06136,    Adjusted R-squared:  0.05207 
## F-statistic: 6.603 on 1 and 101 DF,  p-value: 0.01164
## 
## 
## Value of test-statistic, type: Z-tau  is: -7.705 
## 
##          aux. Z statistics
## Z-tau-mu            4.4195
## 
## Critical values for Z statistics: 
##                    1pct      5pct     10pct
## critical values -3.4945 -2.889471 -2.581483
summary(ur.ers(dulieu[,5], type=c("DF-GLS"), model=c("constant")))
## 
## ############################################### 
## # Elliot, Rothenberg and Stock Unit Root Test # 
## ############################################### 
## 
## Test of type DF-GLS 
## detrending of series with intercept 
## 
## 
## Call:
## lm(formula = dfgls.form, data = data.dfgls)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -125932  -30398   -9319   36394  339604 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## yd.lag        -0.3254     0.1456  -2.235 0.027786 *  
## yd.diff.lag1  -0.4052     0.1532  -2.645 0.009586 ** 
## yd.diff.lag2  -0.5702     0.1435  -3.975 0.000138 ***
## yd.diff.lag3  -0.3333     0.1240  -2.688 0.008504 ** 
## yd.diff.lag4  -0.1979     0.1040  -1.903 0.060106 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 89400 on 94 degrees of freedom
## Multiple R-squared:  0.4251, Adjusted R-squared:  0.3945 
## F-statistic:  13.9 on 5 and 94 DF,  p-value: 3.657e-10
## 
## 
## Value of test-statistic is: -2.235 
## 
## Critical values of DF-GLS are:
##                  1pct  5pct 10pct
## critical values -2.59 -1.94 -1.62
summary(ur.kpss(dulieu[,5], type=c("mu")))
## 
## ####################### 
## # KPSS Unit Root Test # 
## ####################### 
## 
## Test is of type: mu with 4 lags. 
## 
## Value of test-statistic is: 0.4193 
## 
## Critical value for a significance level of: 
##                 10pct  5pct 2.5pct  1pct
## critical values 0.347 0.463  0.574 0.739
# tim d dùng gói khác
library(fUnitRoots)
## Loading required package: timeDate
## Loading required package: timeSeries
## Loading required package: fBasics
## 
## Attaching package: 'fUnitRoots'
## The following objects are masked from 'package:urca':
## 
##     punitroot, qunitroot, unitrootTable
adfTest(dulieu[,5], lags=12, type=(c("nc")))
## 
## Title:
##  Augmented Dickey-Fuller Test
## 
## Test Results:
##   PARAMETER:
##     Lag Order: 12
##   STATISTIC:
##     Dickey-Fuller: -0.6379
##   P VALUE:
##     0.4099 
## 
## Description:
##  Mon Aug 03 17:59:52 2020 by user: Admin
adfTest(diff(dulieu[,5]), lags=12, type="nc")
## Warning in adfTest(diff(dulieu[, 5]), lags = 12, type = "nc"): p-value smaller
## than printed p-value
## 
## Title:
##  Augmented Dickey-Fuller Test
## 
## Test Results:
##   PARAMETER:
##     Lag Order: 12
##   STATISTIC:
##     Dickey-Fuller: -4.1881
##   P VALUE:
##     0.01 
## 
## Description:
##  Mon Aug 03 17:59:52 2020 by user: Admin
# tìm p
pacf(dulieu[,5])

pacf(diff(dulieu[,5]))

# tìm q
acf(dulieu[,5])

acf(diff(dulieu[,5]))

# Tính xu hướng
library(pastecs)
trend.test(dulieu[,5])
## Warning in cor.test.default(x, time(x), alternative = "two.sided", method =
## "spearman"): Cannot compute exact p-value with ties
## 
##  Spearman's rank correlation rho
## 
## data:  dulieu[, 5] and time(dulieu[, 5])
## S = 128224, p-value = 0.001084
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##       rho 
## 0.3159939
trend.test(diff(dulieu[,5]))
## Warning in cor.test.default(x, time(x), alternative = "two.sided", method =
## "spearman"): Cannot compute exact p-value with ties
## 
##  Spearman's rank correlation rho
## 
## data:  diff(dulieu[, 5]) and time(diff(dulieu[, 5]))
## S = 189060, p-value = 0.7017
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##         rho 
## -0.03819874
# tính thời vụ
library(seastests)
summary(wo(dulieu[,5]))
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## Test used:  WO 
##  
## Test statistic:  0 
## P-value:  0.01088334 0.02202298 0.2371589 
##  
## The WO - test does not identify  seasonality
isSeasonal(dulieu[,5])
## [1] FALSE
summary(wo(diff(dulieu[,5])))
## Test used:  WO 
##  
## Test statistic:  0 
## P-value:  1 0.0227325 0.2056103 
##  
## The WO - test does not identify  seasonality
isSeasonal(diff(dulieu[,5]))
## [1] FALSE

3. Hồi quy arima

# thủ công
library(forecast)
hoiquy1 <- Arima(dulieu[,5], order=c(4,1,1), seasonal=c(1,1,1))
names(hoiquy1)
##  [1] "coef"      "sigma2"    "var.coef"  "mask"      "loglik"    "aic"      
##  [7] "arma"      "residuals" "call"      "series"    "code"      "n.cond"   
## [13] "nobs"      "model"     "aicc"      "bic"       "x"         "fitted"
uocluong <- fitted(hoiquy1)
hoiquy1
## Series: dulieu[, 5] 
## ARIMA(4,1,1)(1,1,1)[12] 
## 
## Coefficients:
##          ar1      ar2      ar3     ar4      ma1    sar1     sma1
##       0.0063  -0.3109  -0.0578  0.0540  -0.7425  0.1201  -0.9993
## s.e.  0.3125   0.2314   0.2337  0.2043   0.2906  0.1216   0.1539
## 
## sigma^2 estimated as 6.899e+09:  log likelihood=-1168.57
## AIC=2353.14   AICc=2354.89   BIC=2373.22
library(nlme)
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:forecast':
## 
##     getResponse
AIC(hoiquy1)
## [1] 2353.138
BIC(hoiquy1)
## [1] 2373.225
#library(Metrics)
library(MLmetrics)
## 
## Attaching package: 'MLmetrics'
## The following object is masked from 'package:base':
## 
##     Recall
MSE(uocluong,dulieu[,5])
## [1] 5572246515
RMSE(uocluong,dulieu[,5])
## [1] 74647.48
MAE(uocluong,dulieu[,5])
## [1] 52623.9
MAPE(uocluong,dulieu[,5])
## [1] NaN
R2_Score(uocluong,dulieu[,5])
## [1] 0.3421931
library(staTools)
## 
## Attaching package: 'staTools'
## The following objects are masked from 'package:MLmetrics':
## 
##     MAE, MAPE, MSE, RMSE
MPE(uocluong,dulieu[,5])
## [1] NaN
hoiquy2 <- auto.arima(dulieu[,5], ic="bic", trace=TRUE, test="kpss", seasonal=T)
## 
##  ARIMA(2,1,2)(1,0,1)[12] with drift         : 2663.954
##  ARIMA(0,1,0)            with drift         : 2697.711
##  ARIMA(1,1,0)(1,0,0)[12] with drift         : 2689.713
##  ARIMA(0,1,1)(0,0,1)[12] with drift         : 2654.613
##  ARIMA(0,1,0)                               : 2693.109
##  ARIMA(0,1,1)            with drift         : 2656.174
##  ARIMA(0,1,1)(1,0,1)[12] with drift         : 2658.302
##  ARIMA(0,1,1)(0,0,2)[12] with drift         : 2658.822
##  ARIMA(0,1,1)(1,0,0)[12] with drift         : 2653.998
##  ARIMA(0,1,1)(2,0,0)[12] with drift         : 2658.498
##  ARIMA(0,1,1)(2,0,1)[12] with drift         : 2663.227
##  ARIMA(0,1,0)(1,0,0)[12] with drift         : 2694.667
##  ARIMA(1,1,1)(1,0,0)[12] with drift         : 2657.035
##  ARIMA(0,1,2)(1,0,0)[12] with drift         : 2655.513
##  ARIMA(1,1,2)(1,0,0)[12] with drift         : 2658.094
##  ARIMA(0,1,1)(1,0,0)[12]                    : 2649.602
##  ARIMA(0,1,1)                               : 2651.779
##  ARIMA(0,1,1)(2,0,0)[12]                    : 2654.079
##  ARIMA(0,1,1)(1,0,1)[12]                    : 2653.861
##  ARIMA(0,1,1)(0,0,1)[12]                    : 2650.254
##  ARIMA(0,1,1)(2,0,1)[12]                    : 2658.817
##  ARIMA(0,1,0)(1,0,0)[12]                    : 2690.065
##  ARIMA(1,1,1)(1,0,0)[12]                    : 2652.692
##  ARIMA(0,1,2)(1,0,0)[12]                    : 2651.206
##  ARIMA(1,1,0)(1,0,0)[12]                    : 2685.118
##  ARIMA(1,1,2)(1,0,0)[12]                    : 2653.748
## 
##  Best model: ARIMA(0,1,1)(1,0,0)[12]
summary(hoiquy2)
## Series: dulieu[, 5] 
## ARIMA(0,1,1)(1,0,0)[12] 
## 
## Coefficients:
##           ma1    sar1
##       -0.8796  0.2483
## s.e.   0.0539  0.0928
## 
## sigma^2 estimated as 7.591e+09:  log likelihood=-1317.85
## AIC=2641.7   AICc=2641.94   BIC=2649.6
## 
## Training set error measures:
##                    ME     RMSE      MAE MPE MAPE      MASE       ACF1
## Training set 3842.122 85861.33 57673.92 NaN  Inf 0.7763007 0.09615834

4. Hồi quy Holt-Winner

khongmua <-HoltWinters(dulieu[,5], gamma=F)
khongmua
## Holt-Winters exponential smoothing with trend and without seasonal component.
## 
## Call:
## HoltWinters(x = dulieu[, 5], gamma = F)
## 
## Smoothing parameters:
##  alpha: 0.1165024
##  beta : 0
##  gamma: FALSE
## 
## Coefficients:
##       [,1]
## a 58202.72
## b     0.00
comua <-HoltWinters(dulieu[,5], seasonal = c("additive"))
comua
## Holt-Winters exponential smoothing with trend and additive seasonal component.
## 
## Call:
## HoltWinters(x = dulieu[, 5], seasonal = c("additive"))
## 
## Smoothing parameters:
##  alpha: 0.1458954
##  beta : 0.005783991
##  gamma: 0.0815975
## 
## Coefficients:
##           [,1]
## a    73053.421
## b     1502.500
## s1  -26873.071
## s2  -25176.292
## s3  -35790.668
## s4  -15586.363
## s5  -41869.057
## s6   95379.805
## s7   75267.347
## s8  -50822.358
## s9   -1924.008
## s10 -14913.648
## s11  -5898.304
## s12  -9879.733
names(comua)
## [1] "fitted"       "x"            "alpha"        "beta"         "gamma"       
## [6] "coefficients" "seasonal"     "SSE"          "call"
uocluong2 <- fitted(comua)
MSE(uocluong2,dulieu[,5])
## [1] 10754249398
RMSE(uocluong2,dulieu[,5])
## [1] 103702.7
MAE(uocluong2,dulieu[,5])
## [1] 71355.02
MAPE(uocluong2,dulieu[,5])
## [1] 991.8152
R2_Score(uocluong2,dulieu[,5])
## [1] -3.492237
MPE(uocluong2,dulieu[,5])
## [1] -766.4426
comua2 <- hw(dulieu[,5], seasonal = c("additive"))
summary(comua2)
## 
## Forecast method: Holt-Winters' additive method
## 
## Model Information:
## Holt-Winters' additive method 
## 
## Call:
##  hw(y = dulieu[, 5], seasonal = c("additive")) 
## 
##   Smoothing parameters:
##     alpha = 0.1572 
##     beta  = 0.003 
##     gamma = 1e-04 
## 
##   Initial states:
##     l = 1340.4399 
##     b = 3032.9358 
##     s = 19661.19 -29367 -12679.5 -22525.9 -25935.62 9676.476
##            13945.4 -40292.69 -62991.86 94276.35 87270.06 -31036.89
## 
##   sigma:  85646
## 
##      AIC     AICc      BIC 
## 2862.102 2869.219 2907.057 
## 
## Error measures:
##                     ME     RMSE      MAE MPE MAPE      MASE       ACF1
## Training set -8405.709 78782.87 59239.63 NaN  Inf 0.7973755 0.06419114
## 
## Forecasts:
##          Point Forecast      Lo 80    Hi 80      Lo 95    Hi 95
## Jun 2019      41690.998  -68068.77 151450.8 -126172.09 209554.1
## Jul 2019      51970.466  -59187.90 163128.8 -118031.59 221972.5
## Aug 2019      35715.461  -76875.58 148306.5 -136477.67 207908.6
## Sep 2019      85176.393  -28881.04 199233.8  -89259.40 259612.2
## Oct 2019      34913.733  -80643.45 150470.9 -141815.73 211643.2
## Nov 2019     153641.578   36551.64 270731.5  -25432.02 332715.2
## Dec 2019     161079.978   42424.69 279735.3  -20387.63 342547.6
## Jan 2020       4265.548 -115987.32 124518.4 -179645.34 188176.4
## Feb 2020      27390.880  -94491.40 149273.2 -159011.98 213793.7
## Mar 2020      82055.065  -41488.05 205598.2 -106887.83 270998.0
## Apr 2020      78215.761  -47019.23 203450.8 -113314.63 269746.2
## May 2020      43061.455  -83896.05 170019.0 -151103.29 237226.2
## Jun 2020      46884.185  -81827.86 175596.2 -149963.91 243732.3
## Jul 2020      57163.653  -73330.94 187658.2 -142410.60 256737.9
## Aug 2020      40908.649  -91397.92 173215.2 -161436.78 243254.1
## Sep 2020      90369.580  -43777.99 224517.2 -114791.43 295530.6
## Oct 2020      40106.921  -95910.29 176124.1 -167913.46 248127.3
## Nov 2020     158834.765   20919.67 296749.9  -52088.18 369757.7
## Dec 2020     166273.165   26432.32 306114.0  -47594.95 380141.3
## Jan 2021       9458.735 -132335.32 151252.8 -207396.56 226314.0
## Feb 2021      32584.068 -111190.30 176358.4 -187299.85 252468.0
## Mar 2021      87248.252  -58533.15 233029.7 -135705.16 310201.7
## Apr 2021      83408.949  -64405.84 231223.7 -142654.26 309472.2
## May 2021      48254.643 -101619.53 198128.8 -180958.12 277467.4

Dự báo

dubaoArima1 <- forecast(hoiquy1, h=19)
dubaoArima1
##          Point Forecast      Lo 80    Hi 80      Lo 95    Hi 95
## Jun 2019       77917.73 -34747.122 190582.6  -94388.29 250223.8
## Jul 2019       26232.26 -90278.371 142742.9 -151955.37 204419.9
## Aug 2019       31561.07 -85037.465 148159.6 -146761.00 209883.1
## Sep 2019      110121.18  -7223.791 227466.2  -69342.47 289584.8
## Oct 2019       56777.46 -65419.124 178974.0 -130106.09 243661.0
## Nov 2019      133119.44   7995.373 258243.5  -58241.31 324480.2
## Dec 2019      153138.95  26866.732 279411.2  -39977.74 346255.6
## Jan 2020       30107.54 -97626.608 157841.7 -165244.98 225460.1
## Feb 2020       43807.28 -86167.785 173782.3 -154972.43 242587.0
## Mar 2020       87181.87 -44889.482 219253.2 -114803.83 289167.6
## Apr 2020       73940.18 -59830.252 207710.6 -130644.04 278524.4
## May 2020       96988.51 -38480.913 232457.9 -110194.10 304171.1
## Jun 2020       70512.19 -73257.859 214282.2 -149365.13 290389.5
## Jul 2020       64015.03 -82660.949 210691.0 -160306.52 288336.6
## Aug 2020       52838.66 -95166.801 200844.1 -173516.16 279193.5
## Sep 2020      112841.20 -37260.745 262943.2 -116719.92 342402.3
## Oct 2020       63288.65 -89647.793 216225.1 -170607.46 297184.8
## Nov 2020      161535.99   6079.178 316992.8  -76214.69 399286.7
## Dec 2020      169870.65  12316.453 327424.8  -71087.70 410829.0
plot(dubaoArima1)

plot(hoiquy1$x,col="red")
lines(fitted(hoiquy1),col="blue")

dubaoArima2 <- forecast(hoiquy2, h=19)
dubaoArima2
##          Point Forecast     Lo 80    Hi 80      Lo 95    Hi 95
## Jun 2019       59461.46 -52196.51 171119.4 -111304.66 230227.6
## Jul 2019       82470.70 -29993.20 194934.6  -89527.99 254469.4
## Aug 2019       68890.75 -44373.34 182154.8 -104331.73 242113.2
## Sep 2019       48136.09 -65922.58 162194.8 -126301.60 222573.8
## Oct 2019       48136.09 -66711.67 162983.9 -127508.40 223780.6
## Nov 2019       56201.87 -59429.59 171833.3 -120641.19 233044.9
## Dec 2019       80895.08 -35514.81 197305.0  -97138.48 258928.6
## Jan 2020       50219.12 -66964.02 167402.3 -128997.03 229435.3
## Feb 2020       48136.09 -69815.23 166087.4 -132254.89 228527.1
## Mar 2020       60354.36 -58360.18 179068.9 -121203.86 241912.6
## Apr 2020       48136.09 -71336.79 167609.0 -134581.91 230854.1
## May 2020       99812.57 -20413.87 220039.0  -84057.90 283683.0
## Jun 2020       62901.57 -64177.50 189980.6 -131449.10 257252.2
## Jul 2020       68615.22 -59566.53 196797.0 -127421.85 264652.3
## Aug 2020       65243.05 -64031.98 194518.1 -132466.05 262952.1
## Sep 2020       60089.25 -70269.89 190448.4 -139277.84 259456.3
## Oct 2020       60089.25 -71345.05 191523.6 -140922.17 261100.7
## Nov 2020       62092.15 -70408.60 194592.9 -140550.26 264734.5
## Dec 2020       68223.97 -65334.71 201782.6 -136036.40 272484.3
plot(dubaoArima2)

dubaoKhongmua <- forecast(khongmua, h=19)
dubaoKhongmua
##          Point Forecast     Lo 80    Hi 80     Lo 95    Hi 95
## Jun 2019       58202.72 -57425.06 173830.5 -118634.7 235040.1
## Jul 2019       58202.72 -58207.11 174612.5 -119830.7 236236.2
## Aug 2019       58202.72 -58983.94 175389.4 -121018.8 237424.2
## Sep 2019       58202.72 -59755.66 176161.1 -122199.0 238604.5
## Oct 2019       58202.72 -60522.36 176927.8 -123371.6 239777.0
## Nov 2019       58202.72 -61284.14 177689.6 -124536.7 240942.1
## Dec 2019       58202.72 -62041.09 178446.5 -125694.3 242099.8
## Jan 2020       58202.72 -62793.31 179198.7 -126844.7 243250.2
## Feb 2020       58202.72 -63540.89 179946.3 -127988.1 244393.5
## Mar 2020       58202.72 -64283.90 180689.3 -129124.4 245529.8
## Apr 2020       58202.72 -65022.43 181427.9 -130253.9 246659.3
## May 2020       58202.72 -65756.56 182162.0 -131376.6 247782.1
## Jun 2020       58202.72 -66486.36 182891.8 -132492.8 248898.2
## Jul 2020       58202.72 -67211.92 183617.4 -133602.4 250007.9
## Aug 2020       58202.72 -67933.31 184338.7 -134705.7 251111.1
## Sep 2020       58202.72 -68650.60 185056.0 -135802.7 252208.1
## Oct 2020       58202.72 -69363.85 185769.3 -136893.5 253298.9
## Nov 2020       58202.72 -70073.13 186478.6 -137978.3 254383.7
## Dec 2020       58202.72 -70778.52 187184.0 -139057.1 255462.5
plot(dubaoKhongmua)

dubaocomua1 <- forecast(comua, h=19)
dubaocomua1
##          Point Forecast     Lo 80    Hi 80       Lo 95    Hi 95
## Jun 2019       47682.85 -66203.29 161569.0 -126490.964 221856.7
## Jul 2019       50882.13 -64223.60 165987.9 -125156.890 226921.1
## Aug 2019       41770.25 -74556.13 158096.6 -136135.591 219676.1
## Sep 2019       63477.06 -54071.08 181025.2 -116297.302 243251.4
## Oct 2019       38696.86 -80074.18 157467.9 -142947.768 220341.5
## Nov 2019      177448.23  57453.09 297443.4   -6068.499 360964.9
## Dec 2019      158838.27  37617.80 280058.7  -26552.433 344229.0
## Jan 2020       34251.06 -88196.00 156698.1 -153015.555 221517.7
## Feb 2020       84651.91 -39023.05 208326.9 -104492.620 273796.4
## Mar 2020       73164.77 -51739.43 198069.0 -117859.726 264189.3
## Apr 2020       83682.61 -42452.21 209817.4 -109223.951 276589.2
## May 2020       81203.68 -46163.17 208570.5 -113587.105 275994.5
## Jun 2020       65712.85 -64222.14 195647.8 -133005.565 264431.3
## Jul 2020       68912.13 -62245.23 200069.5 -131675.742 269500.0
## Aug 2020       59800.25 -72581.19 192181.7 -142659.698 262260.2
## Sep 2020       81507.05 -52100.22 215114.3 -122827.633 285841.7
## Oct 2020       56726.86 -78108.00 191561.7 -149485.259 262939.0
## Nov 2020      195478.22  59414.00 331542.4  -12614.052 403570.5
## Dec 2020      176868.26  39572.87 314163.7  -33106.917 386843.4
plot(dubaocomua1)

dubaocomua2 <- forecast(comua2, h=19)
dubaocomua2
##          Point Forecast      Lo 80    Hi 80      Lo 95    Hi 95
## Jun 2019      41690.998  -68068.77 151450.8 -126172.09 209554.1
## Jul 2019      51970.466  -59187.90 163128.8 -118031.59 221972.5
## Aug 2019      35715.461  -76875.58 148306.5 -136477.67 207908.6
## Sep 2019      85176.393  -28881.04 199233.8  -89259.40 259612.2
## Oct 2019      34913.733  -80643.45 150470.9 -141815.73 211643.2
## Nov 2019     153641.578   36551.64 270731.5  -25432.02 332715.2
## Dec 2019     161079.978   42424.69 279735.3  -20387.63 342547.6
## Jan 2020       4265.548 -115987.32 124518.4 -179645.34 188176.4
## Feb 2020      27390.880  -94491.40 149273.2 -159011.98 213793.7
## Mar 2020      82055.065  -41488.05 205598.2 -106887.83 270998.0
## Apr 2020      78215.761  -47019.23 203450.8 -113314.63 269746.2
## May 2020      43061.455  -83896.05 170019.0 -151103.29 237226.2
## Jun 2020      46884.185  -81827.86 175596.2 -149963.91 243732.3
## Jul 2020      57163.653  -73330.94 187658.2 -142410.60 256737.9
## Aug 2020      40908.649  -91397.92 173215.2 -161436.78 243254.1
## Sep 2020      90369.580  -43777.99 224517.2 -114791.43 295530.6
## Oct 2020      40106.921  -95910.29 176124.1 -167913.46 248127.3
## Nov 2020     158834.765   20919.67 296749.9  -52088.18 369757.7
## Dec 2020     166273.165   26432.32 306114.0  -47594.95 380141.3
plot(dubaocomua2)