# nugget in variogram

10 messages
Open this post in threaded view
|

## nugget in variogram

 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
Open this post in threaded view
|

## Re: 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.dehttp://www.52north.org/geostatistics      [hidden email] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|

## Re: nugget in variogram

 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.dehttp://www.52north.org/geostatistics      [hidden email] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|

## Re: nugget in variogram

 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
Open this post in threaded view
|

## Re: nugget in variogram

 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.dehttp://www.52north.org/geostatistics      [hidden email] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|

## Re: nugget in variogram

 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
Open this post in threaded view
|

## Re: nugget in variogram

 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
Open this post in threaded view
|

## Re: nugget in variogram

 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