Выполнить в R auto.arima два разных решения в Windows и MA C с прогнозом lib - PullRequest
1 голос
/ 08 февраля 2020

Я работал над проектом для университета со следующими данными.

данные

Я выполнил auto.arima в Windows и Ма c и получил другое Результаты. В Ма c я получил и NaN предупреждение. Любая идея, почему это может быть?

install.packages("ggplot2")
install.packages("tseries")
install.packages("forecast")

library(ggplot2)
library(tseries)
library(forecast)

library(readxl)
via_dat <- read_excel("Viajeros.xlsx")
via <- ts(via_dat[,-1], start=c(1999,1), frequency=12)
via_train <- window(via, end=c(2018,12))

fitvia <- auto.arima(log(via_train), seasonal=TRUE)
checkresiduals(fitvia)
print(fitvia)

Вывод в Windows

Series: log(via_train) 
ARIMA(4,0,0)(1,1,1)[12] with drift 

Coefficients:
         ar1     ar2     ar3      ar4    sar1     sma1   drift
      0.6280  0.1756  0.0903  -0.0017  0.3322  -0.8509  0.0033
s.e.  0.0675  0.0803  0.0783   0.0676  0.1114   0.0891  0.0005

sigma^2 estimated as 0.001216:  log likelihood=441.4
AIC=-866.81   AICc=-866.15   BIC=-839.37

Вывод в Ма c

Series: log(via_train) 
ARIMA(4,0,0)(2,1,2)[12] with drift 

Coefficients:
Warning message in sqrt(diag(x$var.coef)):
“NaNs produced”
         ar1     ar2     ar3      ar4     sar1    sar2     sma1     sma2
      0.6157  0.1934  0.0989  -0.0114  -0.3737  0.2908  -0.1539  -0.6143
s.e.     NaN     NaN     NaN   0.0082      NaN     NaN   0.0554   0.0649
       drift
      0.0033
s.e.  0.0005

sigma^2 estimated as 0.001223:  log likelihood=441.66
AIC=-863.32   AICc=-862.31   BIC=-829.03

Добавлена ​​информация о системе

Windows:

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252  
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                 
[5] LC_TIME=Spanish_Spain.1252   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods 
[7] base

other attached packages:
 [1] readxl_1.3.1     dplyr_0.8.3      zoo_1.8-7      
 [4] tseries_0.10-47  forecast_8.10    FactoMineR_2.2 
 [7] corrplot_0.84    cluster_2.1.0    factoextra_1.0.6
[10] ggplot2_3.2.1  

loaded via a namespace (and not attached):
[1] tidyselect_0.2.5     reshape2_1.4.3       purrr_0.3.3        
 [4] urca_1.3-0           lattice_0.20-38      colorspace_1.4-1   
 [7] vctrs_0.2.1          utf8_1.1.4           rlang_0.4.2        
[10] pillar_1.4.3         glue_1.3.1           withr_2.1.2        
[13] TTR_0.23-6           plyr_1.8.5           lifecycle_0.1.0    
[16] stringr_1.4.0        quantmod_0.4-15      timeDate_3043.102  
[19] munsell_0.5.0        gtable_0.3.0         cellranger_1.1.0   
[22] leaps_3.1            labeling_0.3         lmtest_0.9-37      
[25] parallel_3.6.2       curl_4.3             fansi_0.4.0        
[28] xts_0.12-0           Rcpp_1.0.3           scales_1.1.0       
[31] backports_1.1.5      flashClust_1.01-2    scatterplot3d_0.3-41
[34] farver_2.0.1         fracdiff_1.5-1       digest_0.6.23      
[37] stringi_1.4.3        ggrepel_0.8.1        grid_3.6.2          
[40] quadprog_1.5-8       cli_2.0.0            tools_3.6.2        
[43] magrittr_1.5         lazyeval_0.2.2       tibble_2.1.3       
[46] crayon_1.3.4         pkgconfig_2.0.3      zeallot_0.1.0      
[49] MASS_7.3-51.4        assertthat_0.2.1     rstudioapi_0.10    
[52] R6_2.4.1             nnet_7.3-12          nlme_3.1-142       
[55] compiler_3.6.2

Ма c (после обновления):

R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] readxl_1.3.1     dplyr_0.8.3      zoo_1.8-7        tseries_0.10-47 
 [5] forecast_8.10    FactoMineR_2.1   corrplot_0.84    cluster_2.1.0   
 [9] factoextra_1.0.6 ggplot2_3.2.1   

loaded via a namespace (and not attached):
 [1] ggrepel_0.8.1        Rcpp_1.0.2           lubridate_1.7.4     
 [4] lattice_0.20-38      class_7.3-15         digest_0.6.22       
 [7] zeallot_0.1.0        utf8_1.1.4           assertthat_0.2.1    
[10] glmnet_3.0-2         ipred_0.9-9          lmtest_0.9-37       
[13] foreach_1.4.7        cellranger_1.1.0     R6_2.4.0            
[16] plyr_1.8.4           backports_1.1.5      stats4_3.6.2        
[19] pillar_1.4.2         rlang_0.4.1          curl_4.2            
[22] lazyeval_0.2.2       caret_6.0-84         rstudioapi_0.10     
[25] data.table_1.12.6    fracdiff_1.5-0       TTR_0.23-6          
[28] rpart_4.1-15         Matrix_1.2-18        labeling_0.3        
[31] splines_3.6.2        gower_0.2.1          stringr_1.4.0       
[34] munsell_0.5.0        compiler_3.6.2       pkgconfig_2.0.3     
[37] urca_1.3-0           shape_1.4.4          nnet_7.3-12         
[40] flashClust_1.01-2    tidyselect_0.2.5     tibble_2.1.3        
[43] prodlim_2019.11.13   quadprog_1.5-8       codetools_0.2-16    
[46] fansi_0.4.0          crayon_1.3.4         withr_2.1.2         
[49] MASS_7.3-51.4        leaps_3.0            recipes_0.1.8       
[52] ModelMetrics_1.2.2   grid_3.6.2           nlme_3.1-142        
[55] gtable_0.3.0         magrittr_1.5         pROC_1.15.3         
[58] scales_1.0.0         quantmod_0.4-15      cli_1.1.0           
[61] stringi_1.4.3        reshape2_1.4.3       scatterplot3d_0.3-41
[64] timeDate_3043.102    vctrs_0.2.0          xts_0.12-0          
[67] generics_0.0.2       lava_1.6.6           iterators_1.0.12    
[70] tools_3.6.2          glue_1.3.1           purrr_0.3.3         
[73] parallel_3.6.2       survival_3.1-8       colorspace_1.4-1 
...