diurnalAdj {ACDm} | R Documentation |
Dirunal adjustment for durations
Description
Performs a diurnal adjustment of the durations, i.e. removes a daily seasonal component. Four different methods of diurnal adjustment are available, namely "cubicSpline", "supsmu" (Friedman's SuperSmoother), "smoothSpline" (smoothed version of the cubic spline), or "FFF" (Flexible Fourier Form).
Usage
diurnalAdj(dur, method = "cubicSpline", nodes = c(seq(600, 1105, 60), 1105),
aggregation = "all", span = "cv", spar = 0, Q = 4, returnSplineFnc = FALSE)
Arguments
dur |
a data.frame containing the columns |
method |
the method used. One of "cubicSpline", "supsmu", "smoothSpline", or "FFF". |
nodes |
only for |
aggregation |
what type of aggregation to use. Either "weekdays", "all", or "none". If for example "weekdays" is chosen, all Mondays will have the same daily seasonal component, and so on. |
span |
argument passed to supsmu if |
spar |
argument passed to smooth.spline if |
Q |
number of trigonometric function pairs for |
returnSplineFnc |
if |
Value
If returnSplineFnc
is FALSE
(default): the input
data.frame dur
with an added column of the diurnally adjusted
durations called 'adjDur'.
Otherwise, a list of spline objects containing the coefficents of the spline function.
Author(s)
Markus Belfrage
Examples
diurnalAdj(durData, aggregation = "none", method = "supsmu")
## Not run:
head(durData)
f <- diurnalAdj(durData, aggregation = "weekdays", method = "FFF", Q = 3)
head(f)
f <- diurnalAdj(durData, aggregation = "all", returnSplineFnc = TRUE)
f
## End(Not run)