Fits a parametric variogram model to an empirical logratio-Variogram
vgmFit2lrv(emp,vg,...,mode="log",psgn=rep(-1,length(param)),print.level=1)
# S3 method for logratioVariogram
fit.lmc(v,model,...,mode="log",psgn=rep(-1,length(param)),print.level=1)
vgmFit(emp,vg,...,mode="log",psgn=rep(-1,length(param)),print.level=1)
vgmGof(p = vgmGetParameters(vg), emp, vg, mode = "log")
vgmGetParameters(vg,envir=environment(vg))
vgmSetParameters(vg,p)
fit.lmc(v,...)
An empirical logratio-Variogram as e.g. returned by logratioVariogram
An empirical logratio-Variogram as e.g. returned by logratioVariogram
A compositional clr-variogram (or ilt-vagriogram) model function.
A compositional clr-variogram (or ilt-vagriogram) model function, output of a call to .
further parameters to nlm
either "ls" or "log" for selection of either using either least squares or least squares on logarithmic values.
Contains a parameter code for each of the parameters. -1 means the parameter should be used as is. 0 means the parameter is nonnegativ and 1 means the parameter is striktly positiv. This allows to provide parameter limits if the fitting procedure fails.
The print.level of nlm
. 0 for no
printing. 1 for a rough information about the sucess and 2 for step
by step printing.
Is the parameter of the variogram model in linearized form as
e.g.
returned by vgmGetParameters
.
The environment the default parameters of the model should be evaluated in.
vgmFit2lrv
returns a list of two elements.
The result of nlm
containing covergence
codes.
A version of vg
but with default parameters
modified according to the fitting.
The function is mainly a wrapper to nlm
specifying the
an objective function for modell fitting, taking the starting values
of fitting procedure from the default arguments and writing the
results back. Variogram model fitting is more an art than a straight
forward procedure. Fitting procedures typically only find a right
optimum if reasonable starting parameters are provided.
The fit should
be visually checked afterwards.
The meaning of psgn
is subject to change. We will probably
provide a more automatic procedure later.
vgmFit
is a copy of vgmFit2lrv
, but deprecated. The name
will later be used for other functionality.
# NOT RUN {
data(juraset)
X <- with(juraset,cbind(X,Y))
comp <- acomp(juraset,c("Cd","Cu","Pb","Co","Cr"))
lrv <- logratioVariogram(comp,X,maxdist=1,nbins=10)
fff <- CompLinModCoReg(~nugget()+sph(0.5)+R1*exp(0.7),comp)
fit <- vgmFit(lrv,fff)
fit
fff(1:3)
plot(lrv,lrvg=vgram2lrvgram(fit$vg))
# }
Run the code above in your browser using DataLab