SpatialGlmmFit: maximises the Laplace approximation of the GLMM
marginal likelihood (Newton for the latent mode, L-BFGS-B for
\(\beta\), \(\log\sigma\) and \(\log\) range) with iid group
intercepts (as lme4::glmer with nAGQ = 1) or a spatial field
(Exp, Gau, Sph); returns the Gaussian approximation
of the latent posterior (mode, sd, covariance). SpatialGlmmPredict:
kriging of the latent mode and variance, response mean by the lognormal
formula (Poisson) or 20-point Gauss-Hermite (binomial).
GlmmResiduals: Pearson, deviance and randomised quantile residuals.
CrpsGaussian, CrpsPoisson, CrpsSample: continuous
ranked probability scores. Identical to the Python arm
morie.fn.sglmm.
Usage
SpatialGlmmFit(
y,
X,
family = "poisson",
coords = NULL,
groups = NULL,
model = "Exp",
trials = NULL,
start = NULL
)
SpatialGlmmPredict(fit, X0, coords0)
GlmmResiduals(y, mu, family = "poisson", trials = 1, size = NULL, seed = 1)
CrpsGaussian(y, mu, sigma)
CrpsPoisson(y, lam)
CrpsSample(y, samples)Arguments
- y
Responses.
- X
Design matrix.
- family
"poisson"or"binomial"(residuals also"negbin").- coords, groups
Spatial coordinates or grouping factor.
- model
Spatial correlation model.
- trials
Binomial trials.
- start
Starting parameters.
- fit
A
SpatialGlmmFitresult withcoords.- X0, coords0
Prediction design and coordinates.
- mu
Fitted means (probabilities for binomial).
- size
Negative binomial size.
- seed
Philox seed.
- sigma, lam, samples
Predictive parameters or samples.
References
Breslow, N. E. and Clayton, D. G. (1993). Approximate inference in generalized linear mixed models. JASA 88, 9-25.
Dunn, P. K. and Smyth, G. K. (1996). Randomized quantile residuals. JCGS 5, 236-244.
Gneiting, T. and Raftery, A. E. (2007). Strictly proper scoring rules, prediction, and estimation. JASA 102, 359-378.
