Learn R Programming

geoRglm (version 0.9-16)

prepare.likfit.glsm: Prepare for Monte Carlo MLE

Description

This function takes an output object from glsm.mcmc, and the corresponding data object of class geodata, and prepares the variables needed for the Monte Carlo maximum likelihood function likfit.glsm.

Usage

prepare.likfit.glsm(mcmc.output, use.intensity = FALSE)

Arguments

mcmc.output

an output file from the function glsm.mcmc.

use.intensity

logical. If use.intensity = TRUE then the integration variable in the Monte Carlo approximation will not be \(S\) but the intensity \(g_{\lambda}^{-1}(S)\). The latter makes it possible to use other link functions in likfit.glsm than the one used in mcmc.output. Default is use.intensity = FALSE.

Value

An object containing the sample and the approximating density to be used in likfit.glsm.

See Also

likfit.glsm for how to use the output from this function, and glsm.mcmc for generating the object mcmc.output.

Examples

Run this code
# NOT RUN {
data(p50)
mcmc.4 <- mcmc.control(S.scale = 0.000035, n.iter = 1000)
kr4 <- list(family="poisson", cov.pars=c(1,1), beta=0)
condsim.4 <- glsm.mcmc(p50, mcmc.input = mcmc.4, model = kr4)     
mcmcobj.4 <- prepare.likfit.glsm(condsim.4)   
lik.4 <- likfit.glsm(mcmcobj.4, ini.phi = 10, fix.nugget.rel = TRUE) 
lik.4.spherical.nugget <- likfit.glsm(mcmcobj.4, ini.phi = 5.59, 
                              cov.model = "spherical", nugget.rel = 0.385)
# }

Run the code above in your browser using DataLab