Learn R Programming

trafficCAR (version 0.1.0)

sample_icar: Sample ICAR random effects with component-wise sum-to-zero constraints

Description

Sample ICAR random effects with component-wise sum-to-zero constraints

Usage

sample_icar(
  A,
  tau = 1,
  kappa = 1e+06,
  isolate = c("independent", "drop"),
  isolate_prec = NULL
)

Value

Numeric vector of length nrow(A).

Arguments

A

Sparse adjacency matrix (dgCMatrix preferred).

tau

Positive precision multiplier.

kappa

Large penalty enforcing sum-to-zero (default 1e6).

isolate

How to handle isolated nodes: "independent" or "drop".

isolate_prec

Precision for isolated nodes if kept independent.