1

I am trying to run bfast::bfast() for time series analysis of a dataset for the year 2003 with 365 observations. Unfortunately I always get the same Error message. I would be grateful for your help!

mydata_2003 <- mydata[1:365, ]
# to extract the data for the year 2003 from a dataframe
# (each row one observation)

mydata_2003_ts <- ts(data = mydata_2003$area, start = c(2003, 1),
                     end = c(2003, 12), frequency = 365)
# convert the data for the year 2003 into a ts-object

mydata_2003_bfast <- bfast(Yt = mydata_2003_ts, season = "dummy",
                           max.iter = 1)

Error in stl(Yt, "periodic") :
      series is not periodic or has less than two periods
ExploreR
  • 313
  • 4
  • 15
  • So, do you have a period in your time series? Do you have enough data? – user2974951 Dec 20 '18 at 13:56
  • @user2974951 yes, it is like i said, i have got 365observations for the year 2003, every day i have got a new measurement. – ExploreR Dec 20 '18 at 14:56
  • `stl()` is trying to decompose the timeseries that's where your error is. If you could attach the data, it would help. Also this may help https://stackoverflow.com/questions/21123039/error-when-trying-to-use-stl-and-decompose-functions-in-r – SamFlynn Dec 20 '18 at 15:19
  • @SamFlynn thanks a lot for your help! unfortunately i am not allowed to share the data. but the original dataset is a dataframe with two columns; one with the date (YYYY-MM-DD) and the other one is a numeric vector (float). – ExploreR Dec 20 '18 at 15:24

0 Answers0