This function performs Monte Carlo maximum likelihood in a generalised linear spatial model, based on a Monte Carlo sample from the conditional distribution.
likfit.glsm(mcmc.obj, trend = mcmc.obj$trend, cov.model = "matern",
kappa = 0.5, ini.phi, fix.nugget.rel = FALSE, nugget.rel = 0,
aniso.pars = NULL, fix.lambda = TRUE, lambda = NULL,
limits = pars.limits(), messages, …)
object with the Monte Carlo simulations and corresponding approximating density.
This object should be an output from the function
prepare.likfit.glsm
.
specifies the covariate values at the data
locations.
See documentation of trend.spatial
for
further details. Default is that the trend is the same as in the
mcmc.obj
object.
a string specifying the model for the correlation
function. For further details see documentation for cov.spatial
.
additional smoothness parameter required by the following correlation
functions: "matern"
, "powered.exponential"
, "gneiting.matern"
and "cauchy"
.
initial value for the covariance parameter \(\phi\).
logical, saying whether the parameter
\(\tau_R^2\) (relative nugget) should be regarded as fixed
(fix.nugget.rel = TRUE
) or should be
estimated (fix.nugget.rel = FALSE
). Default is fix.nugget.rel = FALSE
.
value of the relative nugget parameter.
Regarded as a fixed value if fix.nugget.rel = TRUE
, otherwise
as the initial value for the maximization algorithm. Default is nugget.rel = 0
.
parameters for geometric anisotropy
correction. If aniso.pars = NULL
the correction will be the same as for the generated sample in mcmc.obj
.
Otherwise
a two elements vector with values for the anisotropy parameters
must be provided. Anisotropy correction consists of a
transformation of the data and prediction coordinates performed
by the function coords.aniso
.
logical, indicating whether the Box-Cox transformation parameter
\(\lambda\) should be regarded as fixed
(fix.lambda = TRUE
) or should be be estimated (fix.lambda = FALSE
). Default is fix.lambda = TRUE
.
value of parameter \(\lambda\) in the Box-Cox class of link functions.
Regarded as a fixed value if fix.lambda = TRUE
, otherwise as the initial value for the
minimization algorithm. Default is lambda = NULL
, in which case the used link function will be the same as for the
generated sample in mcmc.obj
.
values defining lower and upper limits for the model parameters used in the numerical minimization.
The auxiliary function pars.limits
is used to
set the limits.
logical. Indicates whether status messages should be printed on the screen (or output device) while the function is running.
additional parameters to be passed to the optimisation
function. Typically arguments of the type control()
which controls the
behavior of the optimization algorithm. For further details, see the documentation
for the minimization function optim
.
A list with the following components:
the error distribution (Poisson or Binomial).
the name of the link function.
a string with the name of the correlation function.
estimate of the parameter \(\beta\). This can be a scalar or vector depending on the covariates (trend) specified in the model.
a vector with the estimates of the parameters \(\sigma^2\) and \(\phi\), respectively.
value of the relative nugget parameter \(\tau_R^2\).
This is an estimate if fix.nugget.rel = FALSE
, and otherwise a given fixed value.
value of the smoothness parameter. Valid only when
the correlation function is one of: "matern"
,
"powered.exponential"
, "cauchy"
or "gneiting.matern"
.
values of the parameter for the Box-Cox class of link functions. A fixed value if
fix.lambda = TRUE
, otherwise the estimated value.
values of the anisotropy parameters used.
the trend
a data-frame with all model parameters, their status (estimated or fixed) and values.
the value of the maximized likelihood.
number of estimated parameters.
results returned by the minimisation function.
the function call.
This function estimates the parameters in the Poisson/Binomial normal model, using a Monte Carlo approximation to the likelihood. Further details can be found in Christensen (2004).
Parameter estimation is done numerically using the R function
optim
with box-constraints, i.e. method="L-BFGS-B"
.
Lower and upper limits for parameter values can be specified using the function pars.limits()
.
For example, including limits = pars.limits(phi=c(0.01, 10))
in the function call
will specify the limits for the parameter \(\phi\).
Default values are used if the argument limits
is not provided.
Only when the mcmc.obj
object contains an object mu
giving the intensity, is it possible to use other link
functions than the link function used for the generated sample in
mcmc.obj
We strongly recommend that the user does not
provide self-made input objects for mcmc.obj
, but only uses objects created by prepare.likfit.glsm
. In case the user
really wants to create his own objects, he should study the source code
very carefully to understand how it works.
Summary and print methods for summarising and printing the output also exist.
Christensen, O. F. (2004). Monte Carlo maximum likelihood in model-based geostatistics. Journal of computational and graphical statistics 13 702-718.
prepare.likfit.glsm
on how to prepare the object mcmc.obj
, glsm.mcmc
for
MCMC simulation in generalised linear spatial model, and summary.likGLSM
for
summarising the output. See also likfit
for
parameter estimation in the Gaussian spatial model.
# 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 <- likfit.glsm(mcmcobj.5, ini.phi = 0.1, fix.nugget.rel = TRUE)
print(lik.5)
summary(lik.5)
lik.5.sph.nugget <- likfit.glsm(mcmcobj.5, ini.phi = 1,
cov.model = "spherical", nugget.rel = 0.385)
print(lik.5.sph.nugget)
summary(lik.5.sph.nugget)
# }
Run the code above in your browser using DataLab