robjhyndman / forecast

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

splinef errors out on some series #828

Closed Arsa-Nik closed 4 years ago

Arsa-Nik commented 4 years ago

I was just wondering the computationally singular error that I am getting while running splinef can be fixed. (forecast version 8.9) here are two examples with quarterly series. ts1 <- c(99,100,100,99,98,98,100,101,101,102,101,100,100,99,97,91,88,91,99,108,114,117,127,141,154,154,145,140,146,155,159,168,188,212,220,203,181,183,204,225,230,229,233,242,249,255,259,263,269,273,275,278,274,268,287,327,362,369,351,342,358,378,394,405,406,404,407,418,434,454,472,488,494,497,524,566,593,594,579,577,591,606,618,648,719,793,837,850,844,878,933,974,1010,1026,1011,976,926,906,970,1049,1082,1061,1041,1097,1194,1243,1283,1306,1323,1328,1331,1350,1393,1433,1479,1509,1535,1582,1613,1619,1611,1660,1728,1749,1722,1696,1711,1787,1847,1895,1917,1933,1971,2011,2028,2017,2023,2081,2166,2176,2085,2027,2039,2093,2135,2129,2115,2092,2071,2085,2095,2097,2098,2105,2138,2214,2294,2345,2350,2335,2353,2405,2506,2580,2552,2560,2674,2860,2997,2989,2964,2981,3060,3202,3342,3404,3411,3401,3403,3392,3379,3369,3395,3451,3535,3626,3711,3826,4000,4156,4215,4181,4136,4139,4268,4490,4675,4727,4659,4589,4606,4660,4797,4987,5164,5299,5357,5348,5313,5271,5239,5217,5176,5144,5098,5013,5057,5279,5559,5766,5811,5816)

ts2 <- c(1531,1554,1580,1602,1610,1605,1594,1575,1565,1572,1589,1608,1615,1621,1646,1682,1721,1757,1782,1809,1832,1846,1857,1871,1885,1896,1898,1904,1920,1945,1984,2025,2048,2048,2043,2056,2090,2127,2154,2172,2190,2217,2237,2261,2281,2305,2335,2366,2377,2373,2368,2407,2475,2537,2566,2586,2632,2673,2691,2658,2608,2586,2597,2600,2585,2535,2505,2488,2471,2438,2409,2400,2404,2409,2423,2436,2448,2451,2451,2448,2439,2444,2482,2532,2564,2577,2597,2634,2682,2718,2736,2756,2796,2838,2879,2885,2871,2880,2916,2931,2917,2933,3019,3116,3149,3119,3092,3088,3076,3059,3059,3092,3139,3155,3138,3122,3134,3152,3157,3139,3126,3125,3124,3104,3071,3024,2998,3008,3049,3109,3148,3143,3098,3036,2990,2973,2978,3001,3018,3028,3029,3046,3079,3116,3157,3196,3226,3244,3243,3234,3230,3239,3253,3263,3304,3380,3462,3502,3510,3541,3587,3607,3601,3588,3623,3708,3793,3847,3864,3869,3893,3958,4055,4163,4236,4280,4345,4442,4549,4638,4716,4804,4901,4984,5038,5103,5218,5358,5487,5559,5609,5682,5793,5876,5892,5858,5848,5936,6095,6214,6273,6290,6343,6438,6483,6475,6428,6371,6364,6424,6505,6547,6527,6520,6585,6739,6912,7009,7005,6966,6979,7063)

Thanks,

robjhyndman commented 4 years ago

I've set a lower bound on beta (ea43e1f7eb11932e98b8f1a30db942ee7c2c7de3) which fixes the problem for these two series. Let me know if you still have problems.

Arsa-Nik commented 4 years ago

There are actually quite a few (791 series) on M4 monthly and 12 on M4 quarterly series. I gather few of them here: https://gist.github.com/Arsa-Nik/e9deb7eb56784a4ef51fce563e31bc9e Thank you.

robjhyndman commented 4 years ago

I've increased the bound in https://github.com/robjhyndman/forecast/commit/06d557035df605222c627e09cefbead9b15bd965. Those five now work ok.