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 |

`k` |
numeric value with the neighbourhood order used for the partition model. If k=0 the |

`ID.area` |
character; name of the variable that contains the IDs of spatial areal units. Default to |

`ID.year` |
character; name of the variable that contains the IDs of time points. Default to |

`ID.disease` |
character; name of the variable that contains the IDs of the diseases. Default to |

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

`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 |

`merge.strategy` |
one of either |

`compute.DIC` |
logical value; if |

`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 |

### 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 and quantiles of the model's fixed effects. This feature is EXPERIMENTAL for the moment. |

`marginals.fixed` |
A list containing the posterior marginal density of the model's fixed effects. This feature is EXPERIMENTAL for the moment. |

`summary.fixed.partition` |
A data.frame containing the mean, standard deviation and quantiles 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 |

`marginals.random` |
If |

`summary.linear.predictor` |
If |

`marginals.linear.predictor` |
If |

`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 |

`marginals.fitted.values` |
A list containing the posterior marginal densities of the risks (or rates) in the model. Available only if |

`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 |

`marginals.cor` |
A list containing the posterior marginal densities of the between-disease correlation coefficients. Only for the multivariate spatial models fitted using the |

`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 |

`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 |

`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 |

`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 |

`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 |

`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 |

`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 |

### Examples

```
## See the vignettes accompanying this package ##
```

*bigDM*version 0.5.4 Index]