Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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.</p> <p>I used the <strong>mgcv</strong> package for these analysis. Essentially the model fitted is:</p> <pre><code>require(mgcv) require(nlme) mod &lt;- gamm(response ~ s(dayOfYear, bs = "cc") + s(timeOfSampling), data = foo, correlation = corCAR1(form = ~ timeOfSampling)) </code></pre> <p>Which fits a cyclic spline in the day of the year variable <code>dayOfYear</code> for the seasonal term and the trend is represented by <code>timeOfSampling</code> which is a numeric variable. The residuals are modelled here as a continuous-time AR(1) using the <code>timeOfSampling</code> variable as the time component of the CAR(1). This assumes that with increasing temporal separation, the correlation between residuals drops off exponentially.</p> <p>I have written some blog posts on some of these ideas:</p> <ol> <li><a href="http://www.fromthebottomoftheheap.net/2011/07/21/smoothing-temporally-correlated-data/" rel="noreferrer">Smoothing temporally correlated data</a></li> <li><a href="http://www.fromthebottomoftheheap.net/2011/06/12/additive-modelling-and-the-hadcrut3v-global-mean-temperature-series/" rel="noreferrer">Additive modelling and the HadCRUT3v global mean temperature series</a></li> </ol> <p>which contain additional R code for you to follow.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload