DTWUMI_1gap_imputation {DTWUMI} | R Documentation |
Imputation of a large gap based on DTW for multivariate signals
Description
Fills a gap of size 'gap_size' begining at the position 'begin_gap' within a multivariate signal using DTW.
Usage
DTWUMI_1gap_imputation(data, id_sequence, begin_gap, gap_size,
DTW_method = "DTW", threshold_cos = 0.995, thresh_cos_stop = 0.8,
step_threshold = 2, ...)
Arguments
data |
a multivariate signals containing gaps |
id_sequence |
id of the sequence containing the gap to fill (corresponding to the column number) |
begin_gap |
id of the begining of the gap to fill |
gap_size |
size of the gap to fill |
DTW_method |
DTW method used for imputation ("DTW", "DDTW", "AFBDTW"). By default "DTW" |
threshold_cos |
threshold used to define similar sequences to the query |
thresh_cos_stop |
Define the lowest cosine threshold acceptable to find a similar window to the query |
step_threshold |
step used within the loops determining the threshold and the most similar sequence to the query |
... |
additional arguments from dtw() function |
Value
returns a list containing the following elements:
imputed_values: output vector containing the imputation proposal
id_imputation: a vector containing the position of the imputed values extracted
id_sim_win: a vector containing the position of the similar window to the query
id_gap: a vector containing the position gap considered
id_query: a vector containing the position of the query
Author(s)
DEZECACHE Camille, PHAN Thi Thu Hong, POISSON-CAILLAULT Emilie
Examples
data(dataDTWUMI)
dataDTWUMI_gap <- dataDTWUMI[["incomplete_signal"]]
t <- 207 ; T <- 40
imputation <- DTWUMI_1gap_imputation(dataDTWUMI_gap, id_sequence=1, t, T)
plot(dataDTWUMI_gap[, 1], type = "l", lwd = 2)
lines(y = imputation$imputed_values, x = imputation$id_gap, col = "red")
lines(y = dataDTWUMI_gap[imputation$id_query, 1], x = imputation$id_query, col = "green")
lines(y = dataDTWUMI_gap[imputation$id_sim_win, 1], x = imputation$id_sim_win, col = "blue")
lines(y = dataDTWUMI_gap[imputation$id_imputation, 1], x = imputation$id_imputation, col = "orange")