robjhyndman / forecast

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

stlm with model decomposes on all data #817

Closed davidreilly007 closed 2 years ago

davidreilly007 commented 5 years ago

Hi Rob

Not sure if this is an issue or just a choice of methodology. In the following you decompose all of the data on the second stlm. I would have thought you would use only the train portion to do that, since it is part of the model (with naive seasonal forecast used on new portion).

ap=ts(AirPassengers,start=c(1949,1),frequency=12) log.AP = log(ap) train <- head(log.AP,n=120) etsmod <- stlm(train,method="ets",etsmodel="AAN") logAP.stlm <- stlm(log.AP,model=etsmod)

robjhyndman commented 2 years ago

Going through old issues and found this one from 2+ years ago. I'm not sure what the question is. The code does show a decomposition on all the data in the last line. But I don't think it's my code. So what's the problem?

davidreilly007 commented 2 years ago

Hi Rob

Sorry for the late reply. Just noticed your comment. I can’t recall the details so closing.