Learn R Programming

geoRglm (version 0.9-16)

proflik.glsm: Computes Profile Likelihood for generalised linear spatial models

Description

Computes two dimenaional profile likelihood for the parameters (phi, nugget.rel) for a model previously derived using the function likfit.glsm.

Usage

proflik.glsm(mcmc.obj, obj.likfit.glsm, phi.values, nugget.rel.values,
             messages, …)

Arguments

mcmc.obj

object with the Monte Carlo simulations and corresponding approximating density. This object should be an output from the function prepare.likfit.glsm.

obj.likfit.glsm

Output file from likfit.glsm.

phi.values

set of values of the parameter phi for which the profile likelihood will be computed.

nugget.rel.values

set of values of the relative nugget parameter for which the profile likelihood will be computed. Only used if obj.likfit.glsm was created with the option fix.nugget = FALSE.

messages

logical. Indicates whether messages should be printed on the screen (or output device) while the function is running. Note that for this function additional messages can be obtained by setting the global option verbose=TRUE

additional parameters to be passed to the maximization function. Typically arguments of the type control() which controls the behavior of the minimization algorithm. For further details, see the documentation for the minimization function optim.

Value

An object of the class `"proflik"' which is a list. The element contains values of the pair of parameters and the corresponding value of the profile likelihood.

See Also

likfit.glsm for the parameter estimation, and proflik for the profile likelihood in the Gaussian spatial model.

Examples

Run this code
# NOT RUN {
data(p50)
# }
# NOT RUN {
mcmc.5 <- mcmc.control(S.scale = 0.6, thin=20, n.iter=50000, burn.in=1000)
model.5 <- list(cov.pars=c(0.6, 0.1), beta=1, family="poisson")
outmcmc.5 <- glsm.mcmc(p50, model= model.5, mcmc.input = mcmc.5)     
mcmcobj.5 <- prepare.likfit.glsm(outmcmc.5)   
lik.5.sph.nugget <- likfit.glsm(mcmcobj.5, ini.phi = 1, 
             cov.model = "spherical", nugget.rel = 0.385)
pr.lik.5.sph.nugget <- proflik.glsm(mcmcobj.5, lik.5.sph.nugget,
         phi.values = seq(0.5,5,l=10), nugget.rel.values=seq(0.5,5,l=10))
plot(pr.lik.5.sph.nugget)
# }

Run the code above in your browser using DataLab