robjhyndman / forecast

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

TBATS optimization fails #861

Closed catapulta closed 4 years ago

catapulta commented 4 years ago

Hello, first of all thank you for such a great library. I wanted to report an issue with TBATS:

library(forecast)
tbats(ts(c(799.04,399.52,0.00), freq=12))

from which I get:

Error in optim(par = param.vector$vect, fn = calcLikelihoodNOTransformed,  : 
   function cannot be evaluated at initial parameters`

This is my current environment:

sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.15.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.5/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] forecast_8.12.0.9000

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0        rstudioapi_0.11   magrittr_1.5      munsell_0.5.0     colorspace_1.4-0 
 [6] lattice_0.20-38   rlang_0.4.5       quadprog_1.5-5    TTR_0.23-4        plyr_1.8.4       
[11] xts_0.11-2        tools_3.5.2       nnet_7.3-12       parallel_3.5.2    quantmod_0.4-13  
[16] grid_3.5.2        nlme_3.1-137      timeDate_3043.102 gtable_0.2.0      urca_1.3-0       
[21] tseries_0.10-46   lazyeval_0.2.1    lmtest_0.9-36     tibble_2.0.1      crayon_1.3.4     
[26] ggplot2_3.1.0     curl_3.3          fracdiff_1.4-2    compiler_3.5.2    pillar_1.3.1     
[31] scales_1.0.0      pkgconfig_2.0.2   zoo_1.8-4
robjhyndman commented 4 years ago

Thanks for the report. It should be fixed in https://github.com/robjhyndman/forecast/commit/138566bb6e94da60bec2d326cdf9be17930573d4