MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: variogram

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42164] Re: variogram
  • From: Paul Abbott <paul at physics.uwa.edu.au>
  • Date: Sat, 21 Jun 2003 02:49:39 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <bcjulj$hsd$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <bcjulj$hsd$1 at smc.vnet.net>, civnrn at hotmail.com (Rees) 
wrote:

> Given the following  dataset:
> 
> x         y      T  
> 2.9	0.876	0.138
> 2.5	0.188	0.214
> 4.7	2.716	2.119
> 4.2	2.717	2.685
> 4.2	3.739	0.031
> 2.1	1.534	1.534
> 2.4	2.078	0.267
> 5.8	3.324	1.670
> 
> I want to formulate the variogram: ie the square difference
> 1/2[T(x,y)-T(x,y)']**2 for all measurement pairs.  For the above 8
> measurements there are (n(n-1))/2 = 28 such pairs.
> 
> 
> so for T=0.138, the first step is to compute:
> 
> 0.138-0.214 then 0.138-2.119 then 0.138-2.685....then 0.138-1.670
> 
> the next step is:
> 0.214-2.119 then 0.214-2.685 etc [BUT NOT 0.214-0.138]

Others have given full solutions to your problem. I note that you do not 
want to compute the full matrix, just the upper or lower triangular 
part. If you did want to compute the full (symmetric) matrix then Outer 
provides an elegant solution.

   t={0.138,0.214,2.119,2.685,0.031,1.534,0.267,1.67}

   1/2 Outer[Subtract, t, t]^2

Cheers,
Paul

-- 
Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul


  • Prev by Date: Re: Mathlink performance and task switches
  • Next by Date: Re: How to read a certain number from a file?
  • Previous by thread: RE: variogram
  • Next by thread: About Abel Type Differential Equation