Std

Rückgabe der Standardabweichung der Werte von Matrix-/Vektorelementen oder von Elementen entlang der angegebenen Achse.

double vector::Std();
 
double matrix::Std();
 
vector matrix::Std(
  const int  axis      // Achse
   );

Parameter

axis

[in]  Achse. 0 — horizontale Achse, 1 — vertikale Achse.

Rückgabewert

Standardabweichung: Skalar oder Vektor.

Hinweis

Die Standardabweichung ist die Quadratwurzel aus dem Durchschnitt der quadrierten Abweichungen vom Mittelwert, d. h., std = sqrt(mean(x)), wobei x = abs(a - a.mean())**2.

Die durchschnittliche quadratische Abweichung wird normalerweise als x.sum() / N berechnet, wobei N = len(x).

Beispiel

   matrixf matrix_a={{10,3,2},{1,8,12},{6,5,4},{7,11,9}};
   Print("matrix_a\n",matrix_a);
 
   vectorf cols_std=matrix_a.Std(0);
   vectorf rows_std=matrix_a.Std(1);
   float matrix_std=matrix_a.Std();
 
   Print("cols_std ",cols_std);
   Print("rows_std ",rows_std);
   Print("std value  ",matrix_std);
 
 
   /*
   matrix_a
   [[10,3,2]
    [1,8,12]
    [6,5,4]
    [7,11,9]]
   cols_std [3.2403703,3.0310888,3.9607449]
   rows_std [3.5590262,4.5460606,0.81649661,1.6329932]
   std value  3.452052593231201
   */