Documentation of pdo_statistics


Global Index (short | long) | Local contents | Local Index (short | long)


Help text

  subplot(2,2,2*i-1);

Cross-Reference Information

This script calls

Listing of script pdo_statistics


clear
cd ~/matlab/CSIRO/Thesis/Data
load PDO_HP10_detrend_L1_EOF_yr101-1000.mat; lpcs = pcs; lper = per;
load PDO_LP9_detrend_L1_EOF_yr101-1000.mat; hpcs = pcs; hper = per;
load PDO_detrend_L1_EOF_yr101-1000.mat; rpcs = pcs; rper = per;
load slp_eof_npac.mat
load z250_eof_npac.mat
ct = getct;
lims = [-0.1 360 -90 90]; 
tim = 101:1000;
sst = getnc('temp', lims, 1, tim);
sst = detrend(sst);
slp = getflx('psl', lims, tim);
slp = detrend(slp);
z250 = getnc('z250', lims, 1, tim);
z250 = detrend(z250);
taux = getnc('taux', lims, 1, tim);
taux = detrend(taux);
[lat, lon, depth, lm] = getll('temp', lims);
default_global; FRAME = [105 300 -60 60];
for figind = 1:3;
if figind == 1; timvar = rpcs; tit = 'RPC'; hello(tit);
  elseif figind == 2; timvar = hpcs; tit = 'HPC'; hello(tit);
  elseif figind == 3; timvar = lpcs; tit = 'LPC'; hello(tit);
  end
for i = 1:2;
  reg1(i,:,:) = regress_eof(sst, timvar(:,i), 0);
end
for i = 1:2;
  reg2(i,:,:) = regress_eof(slp, timvar(:,i), 0);
end
for i = 1:2;
  reg3(i,:,:) = regress_eof(taux, timvar(:,i), 0);
end
figure(figind); fo(1); clf
j = 1;
for i = 1:2;
  pos = [.2+.38*(i-1) (9.8/11)-(j)*7/(3*11) ...
         .3 .18]; 
  subplot('position', pos);
  gcont(reg1(i,:,:), 0.05);
  dc2(lm); 
  title([tit num2str(i) ' of NP Z250']);
end

j = 2;
for i = 1:2;
  pos = [.2+.38*(i-1) (9.8/11)-(j)*7/(3*11) ...
         .3 .18]; 
  subplot('position', pos);
  gcont(reg2(i,:,:), 0.2);
  dc2(lm, .35, -1); 
end

j = 3;
for i = 1:2;
  pos = [.2+.38*(i-1) (9.8/11)-(j)*7/(3*11) ...
         .3 .18]; 
  subplot('position', pos);
  gcont(reg3(i,:,:), .01);
  dc2(lm, .35, -1); 
end

end;  % figind loop

cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Chap5/Plots
figure(1);
print -dps2 Regressions_on_NPZ250_RPC1_RPC2.ps
figure(2)
print -dps2 Regressions_on_NPZ250_HPC1_HPC2.ps
figure(3)
print -dps2 Regressions_on_NPZ250_LPC1_LPC2.ps

%%%%%%%%%%%%%%%%%%
%
%  From this analysis (above) the following relationships appear:
%
%  Raw:
%
%  PC1SST = -PC1SLP ~= -PC1Z250
%  PC2SST =  PC2SLP = PC2Z250
%
%  HP:
%
%  PC1SST = -PC1SLP = -PC1Z250
%  PC2SST =  PC2SLP =  PC2Z250
%
%  LP:
%
%  PC1SST ~= PC2SLP = \ some sort of combination  ?= 
%  PC2SST ~= PC1SLP = / of these two PC's of Z250





[b, a] = butter(9, 2/9);
lpct = filtfilt(b, a, detrend(ct));

clear tem;
tem(1,:,:) = regress_eof(sst, lpct, 0);
for i = 1:3;
  tem(i+1,:,:) = regress_eof(sst, lpcs(:,i), 0);
end

cint = 0.5
FRAME = [0 360 -90 90];
figure(1); fo(1);
for i = 1:2;
  subplot(2,1,i);
    gcont(tem(i,:,:), cint);
    dc2(lm, .5, -1);
end
figure(2); fo(2);
for i = 1:2;
  subplot(2,1,i);
    gcont(tem(i+2,:,:), cint);
    dc2(lm, .5, -1);
end


%  Look at statistics

clear

cd ~/matlab/CSIRO/Thesis/Data
load PDO_HP10_detrend_L1_EOF_yr101-1000.mat; lpcs = pcs; lper = per;
load PDO_LP9_detrend_L1_EOF_yr101-1000.mat; hpcs = pcs; hper = per;
load PDO_detrend_L1_EOF_yr101-1000.mat; rpcs = pcs; rper = per;

load slp_eof_npac.mat
load z250_eof_npac.mat

ct = getct;
ct = detrend(ct);
[b, a] = butter(9, 2/9);
lpct = filtfilt(b, a, ct);
[b, a] = butter(9, 2/10);
hpct = ct - filtfilt(b, a, ct);

tind = 1:900;
lags = -10:10;
for i = 1:length(lags);
  rcor1(i) = corr(ct(tind), rpcs(tind,1), lags(i));
  rcor2(i) = corr(ct(tind), rpcs(tind,2), lags(i));
  hcor1(i) = corr(hpct(tind), hpcs(tind,1), lags(i));
  hcor2(i) = corr(hpct(tind), hpcs(tind,2), lags(i));
  lcor1(i) = corr(lpct(tind), lpcs(tind,1), lags(i));
  lcor2(i) = corr(lpct(tind), lpcs(tind,2), lags(i));
end

figure(3); fo(1);
order = ['rcor'; 'hcor'; 'lcor']; 
for j = 1:3;
  for i = 1:2;
    pos = [.2+.38*(i-1) (9.8/11)-(j)*7/(3*11) ...
           .3 .18]; 
    subplot('position', pos);
	       eval(['tem = ' order(j,:) num2str(i) ';']);
	       bar(lags, tem)
     axis([-10 10 -.5 1])
     set(gca, 'XTick', -10:5:10)
     grid on
end
end