Giter Club home page Giter Club logo

Comments (8)

robjhyndman avatar robjhyndman commented on July 26, 2024

You have the frequency set to 1 so forecast doesn't know anything about the seasonality. It looks like your seasonality is around 100 periods, in which case frequency should be 100.

from hts.

Sbrowneo avatar Sbrowneo commented on July 26, 2024

Thanks for the quick response! I was trying to set the frequency but I didn't see how. I set it in the ts object before converting to the hts object, but then it reset to 1 and 'frequency' wasn't an argument when setting the hts object. How can I do this? Or do I need to deal with seasonality before hts forecast?

Thanks again!

S

from hts.

robjhyndman avatar robjhyndman commented on July 26, 2024

If you set it in the ts object it should be retained. See https://otexts.com/fpp2/hts.html for an example where this is done with seasonal data.

from hts.

Sbrowneo avatar Sbrowneo commented on July 26, 2024

It turns out when I subsetted my ts object into train and test objects it removed the frequency! I'll give it another go. I usually code in python so I'm liable to make stupid mistakes in R. Thanks again!

from hts.

robjhyndman avatar robjhyndman commented on July 26, 2024

Use the window() function for subsetting ts and hts objects

from hts.

Sbrowneo avatar Sbrowneo commented on July 26, 2024

Hello again! I'm trying now to combine the fourier function from 9.5 of your textbook to deal with seasonality. It works on a normal ts object, but when I set xreg=fourier(my.hst,K=11) I get this error:

Error in ...fourier(x, K, 1:NROW(x)) : 
  K must be not be greater than period/2

NROW(hts) seems to be 3, and I couldn't find a way to index hts that would allow it to work. Is there a way to do this?

Thanks again!

S

from hts.

Sbrowneo avatar Sbrowneo commented on July 26, 2024

In an unrelated question (I wasn't sure if I should start a new thread), I was curious to know how an hts forecast would handle partially complete time series. For instance, if one base time series has a length of 100, but base time series #2 is only at 90 and I would like to forecast the remaining 10. Of course I could limit all the time series to 90, but I would prefer to use the information from the series for which I have complete data. How would hst handle the missing values in some of the series, and is there a way to forecast those values aside from removing all rows with NAs?

Thank you, I really appreciate the help!

Best
S

from hts.

robjhyndman avatar robjhyndman commented on July 26, 2024

I suggest you ask these questions on http://community.rstudio.com. This is not intended to be a help site.

from hts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.