I am currently working on a model which takes two parameters and produces a measurement statistic. Think of it as Z = f(X,Y).

Z is a matrix of my statistics and I am creating a surface plot of it in matlab. Basically, I am looking for a mathematical/analytical way of determining if the surface is smooth, or if it is jagged. Do large values tend to be clustered together or are they dispersed throughout the matrix? - that is my question. Basically, how mixed up are the values of my matrix?

I need to run the model over different parameter sets and I want to be able to analytically determine which one of my surfaces is the smoothest, has the greatest clustering of large values, and ideally, has no negative values.

Any help will be greatly appreciated and please let me know if you need any further information.



One model for this situation is to view $Z$ as a realization of a stationary 2D stochastic process. The limiting behavior at zero (distance) of its empirical variogram or correlogram provides information about its smoothness: if the limiting correlation is less than one, the process is not even (mean square) continuous. Otherwise (Theorem)

A stationary stochastic process with correlation function $\rho(u)$ is $k$ times mean-square differentiable if and only if $\rho(u)$ is $2k$ times differentiable at $u=0$

(Diggle & Ribeiro, Model-based Geostatistics).

Procedures variofit, likfit, and eyefit in the geoR package for R provide ways to estimate and visualize the variogram. None of these procedures require that you have all positive values, but they tend to work best when the values are not terrifically skewed. You must also remove any secular trend initially present in the surface; robust regression of $Z$ against $X$ and $Y$ is one way to do that and other ways (that simultaneously estimate the trend and the variogram of the residuals) are available in geoR.

  • $\begingroup$ Thanks for your help!!! Do you know if anything of the sort exists for Matlab by any chance? I am not that familiar with R.. $\endgroup$ – BobJones Oct 7 '10 at 20:15
  • $\begingroup$ @BobJones: I am unfamiliar with MatLab but quite familiar with a lot of the geostatistical software out there; I haven't run across anything specifically mentioning MatLab. It's not hard to create an empirical variogram, though: it involves binning the squared differences of values associated with all distinct pairs of (X,Y) points, summarizing the values by bin, and graphing those summaries. It's so easy, though, to learn to import a simple dataset (your X, Y, Z values) and call an R routine that you could be up and running quickly if you want. $\endgroup$ – whuber Oct 7 '10 at 20:25
  • $\begingroup$ Ok cool. I have played around with R a bit so maybe I'll try to combine both somehow. Thanks again for your help. $\endgroup$ – BobJones Oct 8 '10 at 12:17
  • 1
    $\begingroup$ @BobJones: You can see mathworks.com/matlabcentral/fileexchange/20355 for variograms or mgstat.sourceforge.net for a full-out matlab geostatistics toolkit $\endgroup$ – Xodarap Oct 8 '10 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy