MCMC algorithms generate Markov Chains which simulate the posterior distribution. The idea behind the Geweke diagnostic is to mimic a two-sample test of means and determine whether the first 10% and last 50% are of the same posterior distribution. If the chain has converged to a stationary distribution, the means of the two sections should be equal and the Geweke diagnostic approaches a normal distribution with a Z-score test statistic. The Geweke diagnostic plots are generated by dividing the chain into segments. The Z-scores are then calculated for the chain using all the iterations at first, then again for the iterations minus the first segment and then, minus the second segment and so on. If a large amount of the Z-scores fall outside the range \(\pm 1.96\), i.e. are extreme and fall within the tails of a standard normal distribution, the chain has not converged.
There are eight parameters that required estimation in the spatial SSO models, including three regression coefficients for the detection process and five coefficients for the occupancy process. For each the posterior distributions are summarized and the Rhat values inspected. Additionally, the trace plots are generated and Geweke diagnostic plots inspected.
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except the occupancy intercept (\(\beta_0\)) and average daily rainfall (\(\beta_2\)).
occ2007<-mcmc_nonspat[[1]]
# mcmcplot(occ2007) # density, trace, running mean plots
post_summ(occ2007, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean 1.016483e-01 2.732537e-01 8.769168e-02 0.1597221 -3.112058
## sd 9.640537e-02 1.114158e-01 9.695165e-02 0.2378764 0.422838
## 50% 1.015503e-01 2.723259e-01 8.730085e-02 0.1545199 -3.096501
## 2.5% -8.672535e-02 5.685690e-02 -1.000216e-01 -0.2897019 -3.990115
## 97.5% 2.903748e-01 4.942726e-01 2.787512e-01 0.6429026 -2.336288
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000 1.000000
## neff 5.856400e+04 8.010800e+04 8.342100e+04 19008.0000000 9883.000000
## beta2 beta3 beta4
## mean -0.3359479 -3.2211272 3.958908e-01
## sd 0.3902995 0.4873988 2.288375e-01
## 50% -0.3285421 -3.2040751 3.919161e-01
## 2.5% -1.1220211 -4.2237992 -3.867287e-02
## 97.5% 0.4068376 -2.3132762 8.553640e-01
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 23384.0000000 14357.0000000 2.180500e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2007)<-names
traplot(occ2007,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2007,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2007)
# geweke diagnostic plot
geweke.plot(occ2007)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except average daily rainfall (\(\beta_2\)) and elevation (\(\beta_4\)).
occ2008<-mcmc_nonspat[[2]]
# mcmcplot(occ2008) # density, trace, running mean plots
post_summ(occ2008, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -4.745033e-02 3.578637e-01 1.559842e-01 3.912482e-01 -3.5727057
## sd 3.867967e-02 4.497648e-02 4.047008e-02 1.709779e-01 0.3496172
## 50% -4.748399e-02 3.576265e-01 1.560089e-01 3.868992e-01 -3.5579678
## 2.5% -1.233893e-01 2.698431e-01 7.669410e-02 6.710589e-02 -4.2974860
## 97.5% 2.834374e-02 4.464124e-01 2.354094e-01 7.367128e-01 -2.9253216
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 8.267600e+04 8.596800e+04 9.005100e+04 1.710300e+04 8659.0000000
## beta2 beta3 beta4
## mean -0.1853654 -3.5336254 0.1973209
## sd 0.2781416 0.3874375 0.1647784
## 50% -0.1797674 -3.5232273 0.1952043
## 2.5% -0.7444813 -4.3232023 -0.1212110
## 97.5% 0.3442647 -2.8070816 0.5252942
## Rhat 1.0000000 1.0000000 1.0000000
## neff 26907.0000000 11689.0000000 26807.0000000
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2008)<-names
traplot(occ2008,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2008,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2008)
# geweke diagnostic plot
geweke.plot(occ2008)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero).
occ2009<-mcmc_nonspat[[3]]
# mcmcplot(occ2009) # density, trace, running mean plots
post_summ(occ2009, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -3.373962e-01 4.714960e-01 -6.526020e-02 7.795702e-01 -3.7560682
## sd 3.042671e-02 3.594230e-02 3.088984e-02 1.783696e-01 0.3668137
## 50% -3.372494e-01 4.714115e-01 -6.516706e-02 7.743575e-01 -3.7419574
## 2.5% -3.972039e-01 4.013295e-01 -1.259531e-01 4.452356e-01 -4.5132510
## 97.5% -2.779803e-01 5.419877e-01 -4.913351e-03 1.145879e+00 -3.0739017
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 7.467600e+04 7.976000e+04 8.458300e+04 1.111300e+04 7122.0000000
## beta2 beta3 beta4
## mean -7.334304e-01 -3.3000094 6.134432e-01
## sd 3.299181e-01 0.4099384 2.177610e-01
## 50% -7.290827e-01 -3.2900750 6.096744e-01
## 2.5% -1.395312e+00 -4.1307564 1.955305e-01
## 97.5% -9.907252e-02 -2.5268640 1.049579e+00
## Rhat 1.000000e+00 1.0000000 1.000000e+00
## neff 1.869400e+04 10818.0000000 1.841200e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2009)<-names
traplot(occ2009,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2009,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2009)
# geweke diagnostic plot
geweke.plot(occ2009)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero).
occ2010<-mcmc_nonspat[[4]]
# mcmcplot(occ2010) # density, trace, running mean plots
post_summ(occ2010, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -2.778866e-01 4.135277e-01 -5.853160e-02 3.409035e-01 -2.8174421
## sd 3.120247e-02 3.713143e-02 3.447540e-02 1.454001e-01 0.2556498
## 50% -2.777638e-01 4.133902e-01 -5.840175e-02 3.379543e-01 -2.8090150
## 2.5% -3.391840e-01 3.415129e-01 -1.260867e-01 6.317407e-02 -3.3401947
## 97.5% -2.168639e-01 4.867746e-01 9.073935e-03 6.341152e-01 -2.3382079
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 8.117800e+04 8.394600e+04 9.158400e+04 1.841100e+04 12376.0000000
## beta2 beta3 beta4
## mean -4.875134e-01 -2.7481354 4.679657e-01
## sd 3.034561e-01 0.3289788 1.966497e-01
## 50% -4.839056e-01 -2.7431045 4.660299e-01
## 2.5% -1.088879e+00 -3.4114382 8.929901e-02
## 97.5% 9.607833e-02 -2.1181227 8.591151e-01
## Rhat 1.000000e+00 1.0000000 1.000000e+00
## neff 2.451600e+04 19886.0000000 2.363100e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2010)<-names
traplot(occ2010,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2010,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2010)
# geweke diagnostic plot
geweke.plot(occ2010)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except average daily rainfall (\(\beta_2\)).
occ2011<-mcmc_nonspat[[5]]
# mcmcplot(occ2011) # density, trace, running mean plots
post_summ(occ2011, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -2.784935e-01 4.133526e-01 -5.844071e-02 3.436271e-01 -2.7435344
## sd 3.126392e-02 3.713504e-02 3.449212e-02 1.427826e-01 0.2503197
## 50% -2.783714e-01 4.132094e-01 -5.833083e-02 3.416728e-01 -2.7364370
## 2.5% -3.400780e-01 3.408892e-01 -1.263297e-01 7.171154e-02 -3.2544110
## 97.5% -2.172348e-01 4.863024e-01 9.109895e-03 6.305482e-01 -2.2724657
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 8.039900e+04 8.334700e+04 9.167600e+04 1.817000e+04 13149.0000000
## beta2 beta3 beta4
## mean -0.4708289 -2.6956974 4.636963e-01
## sd 0.3020388 0.3258752 1.953672e-01
## 50% -0.4667102 -2.6913360 4.612347e-01
## 2.5% -1.0704237 -3.3503290 8.743251e-02
## 97.5% 0.1131294 -2.0749462 8.538776e-01
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 24340.0000000 19113.0000000 2.328800e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2011)<-names
traplot(occ2011,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2011,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2011)
# geweke diagnostic plot
geweke.plot(occ2011)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except average daily rainfall (\(\beta_2\)).
occ2012<-mcmc_nonspat[[6]]
# mcmcplot(occ2012) # density, trace, running mean plots
post_summ(occ2012, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -4.554942e-01 3.690209e-01 -1.470473e-01 0.5284408 -3.811303
## sd 3.392577e-02 3.940041e-02 3.525892e-02 0.1769913 0.381529
## 50% -4.554754e-01 3.690360e-01 -1.467519e-01 0.5227781 -3.794907
## 2.5% -5.220280e-01 2.921665e-01 -2.170125e-01 0.1961047 -4.598147
## 97.5% -3.890352e-01 4.463977e-01 -7.885954e-02 0.8910372 -3.111042
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.0010000 1.001000
## neff 5.474700e+04 5.162700e+04 7.470000e+04 9737.0000000 6333.000000
## beta2 beta3 beta4
## mean -0.5056981 -2.947347 5.666441e-01
## sd 0.2784737 0.395254 1.689602e-01
## 50% -0.5008744 -2.936453 5.631398e-01
## 2.5% -1.0695055 -3.752410 2.427409e-01
## 97.5% 0.0227415 -2.206723 9.065987e-01
## Rhat 1.0000000 1.001000 1.000000e+00
## neff 20938.0000000 9008.000000 1.871800e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2012)<-names
traplot(occ2012,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2012,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2012)
# geweke diagnostic plot
geweke.plot(occ2012)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except the occupancy intercept (\(\beta_0\)).
occ2013<-mcmc_nonspat[[7]]
# mcmcplot(occ2013) # density, trace, running mean plots
post_summ(occ2013, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -2.894698e-01 3.589896e-01 2.887080e-02 2.524249e-01 -3.0585573
## sd 3.567558e-02 4.080312e-02 3.591352e-02 1.456821e-01 0.2838382
## 50% -2.895558e-01 3.588190e-01 2.902349e-02 2.503588e-01 -3.0497530
## 2.5% -3.591028e-01 2.792812e-01 -4.217740e-02 -2.728201e-02 -3.6428555
## 97.5% -2.196105e-01 4.392969e-01 9.860199e-02 5.426392e-01 -2.5313719
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 7.691100e+04 8.292200e+04 9.003000e+04 1.960600e+04 11270.0000000
## beta2 beta3 beta4
## mean -0.8782775 -2.0751220 6.442337e-01
## sd 0.2526225 0.3028606 1.625883e-01
## 50% -0.8739782 -2.0712257 6.418660e-01
## 2.5% -1.3840897 -2.6836253 3.307138e-01
## 97.5% -0.3924038 -1.4980037 9.703159e-01
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 21930.0000000 20561.0000000 2.164300e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2013)<-names
traplot(occ2013,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2013,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2013)
# geweke diagnostic plot
geweke.plot(occ2013)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except the occupancy intercept (\(\beta_0\)).
occ2014<-mcmc_nonspat[[8]]
# mcmcplot(occ2014) # density, trace, running mean plots
post_summ(occ2014, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -3.629884e-01 4.970808e-01 -2.795633e-02 1.924278e-01 -3.2499862
## sd 3.420763e-02 4.182727e-02 3.850889e-02 1.405148e-01 0.2852155
## 50% -3.630217e-01 4.969157e-01 -2.788632e-02 1.904361e-01 -3.2406998
## 2.5% -4.302298e-01 4.152566e-01 -1.035917e-01 -7.825355e-02 -3.8336438
## 97.5% -2.962357e-01 5.794305e-01 4.721194e-02 4.748650e-01 -2.7168083
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 7.667300e+04 7.425700e+04 8.607700e+04 1.814000e+04 10630.0000000
## beta2 beta3 beta4
## mean -0.5405616 -2.6126211 3.963627e-01
## sd 0.2206248 0.3333594 1.586311e-01
## 50% -0.5384185 -2.6054441 3.951647e-01
## 2.5% -0.9805605 -3.2869165 8.845223e-02
## 97.5% -0.1143014 -1.9809981 7.108542e-01
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 29601.0000000 15094.0000000 2.788700e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2014)<-names
traplot(occ2014,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2014,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2014)
# geweke diagnostic plot
geweke.plot(occ2014)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except the occupancy intercept (\(\beta_0\)).
occ2015<-mcmc_nonspat[[9]]
# mcmcplot(occ2015) # density, trace, running mean plots
post_summ(occ2015, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -5.536216e-01 5.311856e-01 4.584388e-02 2.245295e-01 -4.5611553
## sd 2.924295e-02 3.563411e-02 3.269986e-02 1.626208e-01 0.4174052
## 50% -5.536314e-01 5.312195e-01 4.565040e-02 2.217011e-01 -4.5450877
## 2.5% -6.110056e-01 4.613850e-01 -1.806822e-02 -8.531029e-02 -5.4231606
## 97.5% -4.963181e-01 6.012283e-01 1.102728e-01 5.520952e-01 -3.7875244
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 7.058900e+04 6.819100e+04 8.510900e+04 1.240400e+04 5231.0000000
## beta2 beta3 beta4
## mean -0.7025759 -3.0209339 1.024913e+00
## sd 0.2993095 0.3806089 1.726536e-01
## 50% -0.6970368 -3.0127339 1.021028e+00
## 2.5% -1.3013647 -3.7894288 6.983612e-01
## 97.5% -0.1302530 -2.2976584 1.374512e+00
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 18365.0000000 8611.0000000 1.323800e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2015)<-names
traplot(occ2015,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2015,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2015)
# geweke diagnostic plot
geweke.plot(occ2015)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except average daily rainfall (\(\beta_2\)).
occ2016<-mcmc_nonspat[[10]]
# mcmcplot(occ2016) # density, trace, running mean plots
post_summ(occ2016, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -5.228211e-01 4.088375e-01 1.000962e-01 4.220996e-01 -3.8866300
## sd 2.615062e-02 3.101821e-02 2.814243e-02 1.598490e-01 0.3612076
## 50% -5.227961e-01 4.087884e-01 1.000731e-01 4.181365e-01 -3.8721962
## 2.5% -5.740322e-01 3.481103e-01 4.460562e-02 1.182595e-01 -4.6257102
## 97.5% -4.718047e-01 4.696608e-01 1.552351e-01 7.468819e-01 -3.2179503
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000
## neff 6.353900e+04 6.538700e+04 8.744700e+04 1.011400e+04 5962.0000000
## beta2 beta3 beta4
## mean -4.163847e-01 -3.1526538 5.947290e-01
## sd 2.302428e-01 0.3611282 1.775258e-01
## 50% -4.133554e-01 -3.1422396 5.916052e-01
## 2.5% -8.765189e-01 -3.8876053 2.556419e-01
## 97.5% 2.784274e-02 -2.4710621 9.523506e-01
## Rhat 1.000000e+00 1.0000000 1.000000e+00
## neff 1.940800e+04 8624.0000000 1.436100e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2016)<-names
traplot(occ2016,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2016,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2016)
# geweke diagnostic plot
geweke.plot(occ2016)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero).
occ2017<-mcmc_nonspat[[11]]
# mcmcplot(occ2017) # density, trace, running mean plots
post_summ(occ2017, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -7.852160e-01 2.095992e-01 1.135530e-01 4.095354e-01 -3.5819576
## sd 2.547518e-02 3.146754e-02 3.040912e-02 1.460927e-01 0.3107464
## 50% -7.851875e-01 2.096190e-01 1.134162e-01 4.070603e-01 -3.5729056
## 2.5% -8.351571e-01 1.479523e-01 5.414153e-02 1.304449e-01 -4.2144528
## 97.5% -7.353996e-01 2.711283e-01 1.733174e-01 7.028611e-01 -2.9957461
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.0010000
## neff 6.735300e+04 7.135900e+04 8.367700e+04 1.270000e+04 8110.0000000
## beta2 beta3 beta4
## mean -0.8695016 -2.7209447 9.295852e-01
## sd 0.2519761 0.3573905 1.808550e-01
## 50% -0.8663972 -2.7115294 9.261138e-01
## 2.5% -1.3696185 -3.4424744 5.839414e-01
## 97.5% -0.3812283 -2.0412531 1.294477e+00
## Rhat 1.0000000 1.0010000 1.000000e+00
## neff 21736.0000000 13358.0000000 1.712700e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2017)<-names
traplot(occ2017,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2017,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2017)
# geweke diagnostic plot
geweke.plot(occ2017)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except average daily rainfall (\(\beta_2\)).
occ2018<-mcmc_nonspat[[12]]
# mcmcplot(occ2018) # density, trace, running mean plots
post_summ(occ2018, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -8.604555e-01 6.793165e-02 1.354594e-01 2.506567e-01 -3.278675
## sd 2.535389e-02 3.128380e-02 3.055821e-02 1.296448e-01 0.298474
## 50% -8.603812e-01 6.805139e-02 1.354893e-01 2.486189e-01 -3.266018
## 2.5% -9.102202e-01 6.450702e-03 7.546391e-02 2.808816e-03 -3.895487
## 97.5% -8.110273e-01 1.291710e-01 1.951690e-01 5.095545e-01 -2.725815
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.001000
## neff 6.392500e+04 6.574900e+04 7.976600e+04 1.655700e+04 7428.000000
## beta2 beta3 beta4
## mean -0.2248065 -2.4616076 9.250496e-01
## sd 0.2765222 0.3390466 1.548563e-01
## 50% -0.2211705 -2.4567217 9.218606e-01
## 2.5% -0.7802192 -3.1412902 6.303077e-01
## 97.5% 0.3045748 -1.8121528 1.238072e+00
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 28191.0000000 15115.0000000 1.659000e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2018)<-names
traplot(occ2018,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2018,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2018)
# geweke diagnostic plot
geweke.plot(occ2018)
All parameters have R-hat values below 1.05 and thus the chains have mixed well. All coefficients are significant (95% HDI excluding zero) except the occupancy intercept (\(\beta_0\)) and average daily rainfall (\(\beta_2\)).
occ2019<-mcmc_nonspat[[13]]
# mcmcplot(occ2019) # density, trace, running mean plots
post_summ(occ2019, c("alpha","beta"),Rhat=TRUE,neff = TRUE)
## alpha0 alpha1 alpha2 beta0 beta1
## mean -7.003201e-01 1.340549e-01 7.627887e-02 0.1042835 -3.5334905
## sd 2.586389e-02 3.355949e-02 3.171892e-02 0.1398967 0.3047812
## 50% -7.003104e-01 1.340363e-01 7.633954e-02 0.1020652 -3.5250918
## 2.5% -7.510636e-01 6.800430e-02 1.403585e-02 -0.1642537 -4.1586945
## 97.5% -6.499704e-01 2.002456e-01 1.383094e-01 0.3841174 -2.9630166
## Rhat 1.000000e+00 1.000000e+00 1.000000e+00 1.0000000 1.0000000
## neff 7.083800e+04 7.149200e+04 8.655100e+04 16492.0000000 9342.0000000
## beta2 beta3 beta4
## mean -0.3621165 -2.8767300 1.056587e+00
## sd 0.2714485 0.3435407 1.700702e-01
## 50% -0.3586035 -2.8690235 1.053134e+00
## 2.5% -0.9055715 -3.5699538 7.342383e-01
## 97.5% 0.1620470 -2.2223155 1.401464e+00
## Rhat 1.0000000 1.0000000 1.000000e+00
## neff 25979.0000000 14812.0000000 1.779400e+04
All trace plots are indicative of convergence.
names<-c("alpha[0]","alpha[1]","alpha[2]","beta[0]","beta[1]","beta[2]","beta[3]","beta[4]")
varnames(occ2019)<-names
traplot(occ2019,"alpha",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
traplot(occ2019,"beta",style="plain",col=c("deepskyblue2","firebrick1","goldenrod1"),greek=T,cex.main=1.5)
It is evident that only a few Z-scores for each parameter are larger than the absolute value of 1.96 and as such, there is evidence for convergence.
# geweke z-scores
# geweke.diag(occ2019)
# geweke diagnostic plot
geweke.plot(occ2019)