Hello!
I have written a KrigingInterpolator a while ago, and recently started to extend it. It now does automagic modelfitting, and thats were my problems started. I split the input data into overlapping tiles, for each of which i produce a exp. variogram, bin it to around 20 bins, and turn that into a polynomial of 2th to 5th degree. In the actual interpolation i then do linear interpolation between the polynomials to get my weightingfunction for that position. i however noticed that some generated polynomials will produce new extrema in the output when the samples lie far from the tobekriged position. looking into what happened in those cases i noticed negative weights appearing. so i thought about it and its clear to me how negative weights, while still giving a nice sumofweights==1, can produce new extrema. what i dont really understand is the condition it takes to make the matrixinversion spit out negative values. apart from sample points being at the end of the distancerange. the polynomials which do and those that dont result in negative weights dont look systematically different to me. has to be the samples. what are the ways to cope with this in a solid manner? the only thing i found so far would be to remove the furthest sample with a negative weight and start over, but that seems like a bad hack to me. maybe there is a way of sorting the samples or a limitation to impose on the polynomials.... thanks for your attention, all ideas/tips/hints are welcome 
Hi Beck, this is a wellknown problem in geostatistics, and arises because you are not constraining your covariance function (or variogram) to be positive definition
(negative semidefinite). The easiest way to impose these constraints is to fit your model from a valid set of functions which will ensure positive definiteness of the covariance. Without this you will get all sorts of problems when solving your kriging equations.
Reading pretty much any text on geostatistics will show you this! Just google on ‘valid covariance functions’ or variograms … cheers Dan From: beck [via 52° North  Geostatistics Community Forum] [mailto:mlnode+[hidden email]]
Hello! If you reply to this email, your message will be added to the discussion below: http://geostatistics.forum.52north.org/Helpwithkrigingweightsandmatricestp4022880.html
To start a new topic under 52° North  Geostatistics Community Forum, email
[hidden email]

Hello again,
googled and read, and my covariance functions and with it the resulting matrix are positive definite. I understood that negative weights can occur even if the covariancefunc is licit, and can be a wanted effect. Searching more as Dan pointed out i found however the reasons for negative weights such as screeningeffects or covariance functions with certain behavior near origin and some papers on how to avoid or correct them. If someone else comes along wanting to learn about this: Szidarovszky,Baafi and Kim 1996 Barnes and You 1992 Deutsch 1996 Also search for 'nonnegative predictions' to understand more about the negative weights. Have a nice weekend and thanks to Dan. 
Free forum by Nabble  JMeter user  Edit this page 