[R] please help me

Julian Burgos jmburgos at u.washington.edu
Thu Nov 8 18:51:05 CET 2007


Hi Azadeh,

As the warning message is telling you, it seems that your initial 
parameters for the covariance functions are not very good.  Something 
that you can do is to use the eyefit() function (package geoR) to fit 
your variogram "by eye" and get a first approximation for your 
covariance parameter values (or to test if the values you are using do 
generate a variogram curve that is close to your data).  Then you can 
use these parameters values as initial values in the variofit() function.

Julian

azadeh sadeghian wrote:
> I have thise problem in work with the function variofit and nls and dont know how to solve it.
> var1<-variog(data,option="bin")
> var2<-variog(data,option="cloud")
> v1<-var1$v
> u1<-var1^u
> v2<-var2$v
> u2<-var2$u
>   variofit(var1,ini.cov.pars=c(0.005,1.5),cov.model="power",fix.nugget=F,weight="equal")
> variofit: weights used: equal 
> variofit: minimisation function used: optim 
> Error in if (loss > (.Machine$double.xmax^0.5) | loss == Inf | loss ==  : 
>         missing value where TRUE/FALSE needed
> In addition: Warning message:
> unreasonable initial value for sigmasq + nugget (too low) in: variofit(var1, ini.cov.pars = c(0.005, 1.5), cov.model = "power", 
> .......................................................................................................................
> variofit(var2,ini.cov.pars=c(0.005,1.5),cov.model="power",fix.nugget=F,weight="equal")
> variofit: weights used: equal 
> warning: minimisation function nls can not be used with given cov.model.
>           changing for "optim".
> variofit: minimisation function used: optim 
> Error in if (loss > (.Machine$double.xmax^0.5) | loss == Inf | loss ==  : 
>   missing value where TRUE/FALSE needed
> In addition: Warning message:
> In variofit(var2, ini.cov.pars = c(0.005, 1.5), cov.model = "power",  :
>   unreasonable initial value for sigmasq + nugget (too low)
> ...............................................................................................................................
>  nls(v2~c0+ce*(1-exp(-(u2^2)/(ae^2))),start=list(c0=0,ae=30000,ce=20000))
> Error in nls(v2 ~ c0 + ce * (1 - exp(-(u2^2)/(ae^2))), start = list(c0 = 0,  : 
>   number of iterations exceeded maximum of 50
>   best regards.
>   Sadeghian.
>    
> 
>  __________________________________________________
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list