Message Boards Message Boards

0
|
4129 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Geostatistics: how to define a Variogram function?

Dear people and Wolfram Team:

I was searching for geostatistical tools on the Resources page, and unfortunately I cannot find a basic function called the Variogram. What I found was a related (but a bit more complicated) function called Covariance.

According to Sourav Das (PhD 2011, source here), the definition of a variogram (and covariance) is the following: extract from Das(2011) chapter 1

But I am not sure how to implement the key variogram function in the Wolfram Language.

My main problem is that is something like a "moving variance" equivalent of "moving average" and when I shift the Z[s] function to Z[s+h] ("h" is the "lag distance") I inmediately go outside the domain of the "s" variable (a bounded region, like a finite distance in space or a finite interval of time), and so I must drop the "outside domain" elements from the data to get a valid result.

In the Wolfram Language there is of course the "CovarianceFunction" that can do that (for covariance). But what about the cited "variogram" function? How to define a "moving variance", so it can be calculated in different locations of a domain?

If I write:

Variance[Z[s]-Z[s+h]];

With:

sMIN<=s<=sMAX

When I put s+h I would get outside the required interval for some data, that must be dropped to get a meaningful result.

Your help will be greatly appreciated. Most computer codes that do that are cryptic "black boxes" and also very expensive.

Best regards,

Alberto Silva Ariano

Most 'moving window' functions do one of two things: either stop when the edge of the window exceeds the domain, in which case the output will be smaller than the input (by the window radius), or pad the data in some manner allowing the center of the window to reach the edge of the domain. Wolfram functions that do this all have a Padding option. Your 'black boxes' are probably padding, without telling you how. There is a third option — to constrict the window as you approach the edge of the domain — which is the one you describe, although is it by far the least common. (For one thing it is usually way more computationally expensive.)

Before thinking about code for your semivariogram, you should probably decide which option you really want.

POSTED BY: Gareth Russell
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract