Correlate time-series
64 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sarah Yun
el 17 de Dic. de 2019
Comentada: Adam Danz
el 28 de Dic. de 2019
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.
0 comentarios
Respuesta aceptada
Adam Danz
el 17 de Dic. de 2019
Editada: Adam Danz
el 18 de Dic. de 2019
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 comentarios
Adam Danz
el 28 de Dic. de 2019
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Time Series en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!