blockCorr

Calculates the correlation of a signal for a fixed time delay

Extends from Modelica.Blocks.Interfaces.BlockIcon.

Parameters

TypeNameDefaultDescription
Modelica.SIunits.Timedelta_t1Time delay for auto-correlation of signal
Realt_0Start time of the simulation

Components

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputuInput for the noise signal
Modelica.Blocks.Interfaces.RealInputu1Input for the noise signal
Realtmax(0, time - delta_t - t_0)The local integration time (starts only after an offset of delta_t
RealxuThe first random variable to calculate the correlation coeffcient
Realydelay(u, delta_t, delta_t)The second random variable to calculate the correlation coeffcient
Realint_xThe integral of x
Realint_yThe integral of y
Realint_x2The integral of x^2
Realint_y2The integral of y^2
Realint_xyThe integral of x*y
Realmean_xif t <= 0 then x else int_x/tThe mean value of x
Realmean_yif t <= 0 then y else int_y/tThe mean value of y
Realvar_xif t <= 0 then 0 else (int_x2 - 2*mean_x*int_x + mean_x^2*t)/tThe variance of x
Realvar_yif t <= 0 then 0 else (int_y2 - 2*mean_y*int_y + mean_y^2*t)/tThe variance of y
Realcov_xyif t <= 0 then 0 else (int_xy - mean_x*int_y - mean_y*int_x + mean_x*mean_y*t)/tThe co-variance of x and y
Realrif var_x > 0.1 and var_y > 0.1 then cov_xy/sqrt(var_x)/sqrt(var_y) else 0The Bravais- or Pearson-Correlation-Coefficient r = cov_xy / std_x / std_y
Realfif r >= 0.9 then 9 else 0.5*log((1 + r)/(1 - r))The Fisher transformed correlation coefficient
Realzif t <= 0 then 0 else f*sqrt(t)The z-score of the Fisher transformed correlation coefficient
RealPModelica.Math.Vectors.interpolate(Z, F, z)The probability for the actual correlation r_true <= r assuming f to be normally distributed
Realp1 - 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