nugget in variogram

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

nugget in variogram

Arantzazu Blanco Bernardeau
Hello everybody
I am new on geostatistics so maybe my question is trivial or is already answered (I can not find the solution in the thread list). I have a variogram where I did not fix the nugget, because doing it was giving "singular models". I would like to know the nugget ratio of my variograms but I don't know how to get then the nugget value.  So I did look in the output of variogram and did take the minimum value of gamma. Is this correct?
Thanks very much for your attention.
     
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

edzer


On 09/30/2010 04:13 PM, Arantzazu Blanco Bernardeau wrote:
> Hello everybody
> I am new on geostatistics so maybe my question is trivial or is
> already answered (I can not find the solution in the thread list). I
> have a variogram where I did not fix the nugget, because doing it
> was giving "singular models". I would like to know the nugget ratio
> of my variograms but I don't know how to get then the nugget value.
> So I did look in the output of variogram and did take the minimum
> value of gamma. Is this correct?

Well, it's not the usual way, where you would fit a model:

library(gstat)
data(meuse)
coordinates(meuse) = ~x+y
v = variogram(log(zinc)~1, meuse)
v.m = fit.variogram(v, vgm(1, "Sph", 500, 1))
v[1, "gamma"] # your estimator:
plot(v, v.m)
v.m$psill[1] / sum(v.m$psill) # the usual estimator:

Only when you have plenty of measurements at very short distances
apart, I can imagine you would use the sample variogram (v) value.

