AI-GEOSTATS: Re: Unconditional simulation

2009-11-17 Thread Isobel Clark
Nick

The simplest way would be to do a aussian simulation and then do a rank 
transfrom on the results, I think.

Isobel
http://www.kriging.com

--- On Tue, 17/11/09, Nick Hamm n...@hamm.org wrote:

 From: Nick Hamm n...@hamm.org
 Subject: AI-GEOSTATS: Unconditional simulation
 To: r-sig-...@stat.math.ethz.ch, ai-geostats@jrc.it
 Date: Tuesday, 17 November, 2009, 9:06
 Dear all
 
 I want to simulate a spatially-correlated random field
 which follows a
 uniform rather than than Gaussian distribution.  Does
 anybody know a
 straight-forward way to do this?
 
 Nick
 +
 + To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
 + To unsubscribe, send email to majordomo@ jrc.ec.europa.eu
 with no subject and unsubscribe ai-geostats in the message
 body. DO NOT SEND Subscribe/Unsubscribe requests to the
 list
 + As a general service to list users, please remember to
 post a summary of any useful responses to your questions.
 + Support to the forum can be found at http://www.ai-geostats.org/
 

+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no subject and 
unsubscribe ai-geostats in the message body. DO NOT SEND 
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a summary of any 
useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/


AI-GEOSTATS: Random number seed and unconditional simulation

2009-11-17 Thread Nick Hamm
Dear all

I have a question about the random number seeding in R.

I want to simulate several random fields.  Each RF should have zero
nugget, the same sill but a different range (e.g., 100x100, range: 1
- 30).  Let's stick with the Gaussian case for now.  I use the
following code


require(geoR)

sigma2 = 10 # Set the sill
s2 = data.frame(phi=1, s2=1, s=1) # phi is the range

for(phi in 1:30)
{

   set.seed(234)
   sim1 = grf(100*100, grid=reg, nx=100, ny=100, xlims=c(1,100),
ylims=c(1,100), cov.model=exponential, cov.pars=c(sigma2, phi),
messages=FALSE)

   image(sim1)
   s2[phi,] = c(phi, var(sim1$data), sd(sim1$data))

}

# Plot the range against  the a priori variance.
plot(s2$phi, s2$s2, ylim=c(0,15))
abline(v=23)



Note that, for each simulation, I use the same random number seed.
This results in a series of images that look like they have the same
starting point (sorry, this is not very technical), but with
progressively more spatial structure.  Note that ther is a sudden
change at phi=23.  The logic for using the same random number seed is
that we want to simulate a series of RFs where the differentiating
factor is the range (phi) and not something else.  Hence the observed
similar patterns, but with increasing spatial structure, is a useful
feature.

I have two questions

1) Is this last point true?  What is the effect of fixing every
argument to the function (including the random number seed) and just
varying one (in this case the range (phi))?  Note that Diggle and
Ribeiro do something similar in their examples at the end of the help
for GRF (see below).

2) Why do I get the sudden change at phi=23?  This also occurs for
other random number seeds (e.g, 230, 231, 234, 456, 5683432).  The
change occurs at the same point (phi=23).  Note that there is no
sudden change if I choose the spherical model rather than the
exponential.

If anybody has any thoughts, I would be interested.

best wishes

Nick




Here is the example given in the grf(geoR) help.

## 1-D simulations using the same seed and different noise/signal ratios
##
set.seed(234)
sim11 - grf(100, ny=1, cov.pars=c(1, 0.25), nug=0)
set.seed(234)
sim12 - grf(100, ny=1, cov.pars=c(0.75, 0.25), nug=0.25)
set.seed(234)
sim13 - grf(100, ny=1, cov.pars=c(0.5, 0.25), nug=0.5)
##
par.ori - par(no.readonly = TRUE)
par(mfrow=c(3,1), mar=c(3,3,.5,.5))
yl - range(c(sim11$data, sim12$data, sim13$data))
image(sim11, type=l, ylim=yl)
image(sim12, type=l, ylim=yl)
image(sim13, type=l, ylim=yl)
par(par.ori)
+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no subject and 
unsubscribe ai-geostats in the message body. DO NOT SEND 
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a summary of any 
useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/


Re: AI-GEOSTATS: Unconditional simulation

2009-11-17 Thread seba

Hi Nick
One way is to use simulated annealing (see gslib) putting as objective
function your desired variogram and histogram.
(but I guess that by means of some data transformation you can do that
with a simple sequential gaussian simulation approach)
Bye
Sebas

At 10.06 17/11/2009, Nick Hamm wrote:

Dear all

I want to simulate a spatially-correlated random field which follows a
uniform rather than than Gaussian distribution.  Does anybody know a
straight-forward way to do this?

Nick
+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no 
subject and unsubscribe ai-geostats in the message body. DO NOT 
SEND Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a 
summary of any useful responses to your questions.

+ Support to the forum can be found at http://www.ai-geostats.org/



+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no subject and 
unsubscribe ai-geostats in the message body. DO NOT SEND 
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a summary of any 
useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/


