[SOLVED] Extract sill and range from a variogram model

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] Extract sill and range from a variogram model

Postby M_houd_germ » Wed Sep 07, 2016 3:49 pm

Dear all,

I have created a model, using
Code: Select all
model.auto()
, which look like this:

Code: Select all
model
Model characteristics
=====================
Space dimension              = 2
Number of variable(s)        = 1
Number of basic structure(s) = 1
Number of drift function(s)  = 1
Number of drift equation(s)  = 1

Covariance Part
---------------
- Exponential
  Range       =   6154.587
  Theo. Range =   2054.452
  Sill        =      0.024
Total Sill    =      0.024

Drift Part
----------
Universality Condition


. I wish to extract from this model the range and the sill for later use. For that I tried
Code: Select all
model@basics$sill
but it returns NULL.
I also tried some things like this model@basics[1], model@basics[[1]] but it does not work.

How could I extract sill and range ?

Best regards,
Last edited by M_houd_germ on Thu Sep 08, 2016 9:59 am, edited 1 time in total.
M_houd_germ
 
Posts: 5
Joined: Tue Apr 19, 2016 3:29 pm

Re: Extract sill and range from a variogram model

Postby Didier Renard » Thu Sep 08, 2016 12:18 am

Hi

The solution that we practiced in RGeostats in order to retrieve information from an object (belonging to a certain class)
is to use the assessors.
For a complete description, ask information on the class. For example, if we consider the object called my_model.
First get its class type:
class(my_model)

The answer will be: "model" (of the package RGeostats)

Then you simply have to ask for the generic help of any object belonging to the class "model" by typing:

class?model

Among the methods, you will check that you have the assessors: $, $<-, [, [<-

This allows you to type:

my_model$ncova which returns the number of basic structures (say 3)

And to know the contents of the basic structure rank 'i' (say 2 ... which sould be smaller or equal to than 3), just type:

my_model[i]

Again, if you ask for the class of this new object by typing:

class(my_model[i])

you will discover that it belongs to the class "melem"

In the help of this class, you will see the following syntax:

my_model[1]$range which gives you the range for example.
my_model[1]$sill returns the sill (or the sill matrix in multivariate case).

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

Re: [SOLVED] Extract sill and range from a variogram model

Postby M_houd_germ » Thu Sep 08, 2016 10:01 am

Hello Didier,

The help you provided helps a lot !

Thank you very much.

Regards,
M_houd_germ
 
Posts: 5
Joined: Tue Apr 19, 2016 3:29 pm


Return to Variography

Who is online

Users browsing this forum: No registered users and 3 guests

cron