I have time-series power consumption data for one month. The data is sampled at minutes frequency. Thus, for each day I have 1440 observations and for the month (30 days) I have 4320 observations. On the same data, I use stl() function to observe seasonality, trend, etc. I have following doubts:

  1. What should be the frequency value while creating the ts (timeSeries) object? Is it 1440 (no. of observations per day) or it is 30 (no. of days for which observations are recorded)
  2. In the stl function, I need to provide values for s.window, t.window. Should I use the value of frequency for s.window? I am clueless about trend window.

I am following this page to understand these concepts.


  1. My Ist doubt got cleared while reading this page, where Dr. Rob mentions that frequency is the number of observations per season. Thus, the answer to my first doubt is 1440 as season is represented by each day in my data.
  • 1
    $\begingroup$ About stl, did you already read the associated paper? $\endgroup$ – user81847 Mar 1 '16 at 5:06
  • $\begingroup$ I read the associated book chapter, but still unable to understand the relation between s.window and frequency. I find the seasonality, more intuitive while setting s.window to 30 as compared to 1440 $\endgroup$ – Haroon Rashid Mar 1 '16 at 5:18
  • $\begingroup$ Although asked in terms of an R function, these questions seem clearly statistical to me. IMO, this should be considered on topic here. $\endgroup$ – gung Mar 1 '16 at 12:27
  • $\begingroup$ @gung, Yes, this is a statistical question. If this is not the correct place to ask this question, then can you please refer me to the correct place. $\endgroup$ – Haroon Rashid Mar 2 '16 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.