-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnoseIssue.m
More file actions
25 lines (20 loc) · 907 Bytes
/
diagnoseIssue.m
File metadata and controls
25 lines (20 loc) · 907 Bytes
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
function diagnoseIssue(obs, go, cov, KS)
fprintf('\n=== COMPREHENSIVE DIAGNOSTIC ===\n');
% Data
fprintf('1. OBS DATA:\n');
fprintf(' Range: [%.2f, %.2f] ppb\n', min(obs.Y(:)), max(obs.Y(:)));
% Global offset
fprintf('2. GLOBAL OFFSET:\n');
testGO = stmeaninterp(go.sMS, go.tME, go.ms, go.mt, obs.sMS(1,:), obs.tME(1));
fprintf(' Sample GO: %.2f ppb\n', testGO);
% Covariance
fprintf('3. COVARIANCE:\n');
fprintf(' Variance: %.2f, STmetric: %.2f\n', cov.var, cov.stmetric);
% Residuals
fprintf('4. RESIDUALS:\n');
fprintf(' Range: [%.2f, %.2f]\n', min(KS.harddata.z), max(KS.harddata.z));
% Check for issues
if abs(testGO) > 1000, warning('GO values too large!'); end
if cov.stmetric > 1000, warning('STmetric too large!'); end
if max(abs(KS.harddata.z)) > 100, warning('Residuals too large!'); end
end