data_driven_time_warp - (dtw) is the dynamic curvature of the timeline. An ordinary vector is fed into the function, the output function already gives two x and y coordinates - time (synthetic) and values (vector).
data_driven_time_warp <- function (y) { cbind( x = cumsum(c(0, abs(diff(y)))),y = y) } y <- cumsum(rnorm(200))+1000 # some data i <- seq(1,length(y),by=10) op <- par(mfrow=c(2,1), mar=c(.1,.1,.1,.1)) plot(y, type="l", axes = FALSE) abline(v=i, col="grey") lines(y, lwd=3) box() d <- data_driven_time_warp(y) plot(d, type="l", axes=FALSE) abline(v=d[i,1], col="grey") lines(d, lwd=3) box() par(op) give the usual vector to the function
> head(y) [1] 999.9084 999.1956 999.8033 999.2182 998.6474 997.0736 output matrix
> head(d) xy [1,] 0.0000000 999.9084 [2,] 0.7128334 999.1956 [3,] 1.3205700 999.8033 [4,] 1.9056173 999.2182 [5,] 2.4764494 998.6474 [6,] 4.0502315 997.0736 in the picture above the row before the conversion, below after 
The question is how can I convert this matrix "d" into an ordinary vector, but what would it be the same as in the picture below?
yin the matrixd- this is the originaly. That is, he is already "the same." In the picture above, there is a graph from one variable, respectively, all points have an equal distance between them on the x-axis. In the second picture, the graph is plotted in two coordinates. - Ogurtsovy. Thedata_driven_time_warpfunctiondata_driven_time_warpn’t do anything with the source vectory, but creates another vectorx. Further, the dependence ofyonxis drawn. That is, it cannot be said that the second picture "depicts a vector" - it shows the dependence of one variable on another. - Ogurtsovd$yond$x- any splines or loess. Then predictyat points 1, 2. 3 ... tolength(x). So get some approximation of the desired image. - Ogurtsov