Re: variogram
- To: mathgroup at smc.vnet.net
- Subject: [mg42048] Re: variogram
- From: "Carl K. Woll" <carlw at u.washington.edu>
- Date: Tue, 17 Jun 2003 05:43:39 -0400 (EDT)
- Organization: University of Washington
- References: <bcjulj$hsd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Rees, This question has come up before, and the following is my contribution: dist[t_]:=Block[{c={}}, Nest[(c={c,(Rest[#]-First[#])^2};Rest[#])&,t,Length[t]-1]; Flatten[c]/2] Carl Woll Physics Dept U of Washington "Rees" <civnrn at hotmail.com> wrote in message news:bcjulj$hsd$1 at smc.vnet.net... > Hi, > > 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] > > Is it possible to program this in mathematica? Thanks in advance. > > Cheers > > Rees >