Reputation: 1
I have a time series with irregular time data from 2006 to 2020 including just the summer months (June, July, August). And I would like to get informations about trend, seasonality and mostly residuals.
Now,I did a complete time axis for each day over the years and merged my lst data.
library(forecast)
library(xts)
timestamps <- data$date
dataRep <- data.frame(timestamps= as.Date(c("2007-07-15","2007-07-24", "2007-07-29","2009-06-25")),
lst = c(23.3132725761094, 27.5978287205735, " ",25.6451943453992))
tstamp <- data.frame(x = seq(head(dataRep$timestamps,1),tail(dataRep$timestamps,1),by ="day"))
res <- merge(tstamp,dataRep,by.x="x", by.y="timestamps", all.x=TRUE)
tsData <-xts(res$lst,order.by =res$x)
Now, I wanted to apply my tsData to decompose() or slt(), but it didn't work and I got the following errors.
xts.stl <- stl(tsData,s.window="periodic")
Error: Error in na.fail.default(as.ts(x)) : missing values in object
decompose(as.ts(tsData))
Error: Error in decompose(as.ts(tsData)) : time series has no or less than 2 periods
Could someone help me please?
Upvotes: 0
Views: 353