car_precision_mat: Generate a row-standardised CAR precision matrix

Description Usage Arguments Value

View source: R/cor_mat_generators.R

Description

Generate a row-standardised CAR precision matrix

Usage

1
2
3
4
5
6
7
car_precision_mat(
  nbs = banded_neighbours(2, 10),
  rho = 0.5,
  sigma = 1,
  standardised = TRUE,
  sparse = TRUE
)

Arguments

nbs

A list where nbs[[i]] is a vector with the neighbours of variable i. The functions banded_neighbours, lattice_neighbours, random_neighbours can be used to generate such lists of neighbours for banded, lattice and random adjacency structures.

rho

The parameter in the row-standardised CAR model.

sigma

The standard deviation of each variables. Defaults to 1.

standardised

A logical value for whether the output precision matrix should be stadnardised so that its inverse is a correlation matrix.

sparse

A logical value specifying whether the output should be a sparse matrix from the Matrix package (TRUE) or not (FALSE).

Value

A CAR precision matrix.


Tveten/capacc documentation built on Sept. 29, 2021, 5:31 a.m.