likfit(geodata, coords = geodata$coords, data = geodata$data,
trend = "cte", ini.cov.pars, fix.nugget = FALSE, nugget = 0,
fix.kappa = TRUE, kappa = 0.5, fix.lambda = TRUE, lambda = 1,
fix.psiA = TRUE, psiA = 0, fix.psiR = TRUE, psiR = 1,
cov.model = "matern", realisations,
method.lik = "ML", components = FALSE,
nospatial = TRUE, limits = pars.limits(),
print.pars = FALSE, messages, ...)coords and
data as described next.
Typically an object of the class "geodata".
If not provided the arguments
coords and data must be provided coords of the argument geodata, if provided.data of the argument geodata, if provided.trend.spatial for further details.
Defaults to "cte".DETAILS below.fix.nugget = TRUE) or should be
estimated (fix.nugget = FALSE). Defaults to
FALSE.fix.nugget = TRUE otherwise
as the initial value for the minimisation algorithm. Defaults to zero.fix.kappa = TRUE) or should be
estimated (fix.kappa = FALSE). Defaults to TRUE.fix.kappa = TRUE
otherwise as the initial value for the minimisation algorithm. Defaults to
$0.5$. This parameter is valid only if the covariance function is one
fix.lambda = TRUE) or should be
be estimated (fix.lambda = FALSE). Defaults to TRUE.fix.lambda = TRUE otherwise
as the initial value for the minimisation algorithm. Defaults to
$1$. Two particular cases are $\lambda = 1$
fix.psiA = TRUE) or should
be estimated (fix.psiA = FALSE). Defaults to
TRUE.fix.psiA = TRUE
otherwise as the initial value for the minimisation algorithm.
Defaults to $0$. See fix.psiR = TRUE) or should be estimated (fix.psiR = FALSE). Defaults to
TRUE.fix.psiR = TRUE
otherwise as the initial value for the minimisation algorithm.
Defaults to $1$. See cov.spatial.
Defaults are equivalent to the exponential model.DETAILS below and
documentation for as.geodata."ML" for maximum likelihood and "REML" for
restricted maximum likelihood. Defaults to "ML".DETAILS below for the model specification.TRUE parameter estimates for the
model without spatial component are included in the output.pars.limits is called to set the limits.TRUE the parameters and the value
of the negative log-likelihood (up to a constant) are printed each
time the function to be minimised is called.control() which controls the
behavior of the minimisation algorithm. For further details see documentation
for the minimisation fu"likGRF" and "variomodel".
The function summary.likGRF is used to print a summary
of the fitted model.
The object is a list with the following components:fix.nugget = FALSE otherwise, a fixed
value."matern",
"powered.exponential", "cauchy"
or "gneiting.matern".fix.lambda = TRUE otherwise the estimate value."ML" (maximum likelihood)
or "REML" (restricted maximum likelihood).likfit. Two particular cases are $\lambda = 1$
which indicates no transformation and $\lambda = 0$
indicating the log-transformation.
In general parameter estimation is performed numerically using the Rfunction optim to minimise the
negative log-likelihood computed by the function negloglik.GRF.
If the nugget, anisotropy ($\psi_A, \psi_R$),
smoothness ($\kappa$) and transformation ($\lambda$) parameters
are held fixed then the numerical minimisation can be reduced to
one-dimension and the function optimize is used instead
of optim. In this case initial values are irrelevant.
Lower and upper limits for parameter values can be
individually specified using the function link{pars.limits}.
For example, including the following in the function call:
limits = pars.limits(phi=c(0, 10), lambda=c(-2.5, 2.5)),
will change the limits for the parameters $\phi$ and $\lambda$.
Default values are used if the argument limits is not provided.
If the fix.lambda = FALSE and nospatial = FALSE the
Box-Cox parameter for the model without the spatial component is
obtained numerically, with log-likelihood computed by the function
boxcox.ns.
Multiple initial values can be specified providing a $n
\time 2$ matrix for the argument ini.cov.pars and/or
providing a vector for the values of the remaining model parameters.
In this case the log-likelihood is computed for all combinations of
the model parameters. The parameter set which maximises the
value of the log-likelihood is then used to start the
minimisation algorithm.
The argument realisations allows replicated data to be used.
For instance, data collected at different times at least partially
the same locations
can be pooled together in the parameter estimation if independence is
assumed between time points.
The argument realisations takes a vector indicating the
replication number (e.g. the times). The log-likelihoods are computed
for each replication and added together.
Notice that this assumes independence among the replications.
summary.likGRF for summary of the results,
plot.variogram, lines.variogram and
lines.variomodel for graphical output,
proflik for computing profile likelihoods,
variofit and for other estimation methods,
and optim for the numerical minimisation function.data(s100)
ml <- likfit(s100, ini=c(0.5, 0.5), fix.nug = TRUE)
ml
summary(ml)
reml <- likfit(s100, ini=c(0.5, 0.5), fix.nug = TRUE, met = "REML")
summary(reml)
plot(variog(s100))
lines(ml)
lines(reml, lty = 2)Run the code above in your browser using DataLab