MyNixOS website logo
Description

Estimation of Spatial Weight Matrices.

Bayesian estimation of spatial weight matrices in spatial econometric panel models. Allows for estimation of spatial autoregressive (SAR), spatial error (SEM), spatial Durbin (SDM), spatial error Durbin (SDEM) and spatially lagged explanatory variable (SLX) type specifications featuring an unknown spatial weight matrix. Methodological details are given in Krisztin and Piribauer (2022) <doi:10.1080/17421772.2022.2095426>.

estimateW

R-CMD-check CRAN status month total

This is the development repository of the R package estimateW.

Features

The package provides methods to estimate spatial weight matrices in spatial autoregressive type models.

Install CRAN Version

Type into your R session:

install.packages("estimateW")

For more information, please visit the CRAN page of the package.

Install Latest Development Version

Type into your R session:

if (!require("remotes")) {
  install.packages("remotes")
}
remotes::install_github(
  repo = "https://github.com/tkrisztin/estimateW")

Demonstration

# 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)

References

Tamás Krisztin & Philipp Piribauer (2022) A Bayesian approach for the estimation of weight matrices in spatial autoregressive models, Spatial Economic Analysis, DOI: 10.1080/17421772.2022.2095426

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows