Hello!

Thanks for your response.

What I was trying to do (and probably explaining it wrong) was to simulate a matrix/raster such that if I looked at a measure of spatial autocorrelation, it would be around 0.9.

So I attacked it via my time series train of thought and considered time periods with 0.9, 0.9^2, and so on.

Hope this makes better sense now.

thanks,
Erin


Erin M. Hodgess, PhD
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgesse@uhd.edu



-----Original Message-----
From: r-sig-geo-bounces@r-project.org on behalf of Edzer Pebesma
Sent: Fri 6/1/2012 3:58 AM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] simulating a particular autocorrelation structure for a raster
 
Erin, I believe the following would do this:

xy = expand.grid(x = 1:16, y = 1:16)
d = as.matrix(dist(xy))
sim = chol(0.9 ^ d) %*% rnorm(256)

require(sp)
grd = SpatialPointsDataFrame(SpatialPoints(xy), data.frame(sim=sim))
gridded(grd) = TRUE
spplot(grd, col.regions=bpy.colors())

I used distance instead of closeness, so the diagional neighbour cell
gets autocorrelation 0.9 ^ sqrt(2), instead of 0.9 ^ 2 as you suggest.

To me, the simulations look really funny, so either my procedure is
wrong, or the covariance structure as you suggested (or I interpreted)
has strange properties in 2D.


On 06/01/2012 09:54 AM, Hodgess, Erin wrote:
> Dear R Sig Geo People:
> 
> I would like to create a 16x16 raster, say, with autocorrelation structure of 0.9 for nearest cell, 0.9^2 for 2nd closest, and so on.
> 
> How would I go about generating that, please?
> 
> I thought about putting together a correlation matrix, multiplying, and throwing in rnorm.  But I'm sure that there is something better and easier already in place.
> 
> Thanks in advance for any help.
> 
> Sincerely,
> Erin
> 
> 
> Erin M. Hodgess, PhD
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodgesse@uhd.edu
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma@wwu.de

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


	[[alternative HTML version deleted]]

