Learn R Programming

qualV (version 0.3-5)

qvalLCS: Qualitative Validation by Means of Interval Sequences and LCS

Description

Dividing time series into interval sequences of qualitative features and determining the similarity of the qualitative behavior by means of the length of LCS.

Usage

qvalLCS(o, p,
        o.t     = seq(0, 1, length.out = length(o)),
        p.t     = seq(0, 1, length.out = length(p)),
        smooth  = c("none", "both", "obs", "sim"),
        feature = c("f.slope", "f.curve", "f.steep", "f.level"))
# S3 method for qvalLCS
print(x, ...)
# S3 method for qvalLCS
plot(x, y = NULL, ..., xlim = range(c(x$obs$x, x$sim$x)),
ylim = range(c(x$obs$y, x$sim$y)), xlab = "time", ylab = " ",
col.obs = "black", col.pred = "red",
plot.title = paste("LLCS =", x$lcs$LLCS, ", QSI =", x$lcs$QSI),
legend = TRUE)
# S3 method for qvalLCS
summary(object, ...)

Value

The result is an object of type qvalLCS with the following entries:

smooth

smoothing parameter

feature

feature parameter

o

xy-table of observed values

p

xy-table of predicted values

obs

xy-table of (smoothed) observed values

sim

xy-table of (smoothed) simulated values

obsf

interval sequence of observation according to selected features

simf

interval sequence of simulation according to selected features

lcs

output of LCS function

obs.lcs

one LCS of observation

sim.lcs

one LCS of simulation

Arguments

o

vector of observed values

p

vector of predicted values

o.t

vector of observation times

p.t

vector of times for predicted values

smooth

character string to decide if values should be smoothed before validation, default no smoothing "none" is set, "both" observed and predicted values will be smoothed, "obs" only observed, and "sim" only simulated values will be smoothed.

feature

one of "f.slope", "f.curve", "f.steep", "f.level" as defined in features to divide the time series into interval sequences of these feature. As default the first derivative "f.slope" is used.

x

a result from a call of qvalLCS

y

y unused

...

further parameters to be past to plot

xlim

the size of the plot in x-direction

ylim

the size of the plot in y-direction

xlab

the label of the x-axis of the plot

ylab

the label of the y-axis of the plot

col.obs

color to plot the observations

col.pred

color to plot the predictions

plot.title

title for the plot

legend

tegend for the plot

object

a result from a call of qvalLCS

Details

Common quantitative deviance measures underestimate the similarity of patterns if there are shifts in time between measurement and simulation. These methods also assume compareable values in each time series of the whole time sequence. To compare values independent of time the qualitative behavior of the time series could be analyzed. Here the time series are divided into interval sequences of their local shape. The comparison occurs on the basis of these segments and not with the original time series. Here shifts in time are possible, i.e. missing or additional segments are acceptable without losing similarity. The dynamic programming algorithm of the longest common subsequence LCS is used to determine QSI as index of similarity of the patterns.
If selected the data are smoothed using a weighted average and a Gaussian curve as kernel. The bandwidth is automatically selected based on the plug-in methodology (dpill, see package KernSmooth for more details).

print.qvalLCS

prints only the requested value, without additional information.

summary.qvalLCS

prints all the additional information.

plot.qvalLCS

shows a picture visualizing a LCS.

References

Agrawal R., K. Lin., H. Sawhney and K. Shim (1995). Fast similarity search in the presence of noise, scaling, and translation in time-series databases. In VLDB '95: Proceedings of the 21. International Conference on Very Large Data Bases, pp. 490-501. Morgan Kaufmann Publishers Inc. ISBN 1-55860-379-4.

Cuberos F., J. Ortega, R. Gasca, M. Toro and J. Torres (2002). Qualitative comparison of temporal series - QSI. Topics in Artificial Intelligence. Lecture Notes in Artificial Intelligence, 2504, 75-87.

Jachner, S., K.G. v.d. Boogaart, T. Petzoldt (2007) Statistical methods for the qualitative assessment of dynamic models with time delay (R package qualV), Journal of Statistical Software, 22(8), 1--30. tools:::Rd_expr_doi("http://dx.doi.org/10.18637/jss.v022.i08").

See Also

LCS, features

Examples

Run this code
# a constructed example
x <- seq(0, 2*pi, 0.1)
y <- 5 + sin(x)           # a process
o <- y + rnorm(x, sd=0.2) # observation with random error
p <- y + 0.1              # simulation with systematic bias

qvalLCS(o, p)
qvalLCS(o, p, smooth="both", feature="f.curve")

qv <- qvalLCS(o, p, smooth = "obs")
print(qv)
plot(qv, ylim=c(3, 8))

# observed and measured data with non-matching time steps
data(phyto)
qvlcs <- qvalLCS(obs$y, sim$y, obs$t, sim$t, smooth = "obs")

basedate <- as.Date("1960/1/1")
qvlcs$o$x   <- qvlcs$o$x + basedate
qvlcs$obs$x <- qvlcs$obs$x + basedate
qvlcs$sim$x <- qvlcs$sim$x + basedate
qvlcs$obs.lcs$x <- qvlcs$obs.lcs$x + basedate
qvlcs$sim.lcs$x <- qvlcs$sim.lcs$x + basedate

plot.qvalLCS(qvlcs)
summary(qvlcs)

Run the code above in your browser using DataLab