Compute scale of a precision matrix using R-INLA.
get_scale.RdTakes the riebler_gv of the generalised inverse, as implemented by INLA::inla.qinv.
By default it is assumed that the graph is fully connected.
Arguments
- Q
A (square, symmetric) precision matrix.
- constraint
A list with arguments
Aandewhich imposes the constraintAu = e(where the precision ofuisQ). See the?INLA::fargumentextraconstr. Ifconstraintis the default value then this is a sum-to-zero constraint.
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
get_scale(Q)
#> Error in nrow(Q): object 'Q' not found