Min. 1st Qu. Median Mean 3rd Qu. Max.
0.3835 1.4173 1.8828 1.9337 2.4005 3.6208
模型的 LOO 值
loo(scot_fit_icar)
Warning: Found 21 observations with a pareto_k > 0.7 in model 'scot_fit_icar'.
We recommend to set 'moment_match = TRUE' in order to perform moment matching
for problematic observations.
Computed from 4000 by 56 log-likelihood matrix.
Estimate SE
elpd_loo -152.8 5.5
p_loo 26.2 2.4
looic 305.6 11.1
------
MCSE of elpd_loo is NA.
MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 1.4]).
Pareto k diagnostic values:
Count Pct. Min. ESS
(-Inf, 0.7] (good) 35 62.5% 184
(0.7, 1] (bad) 19 33.9% <NA>
(1, Inf) (very bad) 2 3.6% <NA>
See help('pareto-k-diagnostic') for details.
# 拟合模型scot_fit_bym2 <-brm( Observed ~offset(log(Expected)) + pcaff2 +car(W, gr = SP_ID, type ="bym2"),data = scotlips, data2 =list(W = W), family =poisson(link ="log"),refresh =0, seed =20232023)# 输出结果summary(scot_fit_bym2)
Family: poisson
Links: mu = log
Formula: Observed ~ offset(log(Expected)) + pcaff2 + car(W, gr = SP_ID, type = "bym2")
Data: scotlips (Number of observations: 56)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Correlation Structures:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
rhocar 0.80 0.16 0.42 0.99 1.00 847 1621
sdcar 0.52 0.08 0.38 0.70 1.00 1205 1965
Regression Coefficients:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.22 0.13 -0.48 0.04 1.00 2120 2475
pcaff2 0.37 0.14 0.08 0.64 1.00 1950 2885
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
rhocar 表示 CAR 先验中的参数 \(\rho\)
sdcar 表示 CAR 先验中的参数 \(\sigma\)
loo(scot_fit_bym2)
Warning: Found 23 observations with a pareto_k > 0.7 in model 'scot_fit_bym2'.
We recommend to set 'moment_match = TRUE' in order to perform moment matching
for problematic observations.
Computed from 4000 by 56 log-likelihood matrix.
Estimate SE
elpd_loo -153.1 5.4
p_loo 26.9 2.5
looic 306.1 10.7
------
MCSE of elpd_loo is NA.
MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 1.9]).
Pareto k diagnostic values:
Count Pct. Min. ESS
(-Inf, 0.7] (good) 33 58.9% 202
(0.7, 1] (bad) 22 39.3% <NA>
(1, Inf) (very bad) 1 1.8% <NA>
See help('pareto-k-diagnostic') for details.
library(spData)library(spdep)# KNN K-近邻方法获取邻接矩阵k4.48<-knn2nb(knearneigh(as.matrix(centers48), k =4))# Moran I testmoran.test(x = arrests48$Assault, listw =nb2listw(k4.48))
Moran I test under randomisation
data: arrests48$Assault
weights: nb2listw(k4.48)
Moran I statistic standard deviate = 3.4216, p-value = 0.0003113
alternative hypothesis: greater
sample estimates:
Moran I statistic Expectation Variance
0.294385644 -0.021276596 0.008511253
# Permutation test for Moran's I statisticmoran.mc(x = arrests48$Assault, listw =nb2listw(k4.48), nsim =499)
Monte-Carlo simulation of Moran I
data: arrests48$Assault
weights: nb2listw(k4.48)
number of simulations + 1: 500
statistic = 0.29439, observed rank = 499, p-value = 0.002
alternative hypothesis: greater
Blangiardo, Marta, Michela Cameletti, Gianluca Baio, 和 Håvard Rue. 2013. 《Spatial and spatio-temporal models with R-INLA》. Spatial and Spatio-temporal Epidemiology 7 (十二月): 39–55. https://doi.org/10.1016/j.sste.2013.07.003.
Cabral, Rafael, David Bolin, 和 Håvard Rue. 2022. 《Controlling the Flexibility of Non-Gaussian Processes Through Shrinkage Priors》. Bayesian Analysis -1 (-1): 1–24. https://doi.org/10.1214/22-BA1342.
Donegan, Connor. 2022. 《geostan: An R package for Bayesian spatialanalysis》. Journal of Open Source Software 7 (79): 4716. https://doi.org/10.21105/joss.04716.
Moraga, Paula. 2020. Geospatial health data: modeling and visualization with R-INLA and Shiny. Boca Raton, Florida: Chapman; Hall/CRC. https://www.paulamoraga.com/book-geospatial/.
Morris, Mitzi, Katherine Wheeler-Martin, Dan Simpson, Stephen J. Mooney, Andrew Gelman, 和 Charles DiMaggio. 2019. 《Bayesian hierarchical spatial models: Implementing the Besag York Mollié model in stan》. Spatial and Spatio-temporal Epidemiology 31 (十一月): 100301. https://doi.org/10.1016/j.sste.2019.100301.
Tobler, Waldo. 1970. 《A computer movie simulating urban growth in the Detroit region》. Economic Geography 46 (Supplement): 234–40. https://doi.org/10.2307/143141.