alik_inla: Log-likelihood approximation

alik_inlaR Documentation

Log-likelihood approximation

Description

Log-likelihood approximation.

Usage

alik_inla(
  par_vals,
  formula,
  family = "gaussian",
  data,
  weights,
  subset,
  offset,
  atsample,
  corrfcn = "matern",
  np,
  betm0,
  betQ0,
  ssqdf,
  ssqsc,
  tsqdf,
  tsqsc,
  dispersion = 1,
  longlat = FALSE
)

Arguments

par_vals

A data frame with the components "linkp", "phi", "omg", "kappa". The approximation will be computed at each row of the data frame.

formula

A representation of the model in the form response ~ terms.

family

The distribution of the response. Can be one of the options in .geoBayes_models or "transformed.gaussian".

data

An optional data frame containing the variables in the model.

weights

An optional vector of weights. Number of replicated samples for Gaussian and gamma, number of trials for binomial, time length for Poisson.

subset

An optional vector specifying a subset of observations to be used in the fitting process.

offset

See lm.

atsample

A formula in the form ~ x1 + x2 + ... + xd with the coordinates of the sampled locations.

corrfcn

Spatial correlation function. Can be one of the choices in .geoBayes_corrfcn.

np

The number of integration points for the spatial variance parameter sigma^2. The total number of points will be 2*np + 1.

betm0

Prior mean for beta (a vector or scalar).

betQ0

Prior standardised precision (inverse variance) matrix. Can be a scalar, vector or matrix. The first two imply a diagonal with those elements. Set this to 0 to indicate a flat improper prior.

ssqdf

Degrees of freedom for the scaled inverse chi-square prior for the partial sill parameter.

ssqsc

Scale for the scaled inverse chi-square prior for the partial sill parameter.

tsqdf

Degrees of freedom for the scaled inverse chi-square prior for the measurement error parameter.

tsqsc

Scale for the scaled inverse chi-square prior for the measurement error parameter.

dispersion

The fixed dispersion parameter.

longlat

How to compute the distance between locations. If FALSE, Euclidean distance, if TRUE Great Circle distance. See spDists.

Details

Computes and approximation to the log-likelihood for the given parameters using integrated nested Laplace approximations.

Value

A list with components

  • par_vals A data frame of the parameter values.

  • aloglik The approximate log-likelihood at thos parameter values.

References

Evangelou, E., & Roy, V. (2019). Estimation and prediction for spatial generalized linear mixed models with parametric links via reparameterized importance sampling. Spatial Statistics, 29, 289-315.


geoBayes documentation built on Aug. 21, 2023, 9:08 a.m.

Related to alik_inla in geoBayes...