Skip to content

LMC manually fitted

2 messages · Nikki roy, Edzer Pebesma

2 days later
#
Nikkie,

you made sure that the Cauchy-Schwartz inequality holds, and although it
is a necessary condition, it is not a sufficient condition for the
coefficient matrices to be positive definite.

function fit.lmc in package gstat contains a function that computes the
positive definite approximation (I believe in a least squares sense) to
a non-positive definite matrix by zero-ing the negative eigenvectors:

    posdef = function(X) {
        q = eigen(X)
        d = q$values
        d[d < 0] = 0
        q$vectors %*% diag(d, nrow = length(d)) %*% t(q$vectors)
    }

You could try to use that on the partial sill matrices. I believe it
still has the risk that things are perfectly correlated, in the end,
hence the correct.diagonal option (mess?) in fit.lmc.

Hth,
On 03/18/2011 12:20 PM, Nikki roy wrote: