0

I have the following vector:

vector2 <- c(24048068,26598794,21576111,20196318,26785149,27248835,23879436,29962147, 
                  27757825,30110057,39532376,31020232)

an turned it to a time series object

ts <- ts(vector, start =c(2017,06), end = c(2018,05), frequency = 12)

Now, I want to decompose it with the stl function.

ts2 <- stl(ts)

But I get the following error: time series is not periodic or has less than two periods. I know, that there already exist similar questions, but no answer could solve my problem. Does anybody has an idea?

nississippi
  • 327
  • 2
  • 17
  • 1
    This really has been answered many times. You can't decompose a series using stl if you only have one year's worth of monthly data. You could use a regression approach. See: https://robjhyndman.com/hyndsight/tslm-decomposition/ – G. Grothendieck Jul 20 '18 at 14:55
  • Looking at `plot(vector2)` also doesn't appear to show any periodicity at all. – Anonymous coward Jul 20 '18 at 15:00

0 Answers0