Re: AI-GEOSTATS: Random number seed and unconditional simulation

2009-11-17 Thread Anatoly Saveliev

Nick Hamm :
 Dear all

 I have a question about the random number seeding in R.


 Note that, for each simulation, I use the same random number seed.
 This results in a series of images that look like they have the same
 starting point (sorry, this is not very technical), but with
 progressively more spatial structure.  Note that ther is a sudden
 change at phi=23.  The logic for using the same random number seed is
 that we want to simulate a series of RFs where the differentiating
 factor is the range (phi) and not something else.  Hence the observed
 similar patterns, but with increasing spatial structure, is a useful
 feature.

 I have two questions

 1) Is this last point true?  What is the effect of fixing every
 argument to the function (including the random number seed) and just
 varying one (in this case the range (phi))?  Note that Diggle and
 Ribeiro do something similar in their examples at the end of the help
 for GRF (see below).

no - for some unknown reason simulation depends on the sigma and switch 
to another spatial pattern at some points, I tryed variaos sigma and got 
3 patterns


 2) Why do I get the sudden change at phi=23?  This also occurs for
 other random number seeds (e.g, 230, 231, 234, 456, 5683432).  The
 change occurs at the same point (phi=23).  Note that there is no
 sudden change if I choose the spherical model rather than the
 exponential.

it depends on the sigma and you'll get the same change at some other 
sigmas. If you want to know the truth you should read the sources :-)



Anatoly Saveliev
+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no subject and 
unsubscribe ai-geostats in the message body. DO NOT SEND 
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a summary of any 
useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/


AI-GEOSTATS: typos

2009-11-17 Thread Anatoly Saveliev

typos: it was phi, not sigma ... you'll get change at some phi

Anatoly Saveliev
+
+ To post a message to the list, send it to ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu with no subject and 
unsubscribe ai-geostats in the message body. DO NOT SEND 
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a summary of any 
useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/


Re: AI-GEOSTATS: Unconditional simulation

2009-11-17 Thread Pierre Goovaerts
well Isobel explained how to go from Gaussian to uniform...

On Tue, Nov 17, 2009 at 1:59 PM, Anatoly Saveliev s...@ksu.ru wrote:

 Pierre Goovaerts :

 For once, I agree with Isobel.
 sGs is the way to go...

 sGs - Gaussian by definition; he wants uniform :-)

 Anatoly Saveliev


 Pierre

 On Tue, Nov 17, 2009 at 6:00 AM, seba sebastiano.trevis...@libero.itmailto:
 sebastiano.trevis...@libero.it wrote:

Hi Nick
One way is to use simulated annealing (see gslib) putting as objective
function your desired variogram and histogram.
(but I guess that by means of some data transformation you can do that
with a simple sequential gaussian simulation approach)
Bye
Sebas

At 10.06 17/11/2009, Nick Hamm wrote:

Dear all

I want to simulate a spatially-correlated random field which
follows a
uniform rather than than Gaussian distribution.  Does anybody
know a
straight-forward way to do this?

Nick
+
+ To post a message to the list, send it to
ai-geost...@jrc.ec.europa.eu mailto:ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu
http://jrc.ec.europa.eu with no subject and unsubscribe
ai-geostats in the message body. DO NOT SEND
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post
a summary of any useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/



+
+ To post a message to the list, send it to
ai-geost...@jrc.ec.europa.eu mailto:ai-geost...@jrc.ec.europa.eu
+ To unsubscribe, send email to majordomo@ jrc.ec.europa.eu
http://jrc.ec.europa.eu with no subject and unsubscribe
ai-geostats in the message body. DO NOT SEND
Subscribe/Unsubscribe requests to the list
+ As a general service to list users, please remember to post a
summary of any useful responses to your questions.
+ Support to the forum can be found at http://www.ai-geostats.org/




 --
 Pierre Goovaerts

 Chief Scientist at BioMedware Inc.
 3526 W Liberty, Suite 100
 Ann Arbor, MI  48103
 Voice: (734) 913-1098 (ext. 202)
 Fax: (734) 913-2201

 Courtesy Associate Professor, University of Florida
 Associate Editor, Mathematical Geosciences
 Geostatistician, Computer Sciences Corporation
 President, PGeostat LLC
 710 Ridgemont Lane
 Ann Arbor, MI 48103
 Voice: (734) 668-9900
 Fax: (734) 668-7788

 http://goovaerts.pierre.googlepages.com/





-- 
Pierre Goovaerts

Chief Scientist at BioMedware Inc.
3526 W Liberty, Suite 100
Ann Arbor, MI  48103
Voice: (734) 913-1098 (ext. 202)
Fax: (734) 913-2201

Courtesy Associate Professor, University of Florida
Associate Editor, Mathematical Geosciences
Geostatistician, Computer Sciences Corporation
President, PGeostat LLC
710 Ridgemont Lane
Ann Arbor, MI 48103
Voice: (734) 668-9900
Fax: (734) 668-7788

http://goovaerts.pierre.googlepages.com/