Learn R Programming

geoR (version 1.9-4)

proflik: Computes Profile Likelihoods

Description

Computes profile likelihoods for model parameters previously estimated using the function likfit.

Usage

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, ...)

Value

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.

Arguments

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 \times 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 \(\tau_{R}^{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.

Author

Paulo Justiniano Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.

Details

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.

References

Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.

See Also

plot.proflik for graphical output, likfit for the parameter estimation, optim and nlm for further details about the minimization functions.

Examples

Run this code
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 
if (FALSE) {
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)
}
par(op)

Run the code above in your browser using DataLab