proflik {geoR} | R Documentation |
Computes profile likelihoods for model parameters
previously estimated using the function
likfit
.
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, messages, ...)
obj.likfit |
an object of the class likfit , typically an
output of the function likfit . |
geodata |
a list containing elements coords and
data described next. Typically an object of the class
"geodata" - a geoR data-set. If not provided the arguments
coords and data must be provided instead. |
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 . |
data |
a vector with data values. By default it takes the
element data of the argument geodata . |
sill.values |
set of values of the partial sill parameter sigma^2 for which the profile likelihood will be computed. |
range.values |
set of values of the range parameter phi for which the profile likelihood will be computed. |
nugget.values |
set of values of the nugget parameter
tau^2 for which the profile likelihood will be
computed. Only used if the model was fitted using the function
likfit with the option fix.nugget = FALSE . |
nugget.rel.values |
set of values of the relative nugget parameter
tauR^2 for which the profile likelihood will be
computed. Only used if the model was fitted using the function
likfit with the option fix.nugget = FALSE . |
lambda.values |
set of 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 . |
sillrange.values |
logical indicating
whether or not the 2-D profile likelihood should be computed.
Only valid if uni.only = FALSE . |
sillnugget.values |
as above. |
rangenugget.values |
as above. |
sillnugget.rel.values |
as above. |
rangenugget.rel.values |
as above. |
silllambda.values |
as above. |
rangelambda.values |
as above. |
nuggetlambda.values |
as above. |
nugget.rellambda.values |
as above. |
uni.only |
as above. |
bi.only |
as above. |
messages |
logical. Indicates whether status messages should be printed on the screen (i.e. current output device) while the function is running. |
... |
additional parameters to be passed to the minimization function. |
The functions .proflik.*
are auxiliary functions used to
compute the profile likelihoods. These functions are
internally called by the
minimization functions when estimating the model parameters.
An object of the class "proflik"
which is
a list. 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 components of the output will vary according to the
input options.
control
arguments
to the minimization functions using the argument ....
It's also advisable to try the different options for the
minimisation.function
argument.
See documentation of the functions optim
and/or
nlm
for further details.
uni.only = FALSE
. However, before computing 2-D profiles be
sure they are really necessary.
Their computation can be time demanding since it
is performed on a grid determined by the
cross-product of the values defining the 1-D profiles.
EXAMPLE
section below illustrates this.
Paulo Justiniano Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR.
plot.proflik
for graphical output,
likfit
for the parameter estimation,
optim
and nlm
for further details about
the minimization functions.
op <- par(no.readonly=TRUE) ml <- likfit(s100, ini=c(.5, .5), fix.nug=TRUE) ## 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 ## Not run: prof <- proflik(ml, s100, sill.values=seq(0.45, 2, l=11), range.val=seq(0.1, .55, l=11)) plot(prof) ## to include 2-D profiles use: ## (commented because this is time demanding) #prof <- proflik(ml, s100, sill.values=seq(0.45, 2, l=11), # range.val=seq(0.1, .55, l=11), uni.only=FALSE) #par(mfrow=c(2,2)) #plot(prof, nlevels=16) ## End(Not run) par(op)