Skip to content

matrix inversion using solve() and matrices containing large/small values

3 messages · gerardus vanneste, Duncan Murdoch, Douglas Bates

#
On 3/5/2008 8:21 AM, gerardus vanneste wrote:
If the matrix actually isn't singular, then a rescaling of the 
parameters should help a lot.  I see the diagonal of infomatrix as

 > diag(infomatrix)
[1] 5.930720e-03 3.872339e+02 4.562529e+07 6.281634e+12 9.228140e+17
[6] 1.398687e+23 2.154124e+28 3.345598e+33

so multiplying the parameters by numbers on the order of the square 
roots of these entries (e.g. 10^c(-1, 1, 4, 6, 9, 12, 14, 17)), and 
redoing the rest of the calculations on that scale, should work.

Duncan Murdoch
#
On Wed, Mar 5, 2008 at 7:43 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
Someone with experience in numerical linear algebra will immediately
focus on the words "inversion of a matrix" in that statement.

There is a sort of a meta-result in numerical linear algebra that if
the best way you can formulate an answer to your problem involves
inversion of a matrix (without specifying a special structure like
diagonal or bidiagonal or unit triangular or ...) then you need to
think about your problem in more detail.

Certainly a formula may be written out in terms of the inverse of an
information matrix but it is a bad idea to try to calculate the result
that way.  If you have an information matrix is it positive definite?
If so, you should be working with the Cholesky decomposition of the
matrix or perhaps the QR decomposition of a model matrix that
generates the information matrix.

Think in terms of the factors of a matrix and how you can reexpress
the calculation using them.