loglik.GRF | R Documentation |
This function computes the value of the log-likelihood for a Gaussian random field.
loglik.GRF(geodata, coords = geodata$coords, data = geodata$data,
obj.model = NULL, cov.model = "exp", cov.pars, nugget = 0,
kappa = 0.5, lambda = 1, psiR = 1, psiA = 0,
trend = "cte", method.lik = "ML", compute.dists = TRUE,
realisations = NULL)
geodata |
a list containing elements |
coords |
an |
data |
a vector with data values. By default it takes the
element |
obj.model |
a object of the class |
cov.model |
a string specifying the model for the correlation
function. For further details see
documentation for |
cov.pars |
a vector with 2 elements with values of the covariance parameters
|
nugget |
value of the nugget parameter. Defaults to |
kappa |
value of the smoothness parameter. Defaults to
|
lambda |
value of the Box-Cox tranformation parameter. Defaults
to |
psiR |
value of the anisotropy ratio parameter. Defaults to
|
psiA |
value (in radians) of the anisotropy rotation parameter. Defaults to zero. |
trend |
specifies the mean part of the model.
The options are:
|
method.lik |
options are |
compute.dists |
for internal use with other function. Don't change the default unless you know what you are doing. |
realisations |
optional. A vector indicating replication number
for each data. For more details see |
The expression log-likelihood is:
l(\theta) = -\frac{n}{2} \log (2\pi) - \frac{1}{2} \log |\Sigma|
- \frac{1}{2} (y -
F\beta)' \Sigma^{-1} (y - F\beta),
where n
is the size of the data vector y
, \beta
is the mean (vector) parameter with dimention p
, \Sigma
is the covariance
matrix and F
is the matrix with the values of the covariates (a
vector of 1
's if the mean is constant.
The expression restricted log-likelihood is:
rl(\theta) = -\frac{n-p}{2} \log (2\pi) + \frac{1}{2} \log |F' F|
- \frac{1}{2} \log |\Sigma| - \frac{1}{2} \log |F' \Sigma F| - \frac{1}{2} (y -
F\beta)' \Sigma^{-1} (y - F\beta).
The numerical value of the log-likelihood.
Paulo Justiniano Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.
likfit
for likelihood-based parameter estimation.
loglik.GRF(s100, cov.pars=c(0.8, .25), nugget=0.2)
loglik.GRF(s100, cov.pars=c(0.8, .25), nugget=0.2, met="RML")
## Computing the likelihood of a model fitted by ML
s100.ml <- likfit(s100, ini=c(1, .5))
s100.ml
s100.ml$loglik
loglik.GRF(s100, obj=s100.ml)
## Computing the likelihood of a variogram fitted model
s100.v <- variog(s100, max.dist=1)
s100.vf <- variofit(s100.v, ini=c(1, .5))
s100.vf
loglik.GRF(s100, obj=s100.vf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.