fill_gaps | R Documentation |
The function fills gaps in a data.frame
with dendrometer series using an ARMA model (cf. Deslauriers et al. 2011), and is designed for single growing seasons. The function is able to fill gaps of short duration (i.e. several hours), but cannot sensibly handle long gaps.
fill_gaps(dm.data, Hz = 0.01, season = FALSE)
dm.data |
a |
Hz |
a |
season |
a |
The function uses auto.arima
to fill missing records. The non-seasonal part of the model is specified by the three integer components: the AR order p, the degree of differencing d, and the MA order q. For the seasonal part of the model, the period parameter is set equal to the number of daily measurements observed in the dendrometer data. The output of the ARMA model is smoothed using smooth.Pspline
. The smoothing parameter Hz can be adjusted; defaults to 0.01.
The function is designed for single growing seasons, amongst others because ARMA-based gap-filling routines will then perform best (i.e. ARMA parameters might be distinct for individual growing seasons). To allow the usage of fill_gaps
for datasets from the Southern Hemisphere, the input data may contain two consecutive calendar years.
The function returns a data.frame
with gap-filled dendrometer series.
Olivier Bouriaud, Ernst van der Maaten, Marieke van der Maaten-Theunissen and Marko Smiljanic.
Deslauriers, A., Rossi, S., Turcotte, A., Morin, H. and Krause, C. (2011) A three-step procedure in SAS to analyze the time series from automatic dendrometers. Dendrochronologia 29: 151-161.
data(dmCD)
# creating some artificial gaps (for demonstration purposes):
dmCD[c(873:877,985:990),1] <- NA
# slow, as also seasonal models are checked, but best possible gap-filling:
dm.gpf <- fill_gaps(dmCD, Hz = 0.01, season = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.