-
Notifications
You must be signed in to change notification settings - Fork 19
/
demo_us_temperature.m
33 lines (26 loc) · 1.14 KB
/
demo_us_temperature.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
33
clear all
close all
% load us temperature data
load('us_temp_data.mat');
% sample covariance
S = cov(data_2d_state,1);
% initializaions
filter_type = 'exp';
beta = 0.5; % filter parameter
graph_filter_ideal = @(x)(graph_filter_fwd(x,beta,filter_type) );
[U,sigma_sq_C] = createBasis(S,'descend');
max_sigma=(max(sigma_sq_C));
sigma_orig = sigma_sq_C/max_sigma;
% step I: prefilter
sigma_sq_C = sigma_sq_C/max_sigma; sigma_sq_C(sigma_sq_C <= 10^-10) = 0;
lambdas_current = graph_filter_inv(sigma_sq_C,beta,filter_type);
orig_sigmas = 1./lambdas_current; orig_sigmas(orig_sigmas==Inf)=0;
S_prefiltered = U * diag(orig_sigmas) * U';
% step II: graph learning
Laplacian = estimate_cgl(S_prefiltered,ones(size(S_prefiltered)),0.000,10^-5,10^-7,40);
% step III: filter parameter estimation (for a desired filter type a filter parameter selection step)
% Note: for exponential filter filter parameter selection step can be skipped,
% becayse the output graphs are scaled versions of eachother for different beta parameter
% please refer to the paper for further details
% show resulting graph on the US map
draw_us_temp_graph(Laplacian, center_vector);