fill_gaps: Fill gaps in dendrometer series

Description Usage Arguments Details Value Author(s) References Examples

View source: R/fill_gaps.R

Description

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.

Usage

1
fill_gaps(dm.data, Hz = 0.01, season = FALSE)

Arguments

dm.data

a data.frame with a timestamp (%Y-%m-%d %H:%M:%S format) as row names, and dendrometer series in columns. Output as created using code from the Import dendrometer data vignette.

Hz

a numeric specifying the parameter for smoothing with ARMA gap-filling. A higher value means rougher smoothing. Defaults to 0.01.

season

a logical indicating whether auto.arima should check seasonal models; can be very slow. Defaults to FALSE, i.e. search restricted to non-seasonal models.

Details

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.

Value

The function returns a data.frame with gap-filled dendrometer series.

Author(s)

Olivier Bouriaud, Ernst van der Maaten, Marieke van der Maaten-Theunissen and Marko Smiljanic.

References

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.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

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)

## End(Not run)

dendrometeR documentation built on May 2, 2019, 6:34 a.m.