correl

Returns the correlation coefficient of the given curve vectors.

Syntax

correl(vec_1, vec_2)

Argument

vec_1
The first vector.
vec_2
The second vector.

Example

Templex Expression Result
{correl({0,1},{1,0})} -1
{correl(p1w1c1.y,p1w1c2.y)} 0.4591

Comments

The correlation coefficient is calculated according to the following equation:

(1)
Correl(X,Y)= (x x ¯ )(y y ¯ ) (x x ¯ ) 2 (y y ¯ ) 2 MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2Caerbd9MBZ9 gBHnharuavP1wzZbItLDhis9wBH5garmWu51MyVXgaruWqVvNCPvMC G4uz3bqee0evGueE0jxyaibaieYdf9irVeeu0dXdh9vqqj=hEeeu0x Xdbba9frFj0=OqFfea0dXdd9vqaq=JfrVkFHe9pgea0dXdar=Jb9hs 0dXdbPYxe9vr0=vr0=vqpWqabiaaciWacmaadaGaaiaaeeGabuaaaO qaaiaadoeacaWGVbGaamOCaiaadkhacaWGLbGaamiBaiaacIcacaWG ybGaaiilaiaadMfacaGGPaGaeyypa0ZaaSaaaeaadaaeabqaaiaacI cacaWG4bGaeyOeI0Yaa0aaaeaacaWG4baaaiaacMcacaGGOaGaamyE aiabgkHiTmaanaaabaGaamyEaaaacaGGPaaaleqabeqdcqGHris5aa GcbaWaaOaaaeaadaaeabqaaiaacIcacaWG4bGaeyOeI0Yaa0aaaeaa caWG4baaaiaacMcadaahaaWcbeqaaiaaikdaaaaabeqab0GaeyyeIu oaaSqabaGcdaaeabqaaiaacIcacaWG5bGaeyOeI0Yaa0aaaeaacaWG 5baaaiaacMcadaahaaWcbeqaaiaaikdaaaaabeqab0GaeyyeIuoaaa aaaa@5D08@

If the given vectors have a different number of data points, an error is returned.

If either vector is empty, or if the standard deviation of their values is equal to 0, an error is returned.