Re: New Fast Kriging Semivariogram Spherical Model Incorrect? [message #86183 is a reply to message #86176] |
Wed, 16 October 2013 21:00   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Wednesday, October 16, 2013 8:54:43 AM UTC-6, David Fanning wrote:
> David Fanning writes:
>
>
>
>> I have been writing a new cgKrig2D function for my own use that
>
> provides
>
>> orders of magnitude faster kriging for general use than the (extremely!)
>
>> slow Krig2D function that is supplied with all currently released
>
>> versions of IDL. In doing so, I have come to believe that the Spherical
>
>> modeling function in both the old version of Krig2D and in the new
>
>> version Chris released here last week is incorrect.
>
>
>
> Now I think the Exponential modeling function is incorrect, too, based
>
> on this reference (and the one I provided previously):
>
>
>
> http://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/ cs490-
>
> 94to95/clang/kriging.html
>
>
>
> It is listed as:
>
>
>
> r = t[2] * exp((-3./t[0]) * d)
>
> r[WHERE(d eq 0, /NULL)] = t[1] + t[2]
>
> return, r
>
>
>
> According to my references, this should be:
>
>
>
> r = t[2] * exp((-3./t[0]) * d)
>
> r[WHERE(d eq 0 /NULL)] = 0
>
> return, r
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Hi David,
I think that our two methods actually agree. I believe that your code is calculating the "variogram" instead of the "covariance". So:
Mine = C0 + C1 - Yours
By the way, in the spherical case, you have that extra line with WHERE(d gt t[0]). I don't think you need this if you use the "r = d/t[0] < 1". The < 1 will clamp the values so the equation works out. It might be faster to do the <1, but I can't remember whether I tested the speed with the 2 different ways.
Anyway, on a slightly different note, it would be *great* if you didn't create your own cgKrig2D. I worry that we are fragmenting the IDL user base and creating confusion. If there is something wrong with the latest version of Krig2D, we should figure out the right solution and fix the code that ships with IDL. If people want the faster code, it has already been posted here, and will be made available in the official release in just a couple of months or less.
Thanks in advance for considering my proposal.
Cheers,
Chris
VIS
|
|
|