# Computing and plotting a correlogram

I have a sample data for a spatial grid of size 20x20. I need to plot the correlogram of this grid of data to see how much they are correlated. Currently I have 400 data points for the 20x20 grid cells, one for each cell. How can I compute the correlogram to see the correlation?

-
@Gung, a correlogram is the spatial analog of a time series correlogram. It's a single plot of correlation versus lag and lag is either a distance or a vector, depending on various assumptions. It won't necessarily have 20 rows and 20 columns. An efficient computational method is to multiply the FFTs of the array; see, e.g., sciencedirect.com/science/article/pii/S0098300401000073. – whuber May 22 '12 at 19:27
@whuber, thanks for letting me know. Unfortunately, I know almost nothing about spatial statistics. (You may have noticed that I mostly answer simple questions on CV.) I will delete my previous comment. – gung May 22 '12 at 20:09
Just to clarify, what sort of spatial data? Do you mean you have 400 single values, and they are arranged in the grid? Or is it 400 variables, each with multiple measurements? – Peter Ellis May 23 '12 at 20:02
Yeah I have a grid of 20x20 cells and there is a measurement for each cell. So a total of 400. How can I use this data to plot the correlogram and see how much they are correlated – rajan sthapit May 23 '12 at 20:11
For grids, using MatLab: mathworks.com/help/toolbox/images/f21-17064.html. For irregular point data, using R: stat.ethz.ch/R-manual/R-devel/library/spatial/html/…. (To make the example work, include the line library(spatial).) – whuber May 23 '12 at 20:12