dynamic time warp matlab economic data

조회 수: 2 (최근 30일)
Eugene Msizi Buthelezi
Eugene Msizi Buthelezi 2022년 5월 23일
댓글: Eugene Msizi Buthelezi 2022년 5월 23일
I would like to apply the dynamic time warp in economic data of capb i calculated and imf capb. How to code the dynamic time warp in matlab using the two time seriese data.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 5월 23일
Signal processing toolbox, dtw
  댓글 수: 1
Eugene Msizi Buthelezi
Eugene Msizi Buthelezi 2022년 5월 23일
Good Day
I am trying to apply the DTW, i have tWo economic varaibles name, [tvp_elstcy_CAPB and capb_imf1], years1, it a time series fron 1979 to 2020 it not balanced, can am not able to apply DTW code below what is that am doing wrong i have atteched files as well.
% DTW & CDTW example
% Sinusoidal signals temporal alignment
clear all
clc
close all
load matlab.mat
%fs=125;
%f1=1; A1=1;
%f2=5; A2=0.8;
%years1=0:1/fs:1/(2*f1);
%years1=0:1/fs:2/(2*f2);
%n1=(A1/10)*rand(size(years1));
%n2=(A2/8)*rand(size(years1));
%tvp_elstcy_CAPB=A1*sin(2*pi*f1*years1)+n1; % 1st sinusoid with noise addition
%capb_imf1=A2*sin(2*pi*f2*years1)+n2; % 2nd sinusoid with noise addition
figure; hold on;
plot(years1,tvp_elstcy_CAPB,'b');
plot(years1,capb_imf1,'r');
grid;
xlabel('time (s)');
ylabel('amplitude (mV)');
title('Original disaligned waves');
pflag=1;
%%
[dtw_Dist,D,dtw_k,w,tvp_elstcy_CAPBw,capb_imf1w]=dtw(tvp_elstcy_CAPB,capb_imf1,pflag);
dtw_Dist, dtw_k
[cdtw_Dist,D,cdtw_k,w,tvp_elstcy_CAPBw,capb_imf1w]=cdtw(tvp_elstcy_CAPB,capb_imf1,pflag);
cdtw_Dist, cdtw_k

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by