### Install CRAN Version of estimateW Source: https://github.com/tkrisztin/estimatew/blob/master/README.md Installs the latest stable version of the estimateW package directly from CRAN. This is the recommended method for most users. ```r install.packages("estimateW") ``` -------------------------------- ### Install Latest Development Version of estimateW Source: https://github.com/tkrisztin/estimatew/blob/master/README.md Installs the most recent development version of the estimateW package from GitHub. This version may contain newer features or bug fixes but might be less stable than the CRAN version. It requires the 'remotes' package. ```r if (!require("remotes")) { install.packages("remotes") } remotes::install_github( repo = "https://github.com/tkrisztin/estimateW") ``` -------------------------------- ### Demonstration of estimateW for Spatial Weight Matrix Estimation Source: https://github.com/tkrisztin/estimatew/blob/master/README.md This R code demonstrates how to use the estimateW package to estimate a spatial autoregressive model. It includes data preparation, model specification using the 'sarw' function, and plotting the posterior of the spatial weight matrix. The example uses COVID-19 data and follows a benchmark specification from Krisztin and Piribauer (2022). ```r # Load the package library(estimateW) require(dplyr) tt = length(unique(covid$date)) n = length(unique(covid$ISO3)) # reorder by date and longitude covid = covid %>% arrange(date, LON) %>% mutate(date = as.factor(date)) # Benchmark specification from Krisztin and Piribauer (2022) SEA Y = as.matrix(covid$infections_pc - covid$infections_pc_lag) X = model.matrix(~infections_pc_lag + stringency_2weekly + precipProbability + temperatureMax + ISO3 + as.factor(date) + 0,data = covid) # use a flat prior for W flat_W_prior = W_priors(n = n,nr_neighbors_prior = rep(1/n,n)) # Estimate a Bayesian model using covid infections data res = sarw(Y = Y,tt = tt,Z = X,niter = 200,nretain = 50, W_prior = flat_W_prior) # Plot the posterior of the spatial weight matrix dimnames(res$postw)[[2]] = dimnames(res$postw)[[1]] = covid$ISO3[1:n] plot(res,font=3,cex.axis=0.75,las=2) ``` -------------------------------- ### CRAN Release Preparation Source: https://github.com/tkrisztin/estimatew/blob/master/NEWS.md Details the steps taken for the first CRAN release, including ensuring basic functionality and passing CRAN checks. The package passed 'R CMD check --as-cran' with no errors or warnings. ```R R CMD check --as-cran ``` -------------------------------- ### Simulate Data Generating Process with Exogenous Weights Source: https://github.com/tkrisztin/estimatew/blob/master/cran-comments.md Adds an option to the `sim_dgp()` function to allow users to supply an exogenous spatial weight matrix. This provides greater flexibility in simulating spatial data. ```R sim_dgp(..., exogenous_weights = TRUE) ``` -------------------------------- ### Option to Supply Exogenous Spatial Weight Matrix Source: https://github.com/tkrisztin/estimatew/blob/master/NEWS.md Adds an option to the 'sim_dgp()' function to allow users to supply an exogenous spatial weight matrix. This enhances flexibility in simulating spatial data generating processes. ```R sim_dgp(..., spatial_weights_exog = NULL) ``` -------------------------------- ### New Functions for Spatial Error Models Source: https://github.com/tkrisztin/estimatew/blob/master/NEWS.md Introduces 'semw()' and 'sdmw()' functions for handling spatial error models. These functions are part of the core functionality for spatial econometrics within the package. ```R semw() sdmw() ``` -------------------------------- ### Spatial Error Model Function Source: https://github.com/tkrisztin/estimatew/blob/master/cran-comments.md Introduces the `semw()` function for handling spatial error models. This function is a new addition to the estimateW package, enhancing its capabilities for spatial data analysis. ```R semw() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.