Skip to content

Commit 95a09bc

Browse files
author
Ze Jiang
committed
WASP matlab v1.0
1 parent 10a47fd commit 95a09bc

File tree

5 files changed

+3
-27
lines changed

5 files changed

+3
-27
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
21
*.asv
3-
SMC.m
4-
WASP_matlab.zip

RMSE.fig

-8 Bytes
Binary file not shown.

WaSP.m

+3-24
Original file line numberDiff line numberDiff line change
@@ -52,46 +52,25 @@
5252
disp('This type of wavelet transform does not apply!')
5353
end
5454

55-
% disp(['Additive:' num2str(sum(abs(sum(X_WT,2)-X_tmp)))])
56-
% disp(['Variance:' num2str(sum(var(X_WT))-var(X_tmp))])
57-
5855
%standardization w.r.t. observed period
5956
X_WT_n = X_WT(1:N,:);
60-
%X_WT_norm=(X_WT-mean(X_WT_n))./std(X_WT_n);
6157

6258
% alternative way to standardize data for older matlab versions
63-
%subtract mean of each column
59+
% subtract mean of each column
6460
X_WT_c=X_WT-repmat(mean(X_WT_n),num_obs,1);
65-
%divide by the standard deviation of each column
61+
% divide by the standard deviation of each column
6662
X_WT_norm=X_WT_c./repmat(std(X_WT_n,0,1),num_obs,1);
67-
% disp(sum(abs(X_WT_norm1-X_WT_norm)))
68-
69-
% disp(var(X_WT_norm(1:N,:)))
70-
% disp(mean(X_WT_norm(1:N,:)))
71-
% disp(sum(abs(normalize(X_WT_n)-X_WT_norm(1:N,:))))
72-
73-
%corr1 = corrcoef([Y X_WT(1:length(Y),:)]) ; %correct
74-
%corr1 = cov([Y X_WT(1:length(Y),:)]) ; %wrong
75-
%C(:,i_var) = corr1(1,2:lev+2);
7663

64+
7765
% covariance - Eq. 10 in WRR2020 paper
78-
%corr = 1/(N-1)*Y'*X_WT_norm(1:N,:);
79-
80-
%corr = 1/(length(Y)-1)*Y'*normalize(X_WT(1:length(Y),:));
81-
%disp(normalize(corr1(1,2:lev+2),'norm') - normalize(corr,'norm'))
8266
C(:,i_var) = 1/(N-1)*Y'*X_WT_norm(1:N,:);
8367

8468
% normalization to get unit norm
85-
%C_norm = normalize(C(:,i_var),'norm') ;
8669
C_norm = C(:,i_var)./sqrt(sum(C(:,i_var).^2)) ;
87-
% disp(norm(C_norm))
88-
% disp(norm(C(:,i_var))-sqrt(sum(C(:,i_var).^2)))
8970

9071
% variance transformation - Eq. 9 in WRR2020 paper
91-
%X_WaSP(:,i_var) = normalize(X_WT)*(std(X(:,i_var)).*C_norm(:)) ;
9272
X_WaSP(:,i_var) = X_WT_norm*(std(X(1:N,i_var)).*C_norm) ;
9373

94-
X_WT_norm'*X_WT_norm
9574
% maintain the original trend of the variable
9675
if flag_sign
9776
[rho, pval] = corr(X_WaSP(:,i_var),X_tmp);

comparision.fig

-75 Bytes
Binary file not shown.

comparision_val.fig

-8 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)