Closed Steviey closed 2 years ago
Hi, This is because of the conflicting methods in the packages. I've submitted on CRAN the new version of greybox that is supposed to resolve this. Please, give it a try with the development versions of the package:
Windows 7, greybox 1.0.5.41001, smooth 3.1.6.41004, R version 4.0.5
I get the same result with the versions above...
liveData<-0
if(liveData<1){
idx=120
y<-rnorm(idx, mean=15, sd=5)
x<-cbind(
x1 = rnorm(idx, mean=15, sd=5)
,x2 = rnorm(idx, mean=15, sd=5)
,x3 = rnorm(idx, mean=15, sd=5)
,x4 = rnorm(idx, mean=15, sd=5)
,x5 = rnorm(idx, mean=15, sd=5)
)
data <- data.frame(x=x,value=y,stringsAsFactors=F)
data <- data %>% dplyr::relocate(value)
}
myModel <- adam(data,"ANN",silent=TRUE,h=1,holdout=FALSE)
myPlot<-plot(forecast::forecast(myModel,h=10,interval="complete",nsim=100),main="Complete prediction interval")
print(myPlot)
View(myModel)
stop()
Error in is.constant(y) :
'list' object cannot be coerced to type 'double'
Please, use:
myPlot<-plot(forecast(myModel,h=10,interval="complete",nsim=100),main="Complete prediction interval")
instead of forecast::forecast(myModel,...)
. If this doesn't work (which could mean that forecast package hasn't updated its imports) then use generics::forecast(myModel,...)
.
Wow, generics works...
One question: I like to customize the graph. ggplot+plotly allows zooming and panning. I can do this with smooth::es()...but I have no entries: 'lower' and 'upper' for the intervals in the adam-model to do so...Can you provide these?
In adam()
, you need to produce forecasts, it does not generate intervals inside the function itself. So, it is closer to the style of forecast
functions. Here is an example:
forecast(adamModel, h=h, interval="prediction", level=c(0.9,0.95))
R 4.0.5, smooth 3.1.5
I try the following code and get the error-msg. below: