Skip to content

Weighted pca returns erroneous Hotelling's T-squared statistics #279

@pr0m1th3as

Description

@pr0m1th3as

When using weighted observations, pca returns different Hotelling'sT-squared statistics compared to MATLAB.
In Octave we get

x=[1,2,3;2,1,3]';
>> [COEFF, SCORE, latent, tsquare] = pca (x, "Economy", false, "weights", [1 2 1], "variableweights", "variance")
COEFF =

   0.6325  -0.6325
   0.7416   0.7416

SCORE =

  -0.622019   0.959119
  -0.505650  -0.505650
   1.633319   0.052180

latent =

   1.7830
   0.7170

tsquare =

   1.3333
   0.6667
   1.3333

In MATLAB

tsquare =

   1.5000
   0.5000
   1.5000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions