[R-sig-Geo] Fitting nested variograms to empirical variograms

Ole F. Christensen olefc at daimi.au.dk
Thu Oct 14 19:22:08 CEST 2004


Dear Elliot

I can only comment on the geoR related question, since I am unfamiliar 
with gstat.

Reading the help-file for variofit, then I think it is rather clear that 
this functions assumes one variogram model [i.e. the format of the 
estimated parameters is a vector].
So fitting nested model using that function seems not possible.
I agree with you that the help-file for cov.spatial gives the impression 
that nested variables are allowed for that function.
And it also is bit misleading that  the help-file for variofit  refers 
to  cov.spatial, hinting that the full functionality of cov.spatial can 
be used in variofit.
I hope the author of the package can provide more details on this 
[therefore copy to him].

I have no experience fitting nested variogram models myself, but my 
general opinion is that nested variograms aren't really useful, since 
what matters the most is
to make a good fit of the empirical variogram near the origin. And if 
one really wants to make a very careful fit of a variogram-model to the 
data, then the likelihood function should be used rather than fitting to 
the empirical variogram.

Ole


Eliot McIntire wrote:

> Hello,
>
> I am new to the list, but I have searched for an answer to this 
> question  in the list archives and couldn't find anything.
>
> Question:
> Does anybody have experience with fitting nested variogram models in 
> R?  I  am not having success.
>
> Details:
> I am trying fit a nested variogram to an empirical variogram.  I have  
> tried both gstat and geoR which appear able to do this, but I have 
> come  across these problems:
>
> geoR: I can only run nested variogram models using cov.spatial and 
> this is  not suitable to fit a model to an empirical variogram.  In 
> the help manual  it says that I should inherit cov.spatial in the 
> variofit function,  however, it does not seem to work.  I get:
> Error in match.arg(cov.model, choices = c("matern", "exponential",  
> "gaussian",  :
>         there is more than one match in match.arg
> my code: F2.1Y.wls.exp = variofit(F2.1Y, 
> ini.cov.pars=starting.values,  fix.nugget=F,  
> nugget=starting.values.vec, cov.model=c("exp","spherical"))
>
> gstat: I can run nested models using
> F2.BA1.fit = fit.variogram (F2.BA1.variogram, vgm(psill=33,"Lin",6, 
> add.to  = vgm(psill=33,"Lin",6, nugget=20) )
>                 , print.SSE=T, fit.sills=T, fit.ranges=T )
>
>
> but I never seem to get a good fit, i.e., it always fails to fit the  
> empirical variogram.
>
> If anyone has a solution, I also need to calculate the Residual Sums 
> of  Squares to test for the relative fit.
>
> Thank you,
> Eliot
>

-- 
Ole F. Christensen
BiRC - Bioinformatics Research Center
University of Aarhus




More information about the R-sig-Geo mailing list