changing the reference sequence in DTW

Hello everyone, I wanted to use Dynamic Time Warping to align one sequence with respect to the reference one (the time series are stretched or compressed). But, when using the command “dtw” in MATLAB, after finding the optimal path, both time series are stretched. Let me give you an example: the reference is x1 = [1 1 1 2 2 4 4 2 1 1 ], with 10 points (length=10), and the other sequence is x2 = [1 2 2 3 3 2 2 1 1], with 9 points. In addition, the warping path has 11 points, therefore, when MATLAB plot the aligning data show me two plots (in one figure) with 11 points.

But, I don’t want my reference signal to stretch. I would really appreciate it if you help me to align x2 with respect to the reference signal without changing the reference signal. It is worth to note that as the procedure of DTW shows, the boundaries of warping path is “max(length(x1) and length(x2))

1 Comments
 
Most Helpful

Autem inventore officia est suscipit dicta dolorem repudiandae. Consectetur qui omnis sint id sint omnis iusto. Et consectetur et quia quia quae. Omnis eaque incidunt distinctio quis. Exercitationem illum est dolorum quisquam ducimus deserunt necessitatibus.

Vitae commodi sequi et molestiae omnis. Ut quibusdam non dignissimos commodi deserunt nam sunt. Cupiditate sint quia nesciunt harum rerum perspiciatis eos et. Similique qui labore aut nesciunt. Soluta fuga nesciunt delectus.

Ut rem perspiciatis voluptatibus. Veritatis perspiciatis eaque deserunt. Sunt deleniti aperiam nisi eligendi. Omnis voluptatem labore officiis omnis voluptatem est voluptatum.

Labore sit et dolore officiis. Voluptatum sint quos sint eligendi eligendi.

Career Advancement Opportunities

August 2026 Hedge Fund

  • Point72 99.0%
  • D.E. Shaw 98.0%
  • Citadel Investment Group 97.0%
  • AQR Capital Management 96.0%
  • Magnetar Capital 95.0%

Overall Employee Satisfaction

August 2026 Hedge Fund

  • Magnetar Capital 99.0%
  • D.E. Shaw 98.0%
  • Blackstone Group 97.0%
  • Citadel Investment Group 96.0%
  • Two Sigma Investments 94.9%

Professional Growth Opportunities

August 2026 Hedge Fund

  • AQR Capital Management 99.0%
  • Point72 98.0%
  • D.E. Shaw 97.1%
  • Citadel Investment Group 96.1%
  • Magnetar Capital 95.1%

Total Avg Compensation

August 2026 Hedge Fund

  • Portfolio Manager (9) $1,648
  • Vice President (27) $464
  • Director/MD (11) $372
  • NA (9) $320
  • Engineer/Quant (83) $287
  • 3rd+ Year Associate (26) $284
  • Manager (4) $282
  • 2nd Year Associate (32) $253
  • 1st Year Associate (76) $193
  • Analysts (233) $178
  • Intern/Summer Associate (29) $145
  • Junior Trader (5) $102
  • Intern/Summer Analyst (276) $95
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Secyh62's picture
Secyh62
99.0
3
kanon's picture
kanon
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
DrApeman's picture
DrApeman
98.9
6
CompBanker's picture
CompBanker
98.9
7
dosk17's picture
dosk17
98.9
8
GameTheory's picture
GameTheory
98.9
9
Betsy Massar's picture
Betsy Massar
98.9
10
Mimbs's picture
Mimbs
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”