Closed gabrielcaceres closed 8 years ago
Follow up to my comments on #316.
When using h>1 to do h-step forecasts, results are all NA. For example:
h>1
NA
fit1 <- auto.arima(WWWusage) fitted(fit1, h=2) # all NAs fit2 <- ets(WWWusage) fitted(fit2, h=2) # all NAs
but using hfitted directly works.
hfitted
hfitted(fit1, h=2) # correct hfitted(fit2, h=2) # correct
I believe this due to the FUN argument when calling hfitted in the fitted.XXX method. For example, see the following line of fitted.Arima:
FUN
fitted.XXX
fitted.Arima
return(hfitted(object=object, h=h, FUN=Arima, biasadj=biasadj, ...))
FUN=Arima should be FUN="Arima" or left as the default of FUN=class(object); the same should apply for all other methods.
FUN=Arima
FUN="Arima"
FUN=class(object)
Additionally, when the xreg argument is used, getting the fitted values with h>1 fails (regardless of the above issue). See:
xreg
library(fpp) fit <- auto.arima(usconsumption[, 1], xreg=usconsumption[, 2]) fitted(fit, h=2) # all NAs hfitted(fit, h=2) # all NAs
Thanks. First issue now fixed.
@robjhyndman The second issue was fixed in #327, the above code appears to work without error now.
Follow up to my comments on #316.
When using
h>1
to do h-step forecasts, results are allNA
. For example:but using
hfitted
directly works.I believe this due to the
FUN
argument when callinghfitted
in thefitted.XXX
method. For example, see the following line offitted.Arima
:FUN=Arima
should beFUN="Arima"
or left as the default ofFUN=class(object)
; the same should apply for all other methods.Additionally, when the
xreg
argument is used, getting the fitted values withh>1
fails (regardless of the above issue). See: