简体   繁体   中英

understanding error message from forecast.gts

I'm struggling with creating a forecast using the forecast.gts function. I'm getting an error message/warning that I do not understand and do need some guidance in where to look so I can find out how to setup the right forecast. The code that i'm running is:

SFA4 <- ts(SFA4, frequency=12, start=c(2012,1), end=c(2017,9)) 
library(forecast)
library(hts)

# Creating the gts model to be used for forecast
SFA5 <- gts(SFA4, characters=c(2, c(1, 2)))
f <- forecast.gts(SFA5, h=2, method="comb", fmethod="ets", algorithms = "lu", weights = "wls", lambda=0)

The error message that i'm getting is:

Warning message:
In value[[3L]](cond) :
  An error in LU decomposition occurred, the message was the following:
cs_lu(A) failed: near-singular A (or out of memory)
 Trying QR decomposition instead...

The data can be described in this way: I do have two customers bying the same products and have tried to excluded negative sales (replaced with zero) and month with no sales (adding 1 to all month where sales = zero).

I'm relatively new to R and forecasting and not trying to get my work done, but simply trying to find out where to look to find out which parameters to use for the algorithms, weights, method etc. The easiest way is naturally to run through all combinations and choose the forecast with the lowest variance. I do not get a warning when using method="bu", but I would like to understand how to find out which parameters to set when.

Here is the data (SFA4): https://www.dropbox.com/s/2shh5pjojq4qzfu/Data1850.xlsx?dl=0

When using LU decomposition, it encounters the singularity problem, and hence it failed. You could try algorithms = "cg" that uses the conjugate gradient to reconcile the base forecasts. What matters most for the algorithms choice is the speed performance. Generally lu > cg > chol > recursive > slm (from faster to slower). They should return the identical results given the method ( method ) and forecasting method ( fmethod ).

?forecast.gts pops out the documentation for the forecast.gts function. It lists all the parameters and references that you would find helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM