mergeINLA {bigDM}R Documentation

Merge inla objects for partition models

Description

The function takes local models fitted for each subregion of the whole spatial domain and unifies them into a single inla object. This function is valid for both disjoint and k-order neighbourhood models.

Usage

mergeINLA(
  inla.models = list(),
  k = NULL,
  ID.area = "Area",
  ID.year = NULL,
  ID.disease = NULL,
  O = "O",
  E = "E",
  merge.strategy = "original",
  compute.DIC = TRUE,
  n.sample = 1000,
  compute.fitted.values = FALSE
)

Arguments

inla.models

list of multiple objects of class inla.

k

numeric value with the neighbourhood order used for the partition model. If k=0 the Disjoint model is considered.

ID.area

character; name of the variable that contains the IDs of spatial areal units. Default to "Area".

ID.year

character; name of the variable that contains the IDs of time points. Default to "NULL" (for spatial models).

ID.disease

character; name of the variable that contains the IDs of the diseases. Default to "NULL" (only required for multivariate models).

O

character; name of the variable that contains the observed number of disease cases for each areal units. Default to "O".

E

character; name of the variable that contains either the expected number of disease cases or the population at risk for each areal unit. Default to "E".

merge.strategy

one of either "mixture" or "original" (default), which specifies the merging strategy to compute posterior marginal estimates of the linear predictor (log-risks or log-rates).

compute.DIC

logical value; if TRUE (default) then approximate values of the Deviance Information Criterion (DIC) and Watanabe-Akaike Information Criterion (WAIC) are computed.

n.sample

numeric; number of samples to generate from the posterior marginal distribution of the linear predictor when computing approximate DIC/WAIC values. Default to 1000.

compute.fitted.values

logical value (default FALSE); if TRUE transforms the posterior marginal distribution of the linear predictor to the exponential scale (risks or rates). CAUTION: This method might be time consuming.

Details

If the disjoint model is fitted (k=0 argument), the log-risk surface is just the union of the posterior estimates of each submodel.

If the k-order neighbourhood model is fitted (k>0 argument), note that the final log-risk surface \log{\bf r}=(\log{r_1},\ldots,\log{r_{nT}})^{'} is no longer the union of the posterior estimates obtained from each submodel. Since multiple log-risk estimates can be obtained for some areal-time units from the different local submodel, their posterior estimates must be properly combined to obtain a single posterior distribution for each \log{r_{it}}. Two different merging strategies could be considered. If the merge.strategy="mixture" argument is specified, mixture distributions of the estimated posterior probability density functions with weights proportional to the conditional predictive ordinates (CPO) are computed. If the merge.strategy="original" argument is specified (default option), the posterior marginal estimate ot the areal-unit corresponding to the original submodel is selected.

See Orozco-Acosta et al. (2021) and Orozco-Acosta et al. (2023) for more details.

Value

This function returns an object of class inla containing the following elements:

summary.fixed

A data.frame containing the mean, standard deviation, quantiles and mode of the model's fixed effects.

marginals.fixed

A list containing the posterior marginal density of the model's fixed effects.

summary.fixed.partition

A data.frame containing the mean, standard deviation, quantiles and mode of the model's fixed effects in each partition.

marginals.fixed.partition

A list containing the posterior marginal density of the model's fixed effects in each partition.

summary.random

If k=0 a list with a data.frame containing the mean, standard deviation, quantiles and mode of the model's random effects.

marginals.random

If k=0 a list containing the posterior marginal densities of the model's random effects.

summary.linear.predictor

If k=0 a data.frame containing the mean, standard deviation, quantiles and mode of the log-risks (or log-rates) in the model.

marginals.linear.predictor

If k=0 a list containing the posterior marginal densities of the log-risks (or log-rates) in the model.

summary.fitted.values

A data.frame containing the mean, standard deviation, quantiles, mode and cdf of the risks (or rates) in the model. Available only if compute.fitted.values=TRUE.

marginals.fitted.values

A list containing the posterior marginal densities of the risks (or rates) in the model. Available only if compute.fitted.values=TRUE.

summary.cor

A data.frame containing the mean, standard deviation, quantiles and mode of the between-disease correlation coefficients. Only for the multivariate spatial models fitted using the MCAR_INLA function.

marginals.cor

A list containing the posterior marginal densities of the between-disease correlation coefficients. Only for the multivariate spatial models fitted using the MCAR_INLA function.

summary.cor.partition

A data.frame containing the mean, standard deviation, quantiles and mode of the between-disease correlation coefficients in each partition. Only for the multivariate spatial models fitted using the MCAR_INLA function.

marginals.cor.partition

A list containing the posterior marginal densities of the between-disease correlation coefficients in each partition. Only for the multivariate spatial models fitted using the MCAR_INLA function.

summary.var

A data.frame containing the mean, standard deviation, quantiles and mode of the within-disease variances for each disease. Only for the multivariate spatial models fitted using the MCAR_INLA function.

marginals.var

A list containing the posterior marginal densities of the within-disease variances for each disease. Only for the multivariate spatial models fitted using the MCAR_INLA function.

summary.var.partition

A data.frame containing the mean, standard deviation, quantiles and mode of the within-disease variances in each partition. Only for the multivariate spatial models fitted using the MCAR_INLA function.

marginals.var.partition

A list containing the posterior marginal densities of the within-disease variances in each partition. Only for the multivariate spatial models fitted using the MCAR_INLA function.

logfile

A list of the log files of each submodel.

version

A list containing information about the R-INLA version.

cpu.used

The sum of cpu times used by the inla function for each submodel (Pre, Running and Post), and the cpu time of the merging process Merging.

Examples

## See the vignettes accompanying this package for an example of its use.


[Package bigDM version 0.5.3 Index]