qvalLCS                package:qualV                R Documentation

_Q_u_a_l_i_t_a_t_i_v_e _V_a_l_i_d_a_t_i_o_n _b_y _M_e_a_n_s _o_f _I_n_t_e_r_v_a_l _S_e_q_u_e_n_c_e_s _a_n_d _L_C_S

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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 class 'qvalLCS':
     print(x, ...)
     ## S3 method for class '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 class 'qvalLCS':
     summary(object, ...)

_A_r_g_u_m_e_n_t_s:

       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'

_D_e_t_a_i_l_s:

     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).

_p_r_i_n_t._q_v_a_l_L_C_S prints only the requested value, without additional
     information.

_s_u_m_m_a_r_y._q_v_a_l_L_C_S prints all the additional information.

_p_l_o_t._q_v_a_l_L_C_S shows a picture visualizing a 'LCS'.

_V_a_l_u_e:

     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

_R_e_f_e_r_e_n_c_e_s:

     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), in preparation

_S_e_e _A_l_s_o:

     'LCS', 'features'

_E_x_a_m_p_l_e_s:

     # 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)

