-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIDVMtest.m
32 lines (23 loc) · 882 Bytes
/
IDVMtest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%CSC522 Project spatial interpolation test
%using RMSE to evaluate the performance
%index of date when the data matrix in longitude*latitude has no missing
%data
dates_full_data = spatialInterpolationDataSelection(data, no_detect, miss_val);
distance_matrix = d_distance(data,no_detect,lat,lon,10);
SSE = zeros(length(lon), length(lat), length(dates_full_data));
for i=1:length(dates_full_data)
date = dates_full_data(i);
[lo, la, dts] = size(data);
for m=1:lo
for n=1:la
if (~no_detect(m, n))
fill = IDVM(data, no_detect, miss_val, distance_matrix, n, m, date, 2, 4);
SSE(m, n, i) = (fill-data(m, n, date))^2;
end
end
end
end
SSE = sum(SSE, 3);
MSE = SSE./(length(dates_full_data));
RMSE = sqrt(MSE);
mean_RMSE = meanRMSE(RMSE, no_detect);