-
Notifications
You must be signed in to change notification settings - Fork 6
/
eofconvergence.m
56 lines (51 loc) · 1.65 KB
/
eofconvergence.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function[ax] = eofconvergence(s)
%% Plots the evolution of the significance threshold for each iteration of Rule N.
%
% [ax] = eofconvergence(s)
% Plots the true confidence threshold and standardized significant
% eignvalue threshold for each iteration of the Monte Carlo Rule N
% significance test. Returns the axes handles for the plots.
%
%
% ----- Inputs -----
%
% s: An output structure from EOF_Analysis
%
%
% ----- Outputs -----
%
% ax: An array with the axes handles for the plots
%
%
% ----- Written By -----
%
% Jonathan King, 2017, University of Arizona ([email protected])
if ~isfield(s, 'MCsigExpVar') || ~isfield(s, 'MCtrue_p') || ~isfield(s, 'MCnSig')
warning('Insufficient data for the eofconvergence plot. Try running a convergence test...');
return;
end
% Plot the true confidence threshold
figure();
plot(s.MCtrue_p)
xlabel('Number of Monte Carlo Iterations');
ylabel('True Significance Level of Significance Threshold.');
title('True Significance Level at Significance Thresholds for Monte Carlo Iterations ')
ax = [gca];
% Plot the significant eigenvalues for each iteration
figure()
plot(zscore(s.MCsigExpVar));
title('Significance Threshold for Standardized Random Explained Variances');
xlabel('Number of Monte Carlo Iterations');
ylabel('Standardized Explained Variance Significance Threshold');
if isfield(s, 'varNames')
legend(s.varNames);
end
ax = [ax; gca];
% Plot the number of significant modes for each iteration
figure()
plot( s.MCnSig);
title('Number of significant leading modes for increasing Monte Carlo iterations');
xlabel('Number of Monte Carlo iterations');
ylabel('Number of significant leading modes');
ax = [ax; gca];
end