Skip to contents

Implements the same thing as INLA::inla.scale.model.

Usage

scale_gmrf_precision(Q, A = matrix(1, 1, nrow(Q)))

Source

From code by Jeff Eaton.

Arguments

Q

A (square, symmetric) precision matrix.

A

See get_scale.

Value

A list containing a rescaled (see "A note on intrinsic conditional autoregressive models for disconnected graphs" Freni-Sterrantino, Ventrucci and Rue) matrix Q, and scales containing the of the scale used for each connected component.

Examples

nb <- sf_to_nb(mw)
#> Error in .class1(object): object 'mw' not found
Q <- nb_to_precision(nb)
#> Error in nb_to_precision(nb): object 'nb' not found
scale_gmrf_precision(Q)
#> Error in spdep::mat2listw(mat): object 'Q' not found