I have a zoo
time series in R:
d <- structure(c(50912, 50912, 50912, 50912, 50913, 50913, 50914,
50914, 50914, 50915, 50915, 50915, 50916, 5
I have analysed such irregular data in the past using an additive model to "decompose" the seasonal and trend components. As this is a regression-based approach you need to model the residuals as a time series process to account for lack of independence in the residuals.
I used the mgcv package for these analysis. Essentially the model fitted is:
require(mgcv)
require(nlme)
mod <- gamm(response ~ s(dayOfYear, bs = "cc") + s(timeOfSampling), data = foo,
correlation = corCAR1(form = ~ timeOfSampling))
Which fits a cyclic spline in the day of the year variable dayOfYear
for the seasonal term and the trend is represented by timeOfSampling
which is a numeric variable. The residuals are modelled here as a continuous-time AR(1) using the timeOfSampling
variable as the time component of the CAR(1). This assumes that with increasing temporal separation, the correlation between residuals drops off exponentially.
I have written some blog posts on some of these ideas:
which contain additional R code for you to follow.