Skip to contents

Create ICAR precision matrix from nb.

Usage

nb_to_precision(nb, W = NULL, return_sparse = FALSE, scale_precision = FALSE)

Arguments

nb

A neighbourhood list object.

W

A length(nb) by length(nb) symmetric weights matrix with zeros for non-neighbouring areas.

return_sparse

Should the matrix returned be of class sparseMatrix?

scale_precision

Should the matrix returned be scaled using scale_gmrf_precision?

Examples

nb <- sf_to_nb(mw)
#> Error in .class1(object): object 'mw' not found
nb_to_precision(nb)
#> Error in nb_to_precision(nb): object 'nb' not found