.\" -*- nroff -*- generated from .Rd format
.BG
.FN olsfit
.TL
Variogram Fitting Using Ordinary Least Squares
.DN
Fits a covariance model to a empirical variogram. The parameters are
estimated using weighted least squares.
.CS

olsfit(vario, ini,
       cov.model = c("exponential", "matern", "gaussian",
                     "spherical", "circular", "cubic", "wave",
                     "powered.exponential", "cauchy", "gneiting",
                     "gneiting.matern", "pure.nugget"),
       kappa = NULL, simul.number = NULL, max.dist = "all",
       minimisation.function = "nlm", lower = 0,
       fix.nugget = FALSE, nugget = 0, messages.screen = TRUE)

.RA
.AG vario
an object with an output of the function
`variog'. This is a list with information about an
empirical variogram.
.AG ini
a vector with initial values to be passed to the
minimization function. If `fix.nugget = TRUE' a 2 elements
vector must be passed with initial values for the sill and range
parameters, respectively. Otherwise a 3 elements vector should be
passed with initial values for the nugget, sill and range
parameters, respectively.
.AG cov.model
a string with the name of the correlation
function. See function call for the options.
.AG kappa
(fixed) value of the smoothness parameter required by
some of the correlation functions.
.AG simul.number
number of simulation. To be used when the object passed to the
argument `vario' has empirical variograms for more than one
data-set (or simulation), indicating which one will be used.
.AG max.dist
maximum distance considered when fitting the
variogram. Defaults to the maximum distance found in the object passed to the
argument `vario'.
.AG minimisation.function
minimization function used to estimate
the parameters. Currently only `nlm' is implemented.
.AG lower
lower limits for the parameters. Defaults to zero.
.AG fix.nugget
A flag indication whether or not the nugget parameter
must be included in the estimation. If `fix.nugget = T' the
argument `ini' must be a vector of length 2 otherwise, 3.
.AG nugget
Value of the nugget parameter when `fix.nugget =
      TRUE'. Defaults to zero.
.AG messages.screen
a flag `TRUE' or `FALSE' indicating
whether or not messages are printed on the screen (or output device)
while the function is running.
.AG \&...
further parameters to be passed to the minimization
function. Typically `control' type arguments which controls the
behavior of the minimization algorithm. See documentation of
`nlm' for further details.
.RT
A list with the following components:
.AG nugget
value of the nugget parameter, estimated if
`fix.nugget=FALSE' of fixed if `fix.nugget=TRUE'.
.AG cov.pars
a vector with estimated values of the covariance
parameters sill and range, respectively.
.AG cov.model
a string with the name of the correlation function.
.AG kappa
(fixed) value of the smoothness parameter (for some of
the correlation functions only).
.AG value
minimized value of the loss function.
.AG max.dist
maximum distance considered in the variogram fitting.
.AG minimisation.function
minimization function used.
.AG message
status messages returned by the function.
.AG method
a string `"OLS"' indication the parameter estimation method used.
.AG call
the function call.
.SH REFERENCES
Further information about `geoR/geoS' can be found at:
.br
<URL: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html>
.SA
`wlsfit', `likfit',
`lines.variomodel', `nlm'.
.EX
data(s100)  # only when using R (not necessary with S-PLUS) 
vario100 <- variog(s100, max.dist=1)
ols <- olsfit(vario100, ini=c(\&.5, .5), fix.nug=T)
summary(ols)
plot(vario100)
lines(ols)

.KW spatial
.WR
