Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8896643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:07:33+00:00 2026-06-15T00:07:33+00:00

As indicated in the title, I am wondering if the DTW (Dynamic Time Warping)

  • 0

As indicated in the title, I am wondering if the DTW (Dynamic Time Warping) could be used to calculate the DTW distance between two time series with missing values.

Let’s say the two time series are daily temperatures of two weather stations, and are of equal lengths (e.g. 365 days), and the missing values are on different days for the two time series.

If this is possible, is the dtw package in R able to handle the missing values? I didn’t find a parameter that could be set in dtw() like na.rm = T.

Thanks a lot!

Thanks thelatemail for the suggestion. Below is a simplified example of the two time series, where each time series contain only 52 elements and the missing values are set to NA.

TS1 = c(-3.26433,  -5.09096,    NA, -8.4158,    -5.85485,   -3.49234,   -7.64666,   -4.90124,   NA, -4.68836,   -1.38114,   1.55527,    2.81872,    2.44261,    3.57963,    6.19983,    7.42515,    8.41524,    6.32686,    10.0144,    9.53251,    13.4781,    12.3585,    10.6706,    10.2647,    16.6848,    16.4855,    20.1482,  NA,   21.5734,    20.3946,    20.8824,    18.0325,    18.5813,    17.5453,    16.3315,    14.3068,    11.3164,   9.96398, 5.53102,    9.55094,    9.05897,    6.81199,    5.20343,    1.63158,    -0.661077,  -4.33853,   -6.53655,   NA,   -10.8646, 1.11843,    1.23786)

TS2 = c(-5.76852,  -10.2207,    -11.8465,   NA, -1.70019,   -3.60319,   -5.7718,    -3.81106,   -5.62284,   -3.57516,        0.314511,  0.64058,    0.476162,   NA, 4.23757,    5.15417,    7.29422,    NA, 1.57376,    9.28236,    8.05182,    13.7175,    9.5453, 10.2417,    9.32423,    18.214, 18.3726,    16.661, 20.6563,    22.2901,  22.1109,  19.129, 15.8615,    16.7817,    17.247, 15.9921,    14.5804,    11.3693,    10.9349,    10.1196,  3.7467,   9.09229,    6.91285,    NA, 4.20934,    -0.566403,  -2.94184,   -3.81432,   -10.0212,   -15.9876,    -2.56286,  -1.88976)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:07:35+00:00Added an answer on June 15, 2026 at 12:07 am

    Probably not, I looked over the package manual and there is nothing about the missing or NA values. I also tried to feed your data to dtw() and it fails:

    Error in dtw(TS1, TS2) : 
      No warping paths exists that is allowed by costraints
    

    But when I changed all NA values to 0, it worked easily.

    So if your only solution is this package, you can make a post on the DTW package forum, or probably you have to deal the missing data yourself. You may find some hints here or use the na() function of the fSeries package*.

    *This package is no longer available. It is suggested to use the timeSeries package instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As indicated in title, right now I have captured the event when the session
as indicated by the title I am having trouble sending an email via my
Can someone please explain to me the difference between these two blocks of code.
As the title says, I am wondering what the best practice is regarding the
just as what indicated in the title
I'm currently stuck with BIRT as you might expect. As indicated in the title,
As the title indicates, are there any C/C++ bytecode compilers/interpreters? I'm writing an application
As the title indicates, the root view is my navigation controller, and it is
As the title indicates I'm populating an Infopath textbox control using a SharePoint list
Edit: Appended or LDAP to question title to indicate that I would be fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.