profilelogLik {georob} | R Documentation |
Profile Likelihood
Description
The function profilelogLik
computes for an array of fixed
variogram parameters the profile log-likelihood by maximizing the
(restricted) log-likelihood with respect to the remaining variogram
parameters, the fixed and random effects.
Usage
profilelogLik(object, values, use.fitted = TRUE, verbose = 0,
ncores = min(parallel::detectCores(), NROW(values)))
Arguments
object |
an object of class |
values |
a |
use.fitted |
a logical scalar controlling whether the fitted variogram
parameters of |
verbose |
a positive integer controlling logging of diagnostic
messages to the console during model fitting, see |
ncores |
a positive integer controlling how many cores are used for parallelized computations, see Details. |
Details
For robust REML fits profilelogLik
returns (possibly with a
warning) the log-likelihood of the Gaussian (RE)ML fit of the equivalent
Gaussian spatial linear model with heteroscedastic nugget.
Note that the data frame passed as data
argument to georob
must exist in the user workspace
when calling profilelogLik
.
profilelogLik
uses the packages parallel and
snowfall for parallelized computation of the profile
likelihood. By default, the function uses NROW(values)
CPUs but
not more than are physically available (as returned by
detectCores
).
profilelogLik
uses the function update
to
re-estimated the model with partly fixed variogram parameters.
Therefore, any argument accepted by georob
except
data
can be changed when re-fitting the model. Some of them (e.g.
verbose
) are explicit arguments of
profilelogLik
, but also the remaining ones can be passed by
...
to the function.
Value
A data.frame
with the columns of values
, a column
loglik
(contains the maximized [restricted] log-likelihood),
columns with the estimated variogram and fixed effect parameters, columns
with the gradient of the (restricted) log-likelihood (or the roots of the
estimating equations) and a column converged
, indicating whether
convergence has occurred when fitting the respective model.
Author(s)
Andreas Papritz papritz@retired.ethz.ch.
See Also
georobPackage
for a description of the model and a brief summary of the algorithms;
georob
for (robust) fitting of spatial linear models;
georobObject
for a description of the class georob
;
plot.georob
for display of RE(ML) variogram estimates;
control.georob
for controlling the behaviour of georob
;
georobModelBuilding
for stepwise building models of class georob
;
cv.georob
for assessing the goodness of a fit by georob
;
georobMethods
for further methods for the class georob
;
predict.georob
for computing robust Kriging predictions;
lgnpp
for unbiased back-transformation of Kriging prediction
of log-transformed data;
georobSimulation
for simulating realizations of a Gaussian process
from model fitted by georob
; and finally
sample.variogram
and fit.variogram.model
for robust estimation and modelling of sample variograms.
Examples
## define number of cores for parallel computations
if(interactive()) ncpu <- 2L else ncpu <- 1L
data(meuse)
r.logzn.ml <- georob(log(zinc)~sqrt(dist), data=meuse, locations=~x+y,
variogram.model="RMexp", param=c(variance=0.15, nugget=0.05, scale=200),
tuning.psi=1000, control=control.georob(ml.method="ML"))
if(interactive()){
## example is run only in interactive session because cpu times exceeds 5 s
r.prflik <- profilelogLik(r.logzn.ml, values=expand.grid(scale=seq(75, 600, by=25)),
ncores = ncpu)
plot(loglik~scale, r.prflik, type="l")
abline(v=r.logzn.ml$variogram.object[[1]]$param["scale"], lty="dotted")
abline(h=r.logzn.ml$loglik-0.5*qchisq(0.95, 1), lty="dotted")
}