6

I am looking for an R package which can run "Spatial Vector Autoregression". tandfonline.com/doi/full/10.1080/17421770701346689

According to Chen and Conley (2001), this is a "vector autoregression (VAR) whose coefficient matrix and shock covariance matrix are functions of economic distances between agents. The impact of other agents’ variables on the conditional mean of a given agent’s variable is a function of their economic distances from this agent. Similarly, covariances of VAR shocks are functions of distances between agents in the previous period, a property we refer to as being isotropic."

(Chen, X & Conley, T.G. (2001) A new semiparametric spatial model for panel time series, Journal of Econometrics, 105, 59–83)

Surprisingly, however, I could only see until "Spatial Autoregression" which is still not what I need for my purpose. May I get help finding the package for this please? Otherwise, may I know an official way to run this Spatial Vector Autoregression model using R programming?

Eric
  • 528
  • 1
  • 8
  • 26
  • Rather than give us just a name of an approach, can you provide a more detailed explanation of what you're trying to do, and/or links to descriptions (edited into your question: https://www.tandfonline.com/doi/full/10.1080/17421770701346689 ) ? (I'm afraid this may not exist ...) – Ben Bolker Feb 16 '21 at 15:13
  • @BenBolker: Yes that is the correct model I would like to say. – Eric Feb 16 '21 at 15:15
  • @BenBolker: To add, it is strange that I still see papers empirically testing this model but the corresponding R code/package does not exist. I think there could be some indirect way they estimate possibly using different inputs for general vector autoregression codes/commands in R but not sure. – Eric Feb 17 '21 at 06:13
  • Nothing [here](https://cran.r-project.org/web/views/Spatial.html) or [here](https://cran.r-project.org/web/views/Econometrics.html) ? – MrSmithGoesToWashington Feb 17 '21 at 10:14
  • @MrSmithGoesToWashington: If I was able to detect any, I wouldn't be raising an expensive bounty on my question above.. – Eric Feb 17 '21 at 10:16
  • Do any of those papers make their code available, or would the authors provide code upon request ... ? – Ben Bolker Feb 17 '21 at 14:06
  • @BenBolker: No codes available there. For instance, there is an economics letters paper using this model. I contacted one of the two authors but did not get response. – Eric Feb 17 '21 at 14:32
  • @BenBolker: Have a look at this paper --> Parhi, M & Mishra, T (2009) Spatial growth volatility and age-structured human capital dynamics in Europe, Economics Letters 102. 181–184. – Eric Feb 17 '21 at 14:35
  • 1
    @BenBolker: I just heard that the authors have created a MATLAB code to run this model which is definitely not available via R code. – Eric Feb 25 '21 at 12:59
  • @BenBolker: But it’s a shame that R program does not have such package yet. – Eric Oct 30 '21 at 17:24
  • is the Matlab code publicly available? – Ben Bolker Oct 30 '21 at 17:52
  • @BenBolker I hope I can fine one too. – Eric Oct 30 '21 at 17:53

1 Answers1

4

I think I've found what you're looking for, devtools::install_github("James-Thorson/VAST"). VAST stands for "Vector-Autoregressive Spatio-Temporal." This package is a wrapper around a package that incorporates spatial modeling. Essentially it adds to it.

You can see coding examples here. If you want to look at help, use ?VAST::VAST and select one of the three hyperlinks at the bottom of the short description and details (make_settings, fit_model, and plot_results).

Please note:

When I installed this package to check out what it included, it came back with a conflict that the package TMB required an earlier version of the Matrix package. I had not had TMB installed before installing this package. I had no issues installing TMB independently (without a conflict with the version of the Matrix package). However when I called the library VAST it still gave me that error. When I called the library TMB, then the library VAST I didn't receive the warning and both libraries loaded.

Kat
  • 15,669
  • 3
  • 18
  • 51
  • Thank you so much! It is a very good news as there used to be no resources over this type of modelling in R. I might have to go for more trials but seems excellent to me so far. Thank you again! – Eric Jan 30 '22 at 00:36
  • Even when I use the author's example code, I keep getting such error "Error in TMB::compile(paste0(Version, ".cpp"), flags = "-Wno-ignored-attributes -O2 -mfpmath=sse -msse2 -mstackrealign") : Compilation failed" Although I tried all the remedies including re-installing my entire R program as well, still does not work. I wonder what is wrong with this package. – Eric Feb 12 '22 at 15:08
  • I found something on this issue. I'm going to guess you have a Windows device. The discussion seems to infer that this is a problem with `TMB` and `RcppEigen`, which VAST uses. They specifically discuss this problem with VAST and provide some workarounds towards the end [Check it out](https://github.com/kaskr/adcomp/issues/277). – Kat Feb 12 '22 at 16:25