> Thanks very much for your attention.
>      
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      [hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

edzer
Sorry, this was too fast again:

v[1,"gamma"]
# or
v.m$psill[1]

are estimators of the nugget variance;

v.m$psill[1] / sum(v.m$psill)

is an estimator of the nugget-to-sill ratio.

On 09/30/2010 06:39 PM, Edzer Pebesma wrote:

>
>
> On 09/30/2010 04:13 PM, Arantzazu Blanco Bernardeau wrote:
>> Hello everybody
>> I am new on geostatistics so maybe my question is trivial or is
>> already answered (I can not find the solution in the thread list). I
>> have a variogram where I did not fix the nugget, because doing it
>> was giving "singular models". I would like to know the nugget ratio
>> of my variograms but I don't know how to get then the nugget value.
>> So I did look in the output of variogram and did take the minimum
>> value of gamma. Is this correct?
>
> Well, it's not the usual way, where you would fit a model:
>
> library(gstat)
> data(meuse)
> coordinates(meuse) = ~x+y
> v = variogram(log(zinc)~1, meuse)
> v.m = fit.variogram(v, vgm(1, "Sph", 500, 1))
> v[1, "gamma"] # your estimator:
> plot(v, v.m)
> v.m$psill[1] / sum(v.m$psill) # the usual estimator:
>
> Only when you have plenty of measurements at very short distances
> apart, I can imagine you would use the sample variogram (v) value.
>
>> Thanks very much for your attention.
>>      
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      [hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

Arantzazu Blanco Bernardeau
In reply to this post by edzer
Hello
I am really glad of your answer, but for me it does not work as I would like
So, my data are called cc (is a subset of a bigger spatialdataframe) and the variogram would be
varcc=variogram(pf1_3atm~1,cc, width=500,cutoff=10000)
 
Then I fix the sill and the range of the variogram
inisill=var(cc@data$pf1_3atm,na.rm=T)
iniran=var$dist[varcc$gamma>0.9*inisill][1]
varcc.fit=fit.variogram(varcc,vgm(psill=inisill, "Exp", iniran)) # I can not fix the nugget because the output gives errors ("Singular model")
plot(varcc,varcc.fit)
> varcc[1,"gamma"]  this would be the nugget (where the model cuts the axis)
[1] 11.97
The problem in the indicator you suggest is:
varcc.fit$psill[1] / sum(varcc.fit$psill)= 1, because  varcc.fit$psill[1] = sum(varcc.fit$psill)
as the output of varcc.fit gives:
varcc.fit
  model    psill    range
1   Exp 41.46455 1297.040

I have tried (don't know if it is correct):
>  varcc[1,"gamma"]/sum(varcc.fit$psill)
[1] 0.2886803
(and this would mean that the spatial correlation is weak because we have a relative big nugget effect)
Can this be done?
Thanks a lot again for your attention.

> Date: Thu, 30 Sep 2010 18:39:22 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [R-sig-Geo] nugget in variogram
>
>
>
> On 09/30/2010 04:13 PM, Arantzazu Blanco Bernardeau wrote:
> > Hello everybody
> > I am new on geostatistics so maybe my question is trivial or is
> > already answered (I can not find the solution in the thread list). I
> > have a variogram where I did not fix the nugget, because doing it
> > was giving "singular models". I would like to know the nugget ratio
> > of my variograms but I don't know how to get then the nugget value.
> > So I did look in the output of variogram and did take the minimum
> > value of gamma. Is this correct?
>
> Well, it's not the usual way, where you would fit a model:
>
> library(gstat)
> data(meuse)
> coordinates(meuse) = ~x+y
> v = variogram(log(zinc)~1, meuse)
> v.m = fit.variogram(v, vgm(1, "Sph", 500, 1))
> v[1, "gamma"] # your estimator:
> plot(v, v.m)
> v.m$psill[1] / sum(v.m$psill) # the usual estimator:
>
> Only when you have plenty of measurements at very short distances
> apart, I can imagine you would use the sample variogram (v) value.
>
> > Thanks very much for your attention.
> >      
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
> 8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
> http://www.52north.org/geostatistics      [hidden email]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
     
        [[alternative HTML version deleted]]


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

edzer
Because you do not pass an (initial) nugget value to function vgm(), you
are fitting an exponential model without a nugget. Without a nugget
model, the nugget is (implicitly) zero. Compare:

> vgm(1, "Exp", 300)
  model psill range
1   Exp     1   300
> vgm(1, "Exp", 300, 1)
  model psill range
1   Nug     1     0
2   Exp     1   300

You are also wrong if you think that you now fix (as of: not fit)
parameters in the fit.variogram step; for this you have to pass
parameters fit.ranges and/or fit.sills; e.g. to fit the nugget but fix
the partial sill, pass fit.sills = c(TRUE,FALSE), to fix the nugget but
fit the partial sill, pass fit.sill=c(FALSE, TRUE).

On 10/04/2010 11:07 AM, Arantzazu Blanco Bernardeau wrote:

> Hello
> I am really glad of your answer, but for me it does not work as I would like
> So, my data are called cc (is a subset of a bigger spatialdataframe) and the variogram would be
> varcc=variogram(pf1_3atm~1,cc, width=500,cutoff=10000)
>  
> Then I fix the sill and the range of the variogram
> inisill=var(cc@data$pf1_3atm,na.rm=T)
> iniran=var$dist[varcc$gamma>0.9*inisill][1]
> varcc.fit=fit.variogram(varcc,vgm(psill=inisill, "Exp", iniran)) # I can not fix the nugget because the output gives errors ("Singular model")
> plot(varcc,varcc.fit)
>> varcc[1,"gamma"]  this would be the nugget (where the model cuts the axis)
> [1] 11.97
> The problem in the indicator you suggest is:
> varcc.fit$psill[1] / sum(varcc.fit$psill)= 1, because  varcc.fit$psill[1] = sum(varcc.fit$psill)
> as the output of varcc.fit gives:
> varcc.fit
>   model    psill    range
> 1   Exp 41.46455 1297.040
>
> I have tried (don't know if it is correct):
>>  varcc[1,"gamma"]/sum(varcc.fit$psill)
> [1] 0.2886803
> (and this would mean that the spatial correlation is weak because we have a relative big nugget effect)
> Can this be done?
> Thanks a lot again for your attention.
>
>> Date: Thu, 30 Sep 2010 18:39:22 +0200
>> From: [hidden email]
>> To: [hidden email]
>> Subject: Re: [R-sig-Geo] nugget in variogram
>>
>>
>>
>> On 09/30/2010 04:13 PM, Arantzazu Blanco Bernardeau wrote:
>>> Hello everybody
>>> I am new on geostatistics so maybe my question is trivial or is
>>> already answered (I can not find the solution in the thread list). I
>>> have a variogram where I did not fix the nugget, because doing it
>>> was giving "singular models". I would like to know the nugget ratio
>>> of my variograms but I don't know how to get then the nugget value.
>>> So I did look in the output of variogram and did take the minimum
>>> value of gamma. Is this correct?
>>
>> Well, it's not the usual way, where you would fit a model:
>>
>> library(gstat)
>> data(meuse)
>> coordinates(meuse) = ~x+y
>> v = variogram(log(zinc)~1, meuse)
>> v.m = fit.variogram(v, vgm(1, "Sph", 500, 1))
>> v[1, "gamma"] # your estimator:
>> plot(v, v.m)
>> v.m$psill[1] / sum(v.m$psill) # the usual estimator:
>>
>> Only when you have plenty of measurements at very short distances
>> apart, I can imagine you would use the sample variogram (v) value.
>>
>>> Thanks very much for your attention.
>>>      
>>> [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> --
>> Edzer Pebesma
>> Institute for Geoinformatics (ifgi), University of Münster
>> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
>> 8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
>> http://www.52north.org/geostatistics      [hidden email]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>      

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      [hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

piero campa
Hi,
I am trying to fit my first variograms.
I'm however noticing some weird behaviour I cannot explain.
I'm a 100% newbie.

- without setting a nugget element (so that it should be implicitly 0, isn't it? In fact the resulting variogram has 0 nugget), the psill and range of the fitted variogram don't change on different psill inputs.
- If I explicitly set a nugget to 0, then actually the nugget is no more 0, but higher.
- I tried also setting the fit.sills booleans to TRUE or FALSE to see what would change, but the output does not really care about it.

Does someone have any hint about this?

Thank you.
Regards,
Piero
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

kapo coulibaly-2
Which packages and which commands are you using? A little bit of background
on how you did it would help.

On Tue, Dec 14, 2010 at 4:42 AM, piero campa <[hidden email]> wrote:

>
> Hi,
> I am trying to fit my first variograms.
> I'm however noticing some weird behaviour I cannot explain.
> I'm a 100% newbie.
>
> - without setting a nugget element (so that it should be implicitly 0,
> isn't
> it? In fact the resulting variogram has 0 nugget), the psill and range of
> the fitted variogram don't change on different psill inputs.
> - If I explicitly set a nugget to 0, then actually the nugget is no more 0,
> but higher.
> - I tried also setting the fit.sills booleans to TRUE or FALSE to see what
> would change, but the output does not really care about it.
>
> Does someone have any hint about this?
>
> Thank you.
> Regards,
> Piero
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/nugget-in-variogram-tp5587929p5833937.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

piero campa
Of course, I forgot actually to say I'm using the gstat package, and its
variogram and vgm functions.

Piero

On 14 December 2010 14:42, kapo coulibaly <[hidden email]> wrote:

> Which packages and which commands are you using? A little bit of background
> on how you did it would help.
>
>
> On Tue, Dec 14, 2010 at 4:42 AM, piero campa <[hidden email]>wrote:
>
>>
>> Hi,
>> I am trying to fit my first variograms.
>> I'm however noticing some weird behaviour I cannot explain.
>> I'm a 100% newbie.
>>
>> - without setting a nugget element (so that it should be implicitly 0,
>> isn't
>> it? In fact the resulting variogram has 0 nugget), the psill and range of
>> the fitted variogram don't change on different psill inputs.
>> - If I explicitly set a nugget to 0, then actually the nugget is no more
>> 0,
>> but higher.
>> - I tried also setting the fit.sills booleans to TRUE or FALSE to see what
>> would change, but the output does not really care about it.
>>
>> Does someone have any hint about this?
>>
>> Thank you.
>> Regards,
>> Piero
>> --
>> View this message in context:
>> http://r-sig-geo.2731867.n2.nabble.com/nugget-in-variogram-tp5587929p5833937.html
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

kapo coulibaly-2
This is an example of how you can keep the nugget unchanged while fitting
the other parameters (from R. Bivand's book).

fit.variogram(v, vgm(1, "Sph", 800, 0.06), fit.sills = c(FALSE,TRUE))

model psill range
1 Nug 0.0600000 0.0000
2 Sph 0.5845836 923.0066

On Tue, Dec 14, 2010 at 12:09 PM, Piero Campalani <[hidden email]>wrote:

> Of course, I forgot actually to say I'm using the gstat package, and its
> variogram and vgm functions.
>
> Piero
>
>
> On 14 December 2010 14:42, kapo coulibaly <[hidden email]> wrote:
>
>> Which packages and which commands are you using? A little bit of
>> background on how you did it would help.
>>
>>
>> On Tue, Dec 14, 2010 at 4:42 AM, piero campa <[hidden email]>wrote:
>>
>>>
>>> Hi,
>>> I am trying to fit my first variograms.
>>> I'm however noticing some weird behaviour I cannot explain.
>>> I'm a 100% newbie.
>>>
>>> - without setting a nugget element (so that it should be implicitly 0,
>>> isn't
>>> it? In fact the resulting variogram has 0 nugget), the psill and range of
>>> the fitted variogram don't change on different psill inputs.
>>> - If I explicitly set a nugget to 0, then actually the nugget is no more
>>> 0,
>>> but higher.
>>> - I tried also setting the fit.sills booleans to TRUE or FALSE to see
>>> what
>>> would change, but the output does not really care about it.
>>>
>>> Does someone have any hint about this?
>>>
>>> Thank you.
>>> Regards,
>>> Piero
>>> --
>>> View this message in context:
>>> http://r-sig-geo.2731867.n2.nabble.com/nugget-in-variogram-tp5587929p5833937.html
>>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: nugget in variogram

edzer
In reply to this post by piero campa
> vgm(1, "Exp", 300)
  model psill range
1   Exp     1   300

and

> vgm(1, "Exp", 300, 0)
  model psill range
1   Nug     0     0
2   Exp     1   300

are definitions of exactly the same variogram, with zero nugget --
passing either to krige() will yield identical results. If they are
passed to fit.variogram, in the first case no nugget will be fitted, but
in the second case a (zero or positive) nugget will be fitted.

Hth,

On 12/14/2010 06:09 PM, Piero Campalani wrote:

> Of course, I forgot actually to say I'm using the gstat package, and its
> variogram and vgm functions.
>
> Piero
>
> On 14 December 2010 14:42, kapo coulibaly <[hidden email]> wrote:
>
>> Which packages and which commands are you using? A little bit of background
>> on how you did it would help.
>>
>>
>> On Tue, Dec 14, 2010 at 4:42 AM, piero campa <[hidden email]>wrote:
>>
>>>
>>> Hi,
>>> I am trying to fit my first variograms.
>>> I'm however noticing some weird behaviour I cannot explain.
>>> I'm a 100% newbie.
>>>
>>> - without setting a nugget element (so that it should be implicitly 0,
>>> isn't
>>> it? In fact the resulting variogram has 0 nugget), the psill and range of
>>> the fitted variogram don't change on different psill inputs.
>>> - If I explicitly set a nugget to 0, then actually the nugget is no more
>>> 0,
>>> but higher.
>>> - I tried also setting the fit.sills booleans to TRUE or FALSE to see what
>>> would change, but the output does not really care about it.
>>>
>>> Does someone have any hint about this?
>>>
>>> Thank you.
>>> Regards,
>>> Piero
>>> --
>>> View this message in context:
>>> http://r-sig-geo.2731867.n2.nabble.com/nugget-in-variogram-tp5587929p5833937.html
>>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      [hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo