필터 지우기
필터 지우기

Correlate time-series

조회 수: 42 (최근 30일)
Sarah Yun
Sarah Yun 2019년 12월 17일
댓글: Adam Danz 2019년 12월 28일
Hi,
I have timeseries data that oscillates around 0 (from -2 to +2) for 50 years.
I want to correlate this with temperature data.
The temp data is not normally distributed - so only kendall tau correlation possible.
Problem, the time-series daya is 160 rows, but the temp data only 80.
The rows must be equal size for Matlab to perform the correlaton.
Please help with my code.
Thank you.

채택된 답변

Adam Danz
Adam Danz 2019년 12월 17일
편집: Adam Danz 2019년 12월 18일
You can use vq = interp1(x,v,xq) to interpolate the temp data so that it has 160 values. Then use R = corrcoef(A,B) to compute the correlation coefficient between the two time series. If one time series is shifted relative to the other, you may want to consider the cross correlation to measure the lag: r = xcorr(x,y).
  댓글 수: 2
Sarah Yun
Sarah Yun 2019년 12월 27일
Hello Adam,
I have 4 time series - they show temperature anomolies since around 1950.
They oscilate around 0.
Is it possible to interpolate them so they all have the same number of values and then do a cross correlation for each time-series against a temperature variable?
If so, what should I use for the xq value in the interp1 function?
Thank you.
Adam Danz
Adam Danz 2019년 12월 28일
Check out the documentation for the Xq variable
You could either use a scalar to define the number of points in the interpolated output or you could define a vector of x values that defines the sample points.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by