gstat icon indicating copy to clipboard operation
gstat copied to clipboard

Cosimulation Demo is giving me an error

Open snehamoymtu opened this issue 5 years ago • 1 comments

Hi, I was ruing cosimulation using the Jura data, and I had an issue with the predict function. Even with the valid LMC model, my 'predict' function was always giving me an error. So I tried to run the demo(cosimulation) by running these two line codes:

library(gstat) demo(cosimulation)

And, here also I am getting the error in 'predict' function. Can anyone know what is going on here? In case you need to know the error, here they are:

drawing 2 multivariate GLS realisations of beta... non-positive definite coefficient matrix in structure 2Error in predict.gstat(meuse.fit, newdata = meuse.grid, nsim = 2) : value not allowed for: variograms do not satisfy a legal model In addition: Warning messages: 1: In predict.gstat(meuse.fit, newdata = meuse.grid, nsim = 2) : No Intrinsic Correlation or Linear Model of Coregionalization found Reason: coefficient matrix not positive definite 2: In predict.gstat(meuse.fit, newdata = meuse.grid, nsim = 2) : [add `set = list(nocheck = 1)' to the gstat() or krige() to ignore the following error]

Thanks for your help in advance.

Best, Snehamoy

snehamoymtu avatar Feb 21 '21 04:02 snehamoymtu

It works if you add a small value to all direct variogram sills, by

meuse.fit = fit.lmc(x, meuse.i, correct.diagonal=1.01)

If we don't do this, we get a case of perfect correlation between some pairs of variables, leading to the error message.

edzer avatar Feb 21 '21 09:02 edzer