library(spdep)
library(gamlss)
data(oldcol)
# Create spatial weight matrices W1 and W2
W1 <- spdep::nb2mat(COL.nb, style = "W")
W2 <- W1 # In this case, assume the same spatial weights for both
# Fit a SARARgamlss model
result <- SARARgamlss(formula = CRIME ~ INC + cs(HOVAL),
sigma.formula = ~ INC + pb(HOVAL), W1 = W1, W2 = W2,data = COL.OLD,
tol = 1E-4, maxiter = 20, type = "SARAR")
summary_SAR(result)
gamlss::term.plot(result$gamlss, what="mu")
Run the code above in your browser using DataLab