|
From: | Frans Houweling |
Subject: | PSPP-BUG: SVD matrix function |
Date: | Sun, 19 Jun 2022 19:18:59 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 |
Hi,
not sure this is a bug.
I was studying the matrix facility and trying to simulate a correspondence analysis. The coordinates on the second dimension had the wrong sign. I narrowed it down to a difference in the output of SVD.
Actual output: SET PRINTBACK = ON.
SHOW SYSTEM.
Version | GNU pspp 1.6.0 |
---|---|
Host System | x86_64-pc-linux-gnu |
Build System | x86_64-pc-linux-gnu |
Locale Directory | /usr/local/share/locale |
Compiler Version | 11.3.0 |
MATRIX. COMPUTE Z = {.0864567551, .0285087603, -.0869963370; .0383529410, .1082579438, -.1353350560; .0441034059, -.0658036806, .0369188203; -.0850336980, -.0154156630, .0727911485; -.0454583792, -.0647514858, .0960927767}.
PRINT Z /FORMAT = F10.7.
Z
.0864568 .0285088 -.0869963
.0383529 .1082579 -.1353351
.0441034 -.0658037 .0369188
-.0850337 -.0154157 .0727911
-.0454584 -.0647515 .0960928
CALL SVD(Z, U, sigma, V).
PRINT sigma /FORMAT = F10.7.
sigma
.2652708 .0000000 .0000000
.0000000 .1135421 .0000000
.0000000 .0000000 .0000000
PRINT U /FORMAT = F10.7.
U
-.4386666 .4237559 .6866002
-.6516462 -.3550114 -.4516196
.1603076 .6724694 -.3645709
.3711005 -.4884741 .4002276
.4685240 .0597979 -.1775551
PRINT V /FORMAT = F10.7.
V
-.4097795 .8058464 -.4274252
-.4887795 -.5896041 -.6430098
.7701788 .0545755 -.6354889
END MATRIX. Expected output (R: svd(Z) v. https://www.displayr.com/math-correspondence-analysis/ ):$d [1] 2.652708e-01 1.135421e-01 2.718254e-17 $u [,1] [,2] [,3] Some primary -0.4386666 -0.42375592 -0.3714480 Primary completed -0.6516462 0.35501142 -0.4906752 Some secondary 0.1603076 -0.67246939 -0.2423522 Secondary completed 0.3711005 0.48847409 -0.3785281 Some tertiary 0.4685240 -0.05979793 -0.6474922 $v [,1] [,2] [,3] Glance -0.4097795 -0.80584644 -0.4274252 Fairly thorough -0.4887795 0.58960413 -0.6430097 Very thorough 0.7701788 -0.05457549 -0.6354889
[Prev in Thread] | Current Thread | [Next in Thread] |