Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Numerical stability/precision in calculating OLS: moment, vs covariance, vs correlation matrix use in the computation

    Good afternoon,

    When we are computing Ordinary Least Squares (OLS) estimates manually/from scratch, what is the best practice for best numerical stability/ numerical precision?
    Is there any advantage, in terms of numerical stability/numerical precision, if instead of using the moment matrices b = invsym(X'X)X'Y,
    if we use b=invsym(Cov(X,X))Cov(X,Y), or even the corresponding expression that gives the OLS estimator in terms of the correlation matrices Corr(X,X) and Corr(X,Y)?

    In old books on linear analysis, I have seen the advice to do the OLS calculations in terms of covariance or even correlation matrices. (I do not have the book anymore, I think it was Ronald Christensen and a coauthor...) Older books on econometrics were routinely giving the advice to choose the units of measurement of our variables, so that the numbers we get are roughly comparable.

    I wonder whether this advice is now obsolete when the modern computers can calculate in higher precision?

  • #2
    I think the advice is not completely obsolete.
    Stata, even working with mata, uses only double precision. Although some rutines (quadcross()) do use quad precision for calculations.
    That being said. If you have access to the book on mata programming, it has good advice to get the most precise estimates. This book even has a small programming project showcasing the precision of different approaches.
    F

    Comment

    Working...
    X