[R-sig-Geo] Sampling from a SAR error model

Griffin, Terry W twgriffi at purdue.edu
Sat Sep 16 00:10:18 CEST 2006


Dr. Field,

I'm working on similar simulations and have induced a range of spatial
autocorrelation levels into the error term with a spatial weights matrix
using the invIrM function in the spdep package.

Besides being described in the spedep package reference manual, the
invIrM function is used in Luc Anselin's "Spatial Regression Analysis in
R, A Workbook" which can be found at:
http://www.sal.uiuc.edu/stuff/stuff-sum/tutorials

I'm not sure if this is exactly what you're looking for, but I would
appreciate any feedback about what you find useful that may influence my
work.

Thank you,

Terry




Terry W. Griffin

Graduate Research Assistant

Agricultural Economics - Purdue University

765-494-4257

http://web.ics.purdue.edu/~twgriffi/

 

 

-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch
[mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Sam Field
Sent: Friday, September 15, 2006 3:34 PM
To: r-sig-geo at stat.math.ethz.ch
Subject: [R-sig-Geo] Sampling from a SAR error model

List,

I am having trouble writing a script that samples from an SAR error
process. I've done it successfully for a spatial lag model, but not
for the spatial error model.  For the spatial lag model, I have the
following:

y_lag <- (solve(diag(100)- p*w))%*%X_mat%*%parms +
solve(diag(100)-p*w)%*%e

where parms is a parameter vector
X_mat is n by p matrix of independent variables (+ constant)
e is a vector of indepndent normal deviates (mean = 0)
p is the autoregressive paramter
and w is a square, n by n contiguity matrix (row normalized).

This works beautifully.  lagsarlm recovers parms and p without a
problem. Over repeated sampling, the estimated values are centered
on the value for p in the simulation.


Is there something wrong with the following for the spatial error
model?

y_error <- X_mat%*%parms + (solve(diag(100)-p*w))%*%e


The distribution of values for p obtain from errorsarlm over
repeated sampling are not centered around the value for the
simulation, but are typically much lower and all over the place.  I
have only looked at values for p ranging from .3 to .7.

any help would be greatly appreciated!



-- 
Samuel H. Field, Ph.D.
Associate Research Scholar
Institute for Social and Economic Research and Policy (ISERP)
Columbia University
420 W. 118th Street
Mail code 3355
New York, NY  10027
215-731-0106

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo




More information about the R-sig-Geo mailing list