Clear Filters
Clear Filters

ways to calculate non-linear correlation between two time series in MATLAB?

39 views (last 30 days)
Hi all
I need MATLAB functions or codes for calculating the non-linear relation of two time series and I have the statistics toolbox (R2022b)
I appreciate your help!.

Answers (1)

Star Strider
Star Strider on 8 Aug 2024 at 11:24
Your question is ambiguous.
First, be certain that both time series are sampled at the same time points. You can use interp1 for this, although the Signal Processing Toolbox resample function is more appropriate, especially if you want to do signal processing on your data. Creating them to have the same sampling frequency as well as sharing the same time points will also make any subsequent analysis easier.
Second, choose an approach.
One option could be to use the System Identification Toolbox to create an input-output relation between the two time series. You could then calculate a transfer function between tthem. (The Signal Processing Toolbox has similar capabilities.)
Another approach could simply be to divide one by the other in the time domain.
Still another would be to use the polyfit function to create a polynomial fit between the dependent variables of the two time series. A version of that approach would create a mathematical model of the relationship and then do a non-linear fit to it using the fitnlm function.
It all depends on the result you want. Defining that (and providing the data for both time series) would be helpful.
.

Community Treasure Hunt

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

Start Hunting!