3
$\begingroup$

The documentation would suggest that the "StandardizedVector" option of FeatureExtract and FeatureExtraction should give the same results as Standardize ("numeric data processed with Standardize"), but they are not numerically identical:

example = RandomReal[{100, 125}, 1000];
example[[1 ;; 5]]
(* {110.711, 107.838, 119.151, 110.001, 107.939} *)


(*compare the effects of the two approaches*)
Take[#, 5]& @ Standardize[example]
(* {-0.246331, -0.64833, 0.934736, -0.345705, -0.634303} *)

Take[#, 5]& @ Flatten @ FeatureExtract[example, "StandardizedVector"]
(* {-0.246454, -0.648655, 0.935204, -0.345878, -0.634621} *)

What's going on here?

$\endgroup$

1 Answer 1

5
$\begingroup$

The two methods differ in how they interpret the variance. Namely, Standardize uses the sample variance (where you divide by $n-1$), and FeatureExtract uses the population variance (where you divide by $n$).

Let me convince you with a simpler example:

list = {-1., 0., 1.};

list1 = Standardize[list]
(* {-1., 0., 1.} *) 
list2 = Flatten@FeatureExtract[list, "StandardizedVector"]
(* {-1.22474, 0., 1.22474} *)

StandardDeviation[list1]
(* 1. *)
StandardDeviation[list2]
(* 1.22474 *)

popStandardDeviation[list_] := Sqrt[Total[(list - Mean[list])^2]/Length[list]]
popStandardDeviation[list1]
(* 0.816497 *)
popStandardDeviation[list2]
(* 1. *)

You see, FeatureExtract did standardize the list, but in such a way that the population variance is 1. I certainly agree with you that the description in documentation for FeatureExtract is misleading. Consider reporting it to the WRI.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.