View source: R/4_7DTWUMI_general.R
| DTWUMI_imputation | R Documentation |
Fills all gaps within a multivariate signal. Gaps of size 1 are filled using the average values of nearest neighbours. Gaps of size >1 and <gap_size_threshold are filled using weighted moving average. Larger gaps are filled using DTW.
DTWUMI_imputation(
data,
gap_size_threshold,
DTW_method = "DTW",
threshold_cos = 0.995,
thresh_cos_stop = 0.8,
step_threshold = 2,
...
)
data |
a multivariate signals containing gaps |
gap_size_threshold |
threshold above which dtw based imputation is computed. Below this threshold, a weighted moving average is calculated |
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 |
A list containing a dataframe of completed signals.
data(dataDTWUMI)
dataDTWUMI_gap <- dataDTWUMI[["incomplete_signal"]]
imputation <- DTWUMI_imputation(dataDTWUMI_gap, gap_size_threshold = 10)
plot(dataDTWUMI_gap[, 1], type = "l", lwd = 2)
lines(imputation$output[, 1], col = "red")
plot(dataDTWUMI_gap[, 2], type = "l", lwd = 2)
lines(imputation$output[, 2], col = "red")
plot(dataDTWUMI_gap[, 3], type = "l", lwd = 2)
lines(imputation$output[, 3], col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.