robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.11k stars 341 forks source link

tsclean error #638

Closed dashaub closed 6 years ago

dashaub commented 6 years ago

Encountered this when using tsclean

data <- ts(c(-100, 0, 100, 0, 0, 0, 0, -100, 0, 0, 0, 0, 100, 0, 0, -100, 0, 0, 0, 100, 0, 0, 0, 0, 0, -100, 0, 0, 100, 0, 100, 0, 0, -100, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, -100, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 100, 0, 0, 0, 0, -100, 0, 0, -100, 0, 0, 0, 0, 100, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 0, -100, -100, -100, -100, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, -100, 0, -100, 0, 100, 100, 100, 100, 0, 0, 0, -100, 100, 0, 0, 100, 0, 0, -100, 0, 100, 100, 100, 200, 100, 100, 0, -100, -200, -100, -100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 100, 0, 100, 0, -100, 0, 0, 100, 100, 100, 0, 100, 0, 0, -100, 0, 0, 0, 0, 0, 0, 100, 0, 0, 100, 0, 100, 100, 100, 0, -100, 0, 300, 0, -100, 0, 0, 0, 0, 0, 100, 0, 100, 100, 100, -100, -100, -200, -200, -100, 0, 100, 100, 100, 0, 0, 100, 100, 100, 100, 100, 0, 0, -100, -100, 0, 0, 100, 100, 0, 100, 100, 100, 200, 100, 0, -100, -100, -100, -100, 100, 100, 100, 100, 0, -100, -200, -100, 0), f = 12)
tsclean(data)
Error in if (strength >= 0.05) xx <- seasadj(fit) : 
  missing value where TRUE/FALSE needed

This is on the latest Github version

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.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] compiler  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] cpm_2.2               nortest_1.0-4         entropy_1.2.1        
[4] uroot_2.0-9           e1071_1.6-8           tseries_0.10-42      
[7] thief_0.3             forecastHybrid_2.0.10 forecast_8.3         

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15      magrittr_1.5      doParallel_1.0.11 munsell_0.4.3    
 [5] colorspace_1.3-2  lattice_0.20-35   rlang_0.1.6       quadprog_1.5-5   
 [9] foreach_1.4.4     TTR_0.23-2        plyr_1.8.4        tools_3.4.3      
[13] xts_0.10-1        nnet_7.3-12       parallel_3.4.3    quantmod_0.4-12  
[17] grid_3.4.3        nlme_3.1-131      timeDate_3042.101 gtable_0.2.0     
[21] urca_1.3-0        class_7.3-14      iterators_1.0.9   lazyeval_0.2.1   
[25] lmtest_0.9-35     tibble_1.4.1      ggplot2_2.2.1     codetools_0.2-15 
[29] curl_3.1          fracdiff_1.4-2    pillar_1.1.0      scales_0.5.0     
[33] zoo_1.8-1  
robjhyndman commented 6 years ago

Fixed in https://github.com/robjhyndman/forecast/commit/3b669711c0910eb92c270bb651629cdf725d5635