diff --git a/DESCRIPTION b/DESCRIPTION index b6099d7e..6a1b11d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: geostan Title: Bayesian Spatial Analysis -Version: 0.8.0 -Date: 2024-11-15 +Version: 0.8.1 +Date: 2024-12-04 URL: https://connordonegan.github.io/geostan/ BugReports: https://github.com/ConnorDonegan/geostan/issues Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 2e383bbc..05645923 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ # geostan 0.8.1 -This version changes one line in the 'Spatial analysis with geostan' vignette that caused the package to fail on installation for old versions of windows and mac os. +This is a small patch to ensure that the package can install on older versions of R. + +The patch changes one line in the 'Spatial analysis with geostan' vignette that caused the package to fail on installation for old versions of windows and mac os. # geostan 0.8.0 diff --git a/R/stan_glm.R b/R/stan_glm.R index 85315cd3..6a874cdf 100644 --- a/R/stan_glm.R +++ b/R/stan_glm.R @@ -205,6 +205,7 @@ #' # example prior for two covariates #' pl <- list(beta = normal(c(0, 0), #' c(1, 1)) +#' ) #' #' ## #' ## Poisson model for count data diff --git a/cran-comments.md~ b/cran-comments.md~ deleted file mode 100644 index 06c56051..00000000 --- a/cran-comments.md~ +++ /dev/null @@ -1 +0,0 @@ -Passed devtools::check and win-builder \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index 9adc22b2..f99c8fd5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ geostan - 0.8.0 + 0.8.1 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ef459082..32f4286e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ geostan - 0.8.0 + 0.8.1 diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 110a0745..9d54e0b6 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -17,7 +17,7 @@ geostan - 0.8.0 + 0.8.1 diff --git a/docs/articles/custom-spatial-models.html b/docs/articles/custom-spatial-models.html index ddefca07..cf441241 100644 --- a/docs/articles/custom-spatial-models.html +++ b/docs/articles/custom-spatial-models.html @@ -40,7 +40,7 @@ geostan - 0.8.0 + 0.8.0.01 diff --git a/docs/articles/index.html b/docs/articles/index.html index 17104171..4e4946a4 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ geostan - 0.8.0 + 0.8.1 diff --git a/docs/articles/measuring-sa.html b/docs/articles/measuring-sa.html index a9fcb883..a8642796 100644 --- a/docs/articles/measuring-sa.html +++ b/docs/articles/measuring-sa.html @@ -40,7 +40,7 @@ geostan - 0.8.0 + 0.8.0.01 @@ -299,7 +299,10 @@

Model diagnostics#> *Setting prior parameters for alpha_tau #> Distribution: student_t #> df location scale -#> 1 10 0 3 +#> 1 10 0 3 +#> Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable. +#> Running the chains for more iterations may help. See +#> https://mc-stan.org/misc/warnings.html#bulk-ess

For a summary of model results:

 print(fit)
@@ -309,18 +312,18 @@ 

Model diagnostics#> Likelihood: poisson #> Link: log #> Spatial method: Exchangeable -#> Residual Moran Coefficient: 0.023644 +#> Residual Moran Coefficient: 0.02472075 #> Observations: 159 #> #> Inference for Stan model: foundation. #> 4 chains, each with iter=2000; warmup=1000; thin=1; #> post-warmup draws per chain=1000, total post-warmup draws=4000. #> -#> mean se_mean sd 2.5% 20% 50% 80% 97.5% n_eff Rhat -#> intercept -4.180 0.001 0.021 -4.221 -4.197 -4.180 -4.163 -4.140 444 1.005 -#> alpha_tau 0.247 0.000 0.016 0.219 0.234 0.246 0.261 0.281 4397 1.000 +#> mean se_mean sd 2.5% 20% 50% 80% 97.5% n_eff Rhat +#> intercept -4.181 0.001 0.022 -4.225 -4.200 -4.182 -4.162 -4.137 382 1.01 +#> alpha_tau 0.247 0.000 0.016 0.219 0.234 0.247 0.260 0.281 4579 1.00 #> -#> Samples were drawn using NUTS(diag_e) at Sat Nov 16 10:37:03 2024. +#> Samples were drawn using NUTS(diag_e) at Wed Dec 4 13:07:41 2024. #> For each parameter, n_eff is a crude measure of effective sample size, #> and Rhat is the potential scale reduction factor on split chains (at #> convergence, Rhat=1).

diff --git a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-14-1.png b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-14-1.png index 0bfd67b2..234bf68b 100644 Binary files a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-14-1.png and b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-14-1.png differ diff --git a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-2-1.png index 9df630b6..b24e58c8 100644 Binary files a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-4-1.png index 650f5473..d1d4b559 100644 Binary files a/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/measuring-sa_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/raster-regression.html b/docs/articles/raster-regression.html index b0b37dc8..40ba4fd6 100644 --- a/docs/articles/raster-regression.html +++ b/docs/articles/raster-regression.html @@ -40,7 +40,7 @@ geostan - 0.8.0 + 0.8.0.01 @@ -123,13 +123,13 @@

Demonstration
 fit <- stan_sar(y ~ z, data = grid, C = W)
-

The stan_sar function will take the spatial weights matrix W and pass it through a function called prep_sar_data which will calculate the eigenvalues of the spatial weights matrix using Matrix::Schur. This step can be prohibitive for large data sets (e.g., \(N = 100,000\)).

+

The stan_sar function will take the spatial weights matrix W and pass it through a function called prep_sar_data which will calculate the eigenvalues of the spatial weights matrix using Matrix::Schur. This step can be prohibitive for large data sets (e.g., \(N = 100,000\)).

The following code would normally be used to fit a conditional autoregressive (CAR) model:

 C <- shape2mat(grid, style = "B", queen = FALSE)
 car_list <- prep_car_data(C, "WCAR")
 fit <- stan_car(y ~ z, data = grid, car_parts = car_list)
-

Here, the prep_car_data function calculates the eigenvalues of the spatial weights matrix using Matrix::Schur, which is not feasible for large N.

+

Here, the prep_car_data function calculates the eigenvalues of the spatial weights matrix using Matrix::Schur, which is not feasible for large N.

The prep_sar_data2 and prep_car_data2 functions are designed for large raster layers. As input, they require the dimensions of the grid (number of rows and number of columns). The eigenvalues are produced very quickly using Equation 5 from Griffith (2000). The methods have some restrictions: