| regul.adj | R Documentation |
Calculate and plot an histogram of the distances between interpolated observations in a regulated time series and closest observations in the initial irregular time series. This allows to optimise the tol parameter
regul.adj(x, xmin=min(x), frequency=NULL,
deltat=(max(x, na.rm = TRUE) - min(x, na.rm = TRUE))/(length(x) - 1),
tol=deltat, tol.type="both", nclass=50, col=c(4, 5, 2),
xlab=paste("Time distance"), ylab=paste("Frequency"),
main="Number of matching observations", plotit=TRUE, ...)
x |
a vector with times corresponding to the observations in the irregular initial time series |
xmin |
the time corresponding to the first observation in the regular time series |
frequency |
the frequency of observations in the regular time series |
deltat |
the interval between two successive observations in the regular time series. This is the inverse of |
tol |
the tolerance in the difference between two matching observations (in the original irregular series and in the regulated series). If |
tol.type |
the type of window to use for the time-tolerance: |
nclass |
the number of classes to compute in the histogram. This is indicative, and will be adjusted by the algorithm to produce a nicely-formatted histogram. The default value is |
col |
the three colors to use to represent respectively the fist bar (exact coincidence), the middle bars (coincidence in a certain tolerance window) and the last bar (values always interpolated). By default, |
xlab |
the label of the x-axis |
ylab |
the label of the y-axis |
main |
the main title of the graph |
plotit |
if |
... |
additional graph parameters for the histogram |
This function is complementary to regul.screen(). While the later look for the best combination of the number of observations, the interval between observations and the position of the first observation on the time-scale for the regular time series, regul.adj() look for the optimal value for tol, the tolerance window.
A list with components:
params |
the parameters used for the regular time-scale |
match |
the number of matching observations in the tolerance window |
exact.match |
the number of exact matching observations |
match.counts |
a vector with the number of matching observations for increasing values of |
Philippe Grosjean (phgrosjean@sciviews.org), Frédéric Ibanez (ibanez@obs-vlfr.fr)
regul.screen, regul
# This example follows the example for regul.screen()
# where we determined that xmin=9, deltat=21, n=63, with tol=1.05
# is a good choice to regulate the irregular time series in 'releve'
data(releve)
regul.adj(releve$Day, xmin=9, deltat=21)
# The histogram indicates that it is not useful to increase tol
# more than 1.05, because few observations will be added
# except if we increase it to 5-7, but this value could be
# considered to be too large in comparison with deltat=22
# On the other hand, with tol <= 1, the number of matching
# observations will be almost divided by two!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.