[SOLVED] Estimation of sill, range, parameter, etc...

Here you can report the problems encountered when using a function relative to the variography:
- experimental variography (vario.calc, vario.grid, vmap.calc, ...)
- model fitting (model.auto)

[SOLVED] Estimation of sill, range, parameter, etc...

Postby M_houd_germ » Tue May 10, 2016 7:25 pm

Hello,

I am working with your package in order to simulate precipitations using the turning bands method.
I would like to try to create a model like you did in Doc1D.pdf with Exdemo_1D_well.model. My question is then the following: how did you make this model and how did you estimate the parameters such as sill, range and parameter ?

thank you for your answer.
Last edited by M_houd_germ on Sun May 22, 2016 3:27 pm, edited 1 time in total.
M_houd_germ
 
Posts: 5
Joined: Tue Apr 19, 2016 3:29 pm

Re: Estimation of sill, range, parameter, etc...

Postby Didier Renard » Wed May 11, 2016 9:04 am

Hello,

My answer here is only generic and should probably be tuned to your data set and its possible complexity.
The usual workflow consists into:
1) Calculating the experimental variogram which describes (experimentally) the spatial characteristics of your variable of interest. This can be achieved using vario.calc() or vario.grid() or even vmap.calc() (for large and regular data sets, possibly on regular grid)
2) Fit a (mathematical) model which reflects as closely as possible the information carried by the experimental quantity. Thsi can be achieved using model.auto or vmap.auto. It can also be defined using a trial-and-error procedure such as model.fit()

3) Finally you can use this model in the simulation procedure (such as the one related to the Gaussian case that you mentionned), i.e. using the Turning Bands algorithm (simtub()).

However, note that this (Gaussian) method requires gaussian-transformed variable in entrance. This is the reason why you should normalize your data set before (and be ready to back-transform your results afterwards). This can be achieved for example by using anam.fit() procedure. Unfortunately, the spatial structure that must be entered in the simulation process is the one based on gaussian data. This means that steps 1 and 2 have to be performed on the gaussian data set.

Hope this will help.
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: Estimation of sill, range, parameter, etc...

Postby Didier Renard » Wed May 11, 2016 9:06 am

Complementary information.

You referred to the 1-D case study. This means that you intend to run RGeostats in the 1-D scope. All what I said in my previous post obviously remains valid.
However you may have to be carefull mentioning correctly the space dimension (i.e. 1) in some procedures: the usual default value is 2.
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: Estimation of sill, range, parameter, etc...

Postby M_houd_germ » Wed May 11, 2016 1:16 pm

Hello Didier,

Thank you for you answer. I already applied the steps you describe, confirming I might be on the right way.

I have a another question, about conditional simulation this time. Imagine you have point A, B and C, and you want to conditionally simulate D, from A,B and C. After the conditional simulation, A, B, C, have to be the same as before the simulation, right? (trivial question, for me being quite a beginner in geostatistics and conditional simulation).

Thank you for your helps.
M_houd_germ
 
Posts: 5
Joined: Tue Apr 19, 2016 3:29 pm

Re: Estimation of sill, range, parameter, etc...

Postby Didier Renard » Mon May 16, 2016 7:24 pm

As a matter of fact, if you want to simulate D as a function of A, B, and C:
- the points A, B and C must belong to the DATA Db (which will be used as the first argument of the function simtub()
- the point D (and all the other points where the simulations must be produced) must belong to the TARGET Db (second argument of the function simtub().

Cheers
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: Estimation of sill, range, parameter, etc...

Postby M_houd_germ » Wed May 18, 2016 6:23 pm

Dear Didier,

Thank you for your answer. My simulations work pretty well and as I wish.

Though I would like to simulate the precipitation which in this file, one hour after another. You will find below the code I am using. However, to simulate one hour after another, I change manually the locator inside the first data base and use the same variogram model
Code: Select all
model.1
for each simulation. Would you know a way to do it in a more automatic way ?

Thank you for your answer.
P.S.: how do I say that the issue is solved ?

Code: Select all
#### GIVE IT A LOCATOR ####
 flood_05.db <- db.locate(db = flood_05.db,
                          names = c("X2005.02.12_0900"),
                          loctype = "z", start = 1)
 flood_05.db
#
# ## plot the data of the first variable ##
# x11()
# plot(flood_05.db, pch = 21, col = "black",
#      title = "12/02/2005 00:00")

#### TRANSFORMATION OF THE DATA TO HAVE NORMAL DISTRIBUTION ####
flood_05.transform <- anam.fit(db = flood_05.db,
                               names = c("X2005.02.12_0900"), type = "gaus")
# in the name, be careful to write "X[...]", otherwise the function
# does not run

flood_05.db <- anam.z2y(anam = flood_05.transform,
                        db = flood_05.db,
                        names = c("X2005.02.12_0900"), radix = "GAUSS")
flood_05.db
# ### DETERMINATION OF THE VARIOGRAM ####
# flood_05.gauss.vario <- vario.calc(flood_05.db,
#                         lag = 1000, nlag = 30)
#
# plot(flood_05.gauss.vario, npairpt = 1, npairdw = TRUE,
#      title = "Variogram 12 00:00")
#
# #### ESTIMATE THE VARIOGRAM MODEL ####
# model <- model.auto(flood_05.gauss.vario,
#                     struct = c("Exponential", "Spherical"))
# model.1 <- model.fit(flood_05.gauss.vario)
# model.plot(model.1)



#### neighbourhood definition ####
unique.neigh <- neigh.input(ndim = 2)

#### GRID CREATION ####
grid.db <- db.create(flag.grid = TRUE,
                     nx = c(29, 28), dx=c(1000, 1000),
                     x0=c(4463500, 5534500))
# grid.db <- db.grid.init(flood_05.db, nodes = c(29, 28),
#                         origin = c(4463500, 5534500))

#### TURNING BANDS SIMULATION ####
####       -conditional-      ####
grid.db <- simtub(dbin = flood_05.db, dbout = grid.db,
                  model = model.1, neigh = unique.neigh,
                  nbsimu = 100, nbtuba = 15)
grid.db


#### back transformation ####
backtransfoStart <- Sys.time()
grid.db <- anam.y2z(anam = flood_05.transform,
                    db = grid.db, ngrep = "Simu.GAUSS.X2005.02.12_0900")
backtransfoEnd <- Sys.time()-backtransfoStart
backtransfoEnd
grid.db
#### mean -conditional- ####
grid.db <- db.compare(db = grid.db, fun = "mean",
                      ngrep = "Raw.Simu.GAUSS.X2005.02.12_0900")
M_houd_germ
 
Posts: 5
Joined: Tue Apr 19, 2016 3:29 pm

Re: Estimation of sill, range, parameter, etc...

Postby Didier Renard » Thu May 19, 2016 6:33 pm

Hello

If I understand correctly, you want to go in a loop over the different time steps for performing
a complete procedure: gaussian transform, simulation, back transform.

There is no such a possibility in RGeostats as going in a loop to perform an action.

However, R gives you the opportunity to establish a loop and to perform the action within this loop.
The only difficulty is then to parametrize the name of the variables ... which is not so hard
(composing the name using paste() for example).

To mention that the post is solved, you must simply edit your first message of this post and modify the subject by adding "[SOLVED]" at its beginning.

Thanks and have fun.
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm


Return to Variography

Who is online

Users browsing this forum: No registered users and 4 guests

cron