.\" -*- nroff -*- generated from .Rd format
.BG
.FN proflik
.TL
Computes profile likelihoods
.DN
This function computes profile likelihoods for model parameters which
should be previously estimated using the function
`proflik'.
.CS

proflik(obj.likfit, geodata, coords = geodata$coords,
        data = geodata$data, sill.values, range.values,
        nugget.values, nugget.rel.values, lambda.values, 
        sillrange.values = TRUE, sillnugget.values = TRUE,
        rangenugget.values = TRUE, sillnugget.rel.values = FALSE,
        rangenugget.rel.values = FALSE, silllambda.values = FALSE,
        rangelambda.values = TRUE,  nuggetlambda.values = FALSE,
        nugget.rellambda.values = FALSE,
        uni.only = TRUE, bi.only = FALSE, ...)

.RA
.AG obj.likfit
an object with the output from the function `likfit'.
.AG geodata
a list containing elements `coords' and
`$data' described below. If not provided the arguments
`coords' and `data' must be provided instead.
.AG coords
an n x 2 matrix containing in each row Euclidean
coordinates of the n data locations. By default it takes the
element `$coords' of the argument `geodata'.
.AG data
a vector with data values. By default it takes the
element `$data' of the argument `geodata'.
.AG sill.values
values of the sill parameter
sigma^2 for which the profile likelihood will be computed.
.AG range.values
values of the range parameter
phi for which the profile likelihood will be computed.
.AG nugget.values
values of the nugget parameter
tau^2 for which the profile likelihood will be
computed. Only to be used if the model was fitted using the function
`likfit' with the option `fix.nugget = FALSE'.
.AG nugget.rel.values
values of the relative nugget parameter
tauR^2 for which the profile likelihood will be
computed. Only to be used if the model was fitted using the function
`likfit' with the option `fix.nugget = FALSE'.
.AG lambda.values
values of the Box-Cox transformation parameter
lambda for which the profile likelihood will be
computed. Only to be used if the model was fitted using the function
`likfit' with the option `fix.lambda = FALSE'.
.AG sillrange.values
`TRUE' or `FALSE' indicating
whether or not the 2-D profile likelihood should be computed.
Only used if `uni.only = FALSE'.
.AG sillnugget.values
as above.
.AG rangenugget.values
as above.
.AG sillnugget.rel.values
as above.
.AG rangenugget.rel.values
as above.
.AG silllambda.values
as above.
.AG rangelambda.values
as above.
.AG nuggetlambda.values
as above.
.AG nugget.rellambda.values
as above.
.AG uni.only
as above.
.AG bi.only
as above.
.AG \&...
additional parameters to be passed to `nlminb'.
.RT
A list where each element contains values of a parameter (or a pair of
parameters for 2-D profiles) and the
corresponding value of the profile likelihood.
The elements present in the output will obviously follow the
parameters set in the function arguments.
.IP "" 
The output is used by the function `plot.proflik' to
automatically plot the profile likelihoods.
Note

.in +


.ti -\w@*\ @u
* profiles are usually uni-modal. "Funny" shapes (ups and downs) can
be due to the lack of the convergence for a particular parameter.
It might be necessary to pass `control' arguments 
to `nlminb' using the argument \&... .
.IP "" 

.ti -\w@*\ @u
* 2-D profiles can be computed by setting the argument
`uni.only = FALSE'. However be sure that you really want to
compute the 2-D profiles
since the computation is performed on a grid determined by the
cross product of
the values in the 1-D profiles. Therefore, this can be VERY
time demanding.
.IP "" 

.ti -\w@*\ @u
* There is no "default" way to find reasonable values for the
x-axis.
They must be found in a "try-and-error" exercise. It's recommended
to use short sequences in the initial attempts. See example below.
.IP "" 

.in -
.SH REFERENCES
Further information about `geoR/geoS' can be found at:
.br
<URL: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html>
.SA
`plot.proflik', `likfit',
`optim', `nlm'.
.EX
data(s100)  # only when using R (not necessary with S-PLUS)
ml <- likfit(s100, ini=c(\&.5, .5), fix.nug=T)
# a first atempt to find reasonable values for the x-axis:
prof <- proflik(ml, s100, sill.values=seq(0.5, 1.5, l=4),
                range.val=seq(0.1, .5, l=4))
par(mfrow=c(1,2))
plot(prof)
# a nicer setting and now including 2-D profiles:

prof <- proflik(ml, s100, sill.values=seq(0.45, 2, l=16),
                range.val=seq(0.1, .55, l=16), uni.only=F)
par(mfrow=c(2,2))
plot(prof, nlevels=16)

par(mfrow=c(1,1))

.KW spatial
.WR
