After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691913 - Calculation of leverage
Calculation of leverage
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
git master
Other All
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2013-01-17 03:03 UTC by Morten Welinder
Modified: 2013-01-18 00:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test spreadsheet (133.60 KB, application/x-gnumeric)
2013-01-18 00:21 UTC, Morten Welinder
Details

Description Morten Welinder 2013-01-17 03:03:33 UTC
I think we need a better calculation of leverage in the regression tool.
What we have now throws around large matrices which is wasteful and likely
to do bad things to accuracy.

If I'm not mistaken we need the diagonal of

    H = A (AT A)^-1 AT

With A = QR, we have

    H = A (RT R)^-1 RT QT

so

    H ej = A x

where

    x = (RT R)^-1 (RT QT ej)
aka
    RT (R x) = RT (QT ej)

Right hand side is trivial to compute and both R and RT are triangular, so
the equations are easily solved.  No actual matrix inversions or very large
matrix products are involved.
Comment 1 Morten Welinder 2013-01-17 13:52:01 UTC
08:22 <@gmorten> hmm
08:22 <@gmorten> Are the multiple different definitions of leverage?
08:23 <@gmorten> I can only find one and with that we're supposed to get 
                 numbers that sum to the number of parameters in the model.
08:23 <@gmorten> The numbers we calculate do not sum to a integer.
Comment 2 Morten Welinder 2013-01-18 00:15:20 UTC
Disregeard comment 1.

We now have LEVERAGE which does the computation based on

    x = (RT R)^-1 (A ej)

which is a slight variation of the above.
Comment 3 Morten Welinder 2013-01-18 00:21:32 UTC
Created attachment 233707 [details]
Test spreadsheet

Test sheet.

The new calculation doesn't care about MUNIT's restriction.
Comment 4 Morten Welinder 2013-01-18 00:21:44 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.