how to conclude the results of cross correlation function ; xcorr()?

2 views (last 30 days)
Hi,
i have two data sets of hourly water level values : Observed data set in the form of univariate time series. (1961-2016)
Simulated time series data set in nc files. (1971-2098)
i have successfully extracted the two time series in Timetables. now i have two time tables, each having the said time series data. here is the data plot
obs-simulated-dataplot.jpg
i needed to check how well the simulated data represents the observed data. so that i could predict the future water level rise from simulated data.
for this i used xcorr() usind the two data sets. the code i tried is as below:
load SimDATA_Rangedwaterlevels;
load ObsDATA_Rangedwaterlevels;
[acor,lag] = xcorr(SimDATA_Rangedwaterlevels{:,1},ObsDATA_Rangedwaterlevels{:,1});
[~,I] = max(abs(acor));
lagDiff = lag(I); %lagDiff = 43945
figure
stem(lag,acor,'filled');
xlabel('lags');
ylabel('Correlation Measures');
legend(sprintf('Maximum at lag %d',lag(I)))
the lag comes out 43945,if i reverse the xcorr() inputs then lag = -43945. it means observed data is an advanced version of simulated data , and simulated data is a delayed version of observed data. thats what i understand from the matlab help articles of xcorr().
my question is " How to conclude from these finidngs of xcorr()? with that high lag value, how can i interpret the future prediction from water level values of simulated data?
or am i interpretting some thing wrong? please guide me soon, i am stuck in it since many days.
Also, related to the lagged time series, i was following the example under "delay between two correlated signals"; https://www.mathworks.com/help/signal/ref/xcorr.html#bugnq6o-1
they have used sampling frequency , and time difference,
how to calculate sampling frequency and ultimately time difference in my data set?
would it be helpful if i go for it?
looking forward anxiously for any guidance....
BNA

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!