r-spatial / dtwSat

Time-Weighted Dynamic Time Warping for satellite image time series analysis
https://www.victor-maus.com/dtwSat/
GNU General Public License v3.0
130 stars 39 forks source link

Differences in the measured Distance between TimeSeries and Pattern #51

Closed AndreaMelchiorre closed 3 years ago

AndreaMelchiorre commented 4 years ago

Recently I discovered that the DTWsat 0.2.5 and 0.26 gave me different results and the distance calculated are very different using the same data. I am posting the result obtained with the example data you published on the 2019 paper.

Capture

I am not sure if something got updated (dependencies or other) I tried on both R v 3.6.3 and v 4.0.1

is there a report or paper explaining the differences between versions? which is more reliable?

Thank you

micha-silver commented 3 years ago

Hello:

Have you made any progress on this issue?

I am attempting to classify agriculture crops from satellite imagery, and I find in my alignment plots, very similar to your plot above, that there are several overlapping alignments with low or very near to zero dissimilarity values. These low dissimilarity values occur almost always during time intervals with very low NDVI values (between seasons) from the long term satellite images, where there should be no alignment matches at all. See the example below.

alignment_matches_MishmarHanegev_74

I should add that these low dissimilarity values in between seasons seem to "disappear" when I use a linear weight function instead of the logistic weights function. Maybe I need to further adjust the alpha and beta values...

I'm using:

> version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          0.4                         
year           2021                        
month          02                          
day            15                          
svn rev        80002                       
language       R                           
version.string R version 4.0.4 (2021-02-15)
nickname       Lost Library Book    

> packageVersion("dtwSat")
[1] ‘0.2.6’

Any input on this would be appreciated.

Best regards, Micha

AndreaMelchiorre commented 3 years ago

Hi micha,

I cannot speak for the developers of this but I am using version 0.2.5 as the matches and dissimilarity measures seem more realistic to me.

zilin129 commented 3 years ago

I found the difference is the weighted local cost matrix. In 0.2.5, it is cm = (1-theta)phi + thetaweight.fun(psi). But in 0.2.6, it is cm = phi * weight.fun(psi). Any ideas about this? Which is reasonable?