blockCorr
Calculates the correlation of a signal for a fixed time delay
Extends from Modelica.Blocks.Interfaces.BlockIcon.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.Time | delta_t | 1 | Time delay for auto-correlation of signal |
| Real | t_0 | Start time of the simulation |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | u | Input for the noise signal | |
| Modelica.Blocks.Interfaces.RealInput | u1 | Input for the noise signal | |
| Real | t | max(0, time - delta_t - t_0) | The local integration time (starts only after an offset of delta_t |
| Real | x | u | The first random variable to calculate the correlation coeffcient |
| Real | y | delay(u, delta_t, delta_t) | The second random variable to calculate the correlation coeffcient |
| Real | int_x | The integral of x | |
| Real | int_y | The integral of y | |
| Real | int_x2 | The integral of x^2 | |
| Real | int_y2 | The integral of y^2 | |
| Real | int_xy | The integral of x*y | |
| Real | mean_x | if t <= 0 then x else int_x/t | The mean value of x |
| Real | mean_y | if t <= 0 then y else int_y/t | The mean value of y |
| Real | var_x | if t <= 0 then 0 else (int_x2 - 2*mean_x*int_x + mean_x^2*t)/t | The variance of x |
| Real | var_y | if t <= 0 then 0 else (int_y2 - 2*mean_y*int_y + mean_y^2*t)/t | The variance of y |
| Real | cov_xy | if t <= 0 then 0 else (int_xy - mean_x*int_y - mean_y*int_x + mean_x*mean_y*t)/t | The co-variance of x and y |
| Real | r | if var_x > 0.1 and var_y > 0.1 then cov_xy/sqrt(var_x)/sqrt(var_y) else 0 | The Bravais- or Pearson-Correlation-Coefficient r = cov_xy / std_x / std_y |
| Real | f | if r >= 0.9 then 9 else 0.5*log((1 + r)/(1 - r)) | The Fisher transformed correlation coefficient |
| Real | z | if t <= 0 then 0 else f*sqrt(t) | The z-score of the Fisher transformed correlation coefficient |
| Real | P | Modelica.Math.Vectors.interpolate(Z, F, z) | The probability for the actual correlation r_true <= r assuming f to be normally distributed |
| Real | p | 1 - 2*abs(P - 0.5) | Probability to find the current correlation coefficient r, assuming the two signals to be uncorrelated. If p < 0.05, we have strong evidence for the signals being correlated |
Revisions
Developed 2014 at the DLR Institute of System Dynamics and Control