% eda09_02
% load the neuse.txt data set
% make scatter plots of lagged samples
% in order to investigate correlation

D=load('neuse.txt');
t=D(:,1);
d=D(:,2);
N=length(d);

figure(1);
clf;

lag=1;
subplot(1,3,1);
set(gca,'LineWidth',2);
hold on;
axis( [0 25000 0 25000] );
plot( d(1:N-lag), d(1+lag:N), 'ko', 'LineWidth', 2 );
xlabel('discharge');
ylabel(sprintf('discharge lagged by %d days', lag));

subplot(1,3,2);
lag=3;
set(gca,'LineWidth',2);
hold on;
axis( [0 25000 0 25000] );
plot( d(1:N-lag), d(1+lag:N), 'ko', 'LineWidth', 2 );
xlabel('discharge');
ylabel(sprintf('discharge lagged by %d days', lag));

subplot(1,3,3);
lag=30;
set(gca,'LineWidth',2);
hold on;
axis( [0 25000 0 25000] );
plot( d(1:N-lag), d(1+lag:N), 'ko', 'LineWidth', 2 );
xlabel('discharge');
ylabel(sprintf('discharge lagged by %d days', lag));
