1
$\begingroup$

I have some spatial data and I want to fit a correlation function may be exponential or gaussian to my data. I could calculate the correlation for different pairs of my spatial point to get some empirical correlation function. What is the best way to fit some standard correlation functions to my empirical one.

I tried to use the gstat package to estimate the variogram. However, I had some issues. I generated some synthetic data with the given correlation matrix. I mean I generated some samples from a multivariate gaussian distribution with the given correlation matrix.

I am assuming it to be homogeneous. My first row of correlation matrix is something like

1   0.683429646106259   0.437789623184770   0.262915008717623   0.196106083531309   0.149045509783630   0.150509368156993   0.0707581842359845  0.0946249108754618  0.0778169918490679

So it kind of decreases with distance. The range is somewhere around at distance 10 when the correlation reaches approx 0.05.

Now when I tried to use the gstat package. I had to use the following data.

"x" "y" "data"
1 1 0.44168
1 2 0.099929
1 3 0.026909
1 4 -0.041947
1 5 -0.24288
1 6 0.78454
1 7 0.16761
1 8 -0.086277
1 9 0.023661
1 10 -0.26036
2 1 0.71725
2 2 -0.14143
2 3 -1.0092
2 4 -0.28496
2 5 -0.17743
2 6 0.22874
2 7 -0.94645
2 8 -0.14165
2 9 0.23027
2 10 0.50463
3 1 -1.1799
3 2 0.31035
3 3 0.83902
3 4 0.057151
3 5 -0.77414
3 6 -0.57698
3 7 0.034864
3 8 0.37105
3 9 -0.017573
3 10 -0.80297
4 1 -1.1183
4 2 0.04495
4 3 -0.43193
4 4 -0.32199
4 5 -0.30001
4 6 0.032265
4 7 0.76654
4 8 0.047539
4 9 -0.70933
4 10 -0.39096
5 1 0.8237
5 2 0.48326
5 3 -0.18275
5 4 -0.2011
5 5 -0.45547
5 6 0.056931
5 7 0.38949
5 8 -0.29351
5 9 -0.82567
5 10 -0.6183
6 1 1.2794
6 2 0.55406
6 3 1.0454
6 4 -0.80348
6 5 0.10936
6 6 -1.5121
6 7 0.86288
6 8 0.18994
6 9 -0.019555
6 10 -0.68697
7 1 1.7539
7 2 1.2916
7 3 0.41383
7 4 -0.24399
7 5 -0.023723
7 6 -1.0232
7 7 0.92783
7 8 0.64965
7 9 0.95411
7 10 0.19481
8 1 0.67385
8 2 1.1123
8 3 0.96762
8 4 0.69418
8 5 -0.025346
8 6 -0.69347
8 7 0.78425
8 8 1.082
8 9 1.1929
8 10 1.3393
9 1 0.87725
9 2 0.30799
9 3 -0.14401
9 4 -0.24109
9 5 0.3923
9 6 1.1385
9 7 1.1368
9 8 0.13259
9 9 0.86029
9 10 0.62073
10 1 -0.043159
10 2 0.13516
10 3 0.44809
10 4 0.1643
10 5 0.66301
10 6 1.9096
10 7 1.1722
10 8 1.1109
10 9 1.1154
10 10 1.0472

This is from just one sample. I thought of providing it more samples but I had to repeat the coordinates and it gave me rubbish variogram like this

enter image description here

However, I tried with just one sample and this is what I got for fitting a model variogram

  model      psill    range
1   Nug 0.06875421 0.000000
2   Exp 0.48353408 1.931677

enter image description here

enter image description here

I definitely cannot take these params for correlogram. In the case of correlation function, range is the distance at which the correlation is 0.05. If I look at my actual correlation function its approx at distance 10. So it doesn't match at all. Is it something wrong with the way I calculated the variogram or something else. I followed the tutorial here.

I am not sure but I think I am not supposed to get the nugget either. I added no noise when I sampled from the gaussian. Is it because I have less samples?

When I try to use all the samples, I get something like this as my empirical variogram which is not correct.

Here is my data

"x" "y" "aod"
1 1 -0.75488
1 2 -0.78846
1 3 -0.96701
1 4 0.21699
1 5 0.52046
1 6 0.28913
1 7 0.12993
1 8 0.37072
1 9 0.58311
1 10 -0.16038
2 1 -0.2117
2 2 -1.2046
2 3 -1.0581
2 4 -0.67419
2 5 1.0385
2 6 1.1686
2 7 0.14002
2 8 -0.16956
2 9 0.25615
2 10 0.21616
3 1 1.0365
3 2 -1.3079
3 3 -0.51374
3 4 -0.35841
3 5 0.25237
3 6 0.97418
3 7 -0.10198
3 8 -0.21238
3 9 -0.39775
3 10 -0.93731
4 1 0.50214
4 2 -0.21804
4 3 -0.63425
4 4 0.68123
4 5 1.695
4 6 1.6203
4 7 -0.0013243
4 8 0.15842
4 9 0.29372
4 10 -1.7714
5 1 0.66179
5 2 -1.0807
5 3 -0.65248
5 4 0.15395
5 5 0.30281
5 6 -0.075867
5 7 0.31152
5 8 -1.2481
5 9 -0.8156
5 10 -1.3282
6 1 0.20887
6 2 -0.316
6 3 0.62447
6 4 -0.073839
6 5 -0.34457
6 6 -0.047924
6 7 0.044455
6 8 0.40695
6 9 -0.030344
6 10 -0.078803
7 1 -0.43136
7 2 0.46374
7 3 0.76833
7 4 1.1933
7 5 -0.72779
7 6 0.68372
7 7 0.3142
7 8 -0.78668
7 9 -0.41529
7 10 -1.1691
8 1 0.12466
8 2 0.26433
8 3 0.68538
8 4 0.55875
8 5 0.52583
8 6 -0.127
8 7 0.050293
8 8 -0.18494
8 9 0.25105
8 10 -0.84661
9 1 -0.22072
9 2 -0.11841
9 3 1.0484
9 4 1.2102
9 5 0.77315
9 6 0.76342
9 7 0.45916
9 8 0.0039676
9 9 0.014329
9 10 -0.64462
10 1 0.80869
10 2 -0.35877
10 3 0.73614
10 4 -0.4413
10 5 0.73746
10 6 0.31207
10 7 0.14122
10 8 1.3785
10 9 -0.89216
10 10 0.095206
1 1 1.2769
1 2 1.0405
1 3 -0.0031401
1 4 0.047758
1 5 -0.74042
1 6 -0.69732
1 7 -0.041547
1 8 -0.22316
1 9 0.066819
1 10 -0.010506
2 1 0.96758
2 2 0.31139
2 3 -0.17409
2 4 0.25964
2 5 -0.85022
2 6 -0.71892
2 7 -0.75265
2 8 -1.1433
2 9 -1.4629
2 10 -1.5973
3 1 0.092515
3 2 -0.22445
3 3 0.15134
3 4 -0.46512
3 5 -0.06476
3 6 -0.23128
3 7 -1.3388
3 8 -0.97593
3 9 -1.448
3 10 -0.43345
4 1 0.61175
4 2 0.61255
4 3 -0.10015
4 4 0.33106
4 5 0.34014
4 6 -0.23341
4 7 -0.86573
4 8 -1.2642
4 9 -0.62796
4 10 -1.1511
5 1 0.31983
5 2 0.53389
5 3 -0.76606
5 4 -0.73465
5 5 0.84788
5 6 0.47175
5 7 0.53173
5 8 -0.11972
5 9 0.21588
5 10 -0.46452
6 1 -0.7283
6 2 -0.70479
6 3 -1.1243
6 4 -0.15782
6 5 0.17425
6 6 -0.26241
6 7 1.1181
6 8 -0.15918
6 9 -0.69752
6 10 -0.68888
7 1 -0.56861
7 2 -1.2355
7 3 -0.6948
7 4 0.58936
7 5 0.056865
7 6 0.64748
7 7 -0.58011
7 8 0.070476
7 9 -0.92674
7 10 0.24241
8 1 -0.46411
8 2 -0.44081
8 3 0.54728
8 4 1.5323
8 5 -0.05007
8 6 0.98995
8 7 -0.183
8 8 -0.91211
8 9 0.00081732
8 10 -0.18632
9 1 -0.032806
9 2 0.52061
9 3 1.4889
9 4 0.56336
9 5 -0.18504
9 6 -0.79679
9 7 0.089379
9 8 0.069477
9 9 -0.224
9 10 0.35521
10 1 -0.89194
10 2 0.13515
10 3 0.6474
10 4 0.88063
10 5 -0.68164
10 6 -0.075601
10 7 -0.63008
10 8 0.168
10 9 -0.84589
10 10 0.46715
1 1 0.98109
1 2 1.5317
1 3 0.46533
1 4 0.12393
1 5 -1.5359
1 6 -0.68207
1 7 -1.6462
1 8 -1.4625
1 9 -1.9343
1 10 -2.3259
2 1 -0.30806
2 2 0.15317
2 3 -0.12825
2 4 0.43423
2 5 -0.71407
2 6 -0.11921
2 7 0.019226
2 8 0.35049
2 9 -1.4383
2 10 -1.5044
3 1 -0.12857
3 2 0.488
3 3 0.53606
3 4 1.0531
3 5 -0.29948
3 6 0.23948
3 7 -0.13268
3 8 -0.24308
3 9 -0.95118
3 10 -0.78948
4 1 -0.11342
4 2 -1.0059
4 3 -0.42124
4 4 -0.34023
4 5 0.078659
4 6 0.88902
4 7 0.23341
4 8 -0.15338
4 9 -0.59989
4 10 -0.89918
5 1 0.16374
5 2 -0.26299
5 3 0.77992
5 4 1.0819
5 5 0.7238
5 6 -0.42438
5 7 -0.19448
5 8 0.08083
5 9 0.48362
5 10 -0.11019
6 1 0.4394
6 2 0.040646
6 3 0.10204
6 4 0.23335
6 5 0.85101
6 6 -0.15969
6 7 -0.11772
6 8 1.4047
6 9 1.591
6 10 0.91408
7 1 0.15331
7 2 -0.61206
7 3 -0.47657
7 4 0.71106
7 5 0.0081887
7 6 -0.040958
7 7 1.0739
7 8 1.175
7 9 1.2231
7 10 0.42095
8 1 0.63768
8 2 0.22313
8 3 0.10201
8 4 0.91221
8 5 -0.2826
8 6 0.53168
8 7 0.043632
8 8 0.12458
8 9 1.1582
8 10 1.036
9 1 -0.83108
9 2 0.31008
9 3 -0.47923
9 4 -0.39486
9 5 0.51966
9 6 0.024501
9 7 0.5772
9 8 -0.18336
9 9 0.51455
9 10 0.99499
10 1 -0.40089
10 2 0.32306
10 3 -0.3433
10 4 0.0047221
10 5 -0.21988
10 6 -0.87257
10 7 -0.22983
10 8 -1.0848
10 9 0.23949
10 10 -0.53886
1 1 -0.89999
1 2 -0.60765
1 3 -1.3965
1 4 -1.1678
1 5 0.50079
1 6 0.7848
1 7 0.31866
1 8 0.33285
1 9 -0.057325
1 10 0.91442
2 1 -1.6385
2 2 -0.66963
2 3 -1.1245
2 4 -0.14442
2 5 0.98717
2 6 0.17885
2 7 0.077735
2 8 -0.22889
2 9 -0.38144
2 10 -0.07872
3 1 -0.77031
3 2 -0.24496
3 3 -0.76457
3 4 -0.74676
3 5 -0.50832
3 6 0.78217
3 7 0.62673
3 8 0.39
3 9 0.065218
3 10 0.488
4 1 0.73499
4 2 -0.22049
4 3 -0.59947
4 4 1.237
4 5 0.95703
4 6 -0.024532
4 7 0.86404
4 8 0.44883
4 9 0.1068
4 10 0.35538
5 1 -0.39373
5 2 0.72013
5 3 0.95173
5 4 0.5653
5 5 1.0025
5 6 -0.1623
5 7 -0.33946
5 8 0.77085
5 9 -0.34686
5 10 0.84909
6 1 0.45291
6 2 1.6368
6 3 0.49003
6 4 1.044
6 5 1.1733
6 6 0.96909
6 7 1.17
6 8 0.789
6 9 0.95848
6 10 0.6586
7 1 0.92626
7 2 1.336
7 3 1.0835
7 4 0.27797
7 5 0.96565
7 6 0.67386
7 7 0.13545
7 8 0.33533
7 9 1.9113
7 10 0.72334
8 1 0.62559
8 2 0.95157
8 3 1.2696
8 4 1.01
8 5 0.75892
8 6 1.1327
8 7 1.0734
8 8 1.5875
8 9 0.27577
8 10 0.52487
9 1 1.3763
9 2 1.1715
9 3 0.33185
9 4 0.7078
9 5 1.7302
9 6 1.6211
9 7 1.2113
9 8 0.28632
9 9 1.4362
9 10 0.05508
10 1 1.6734
10 2 2.0098
10 3 1.3373
10 4 1.9932
10 5 1.6035
10 6 2.3012
10 7 1.4291
10 8 1.1221
10 9 0.66535
10 10 0.92711
1 1 -0.99997
1 2 0.022719
1 3 -0.31203
1 4 0.18867
1 5 0.92715
1 6 1.1044
1 7 0.76145
1 8 -0.17697
1 9 0.25073
1 10 0.31083
2 1 -0.66634
2 2 -1.0159
2 3 -0.72899
2 4 0.32125
2 5 0.54591
2 6 1.1202
2 7 0.64981
2 8 0.03742
2 9 0.77014
2 10 0.012899
3 1 -1.2878
3 2 -1.0884
3 3 -1.0713
3 4 0.22714
3 5 0.36626
3 6 0.20953
3 7 0.14857
3 8 1.3116
3 9 1.2593
3 10 0.65079
4 1 -0.80787
4 2 -0.048305
4 3 -0.87667
4 4 -0.24298
4 5 0.055799
4 6 0.46683
4 7 -0.48911
4 8 -1.1424
4 9 -0.38136
4 10 -1.1061
5 1 -0.27704
5 2 -0.13177
5 3 -0.53845
5 4 -1.1699
5 5 -0.32735
5 6 -0.42001
5 7 0.19617
5 8 0.42689
5 9 -0.13028
5 10 -0.19488
6 1 -0.38319
6 2 0.1336
6 3 -0.49355
6 4 0.14656
6 5 -0.80513
6 6 0.65367
6 7 0.2069
6 8 0.13485
6 9 -0.26875
6 10 0.34008
7 1 -0.62224
7 2 -0.71156
7 3 0.40706
7 4 -0.51364
7 5 -0.045004
7 6 -1.1103
7 7 -1.0858
7 8 0.11086
7 9 -0.97742
7 10 -0.014179
8 1 -1.631
8 2 0.25644
8 3 -0.07203
8 4 0.019954
8 5 -0.78594
8 6 -1.2284
8 7 -0.59174
8 8 -0.29216
8 9 -0.087709
8 10 0.033502
9 1 -1.2977
9 2 -0.18927
9 3 0.67041
9 4 -1.6209
9 5 -0.28613
9 6 -0.025997
9 7 -0.30618
9 8 -1.2943
9 9 -1.587
9 10 -1.9803
10 1 0.46204
10 2 0.074855
10 3 -0.2965
10 4 -0.14154
10 5 -1.1861
10 6 -0.47409
10 7 0.46038
10 8 -0.34689
10 9 -0.80103
10 10 -1.8803
1 1 1.3411
1 2 1.4873
1 3 0.94437
1 4 1.7851
1 5 0.080725
1 6 0.41006
1 7 0.41028
1 8 -0.12254
1 9 0.26331
1 10 -0.42256
2 1 1.2357
2 2 0.32614
2 3 -0.163
2 4 0.98255
2 5 0.72907
2 6 0.31425
2 7 0.45023
2 8 0.26328
2 9 0.029089
2 10 0.95292
3 1 1.073
3 2 1.3613
3 3 0.1275
3 4 0.2476
3 5 0.2768
3 6 0.10945
3 7 0.097306
3 8 -0.39726
3 9 0.33722
3 10 0.061228
4 1 0.48769
4 2 0.78546
4 3 0.84834
4 4 0.97745
4 5 0.42715
4 6 0.077498
4 7 0.01148
4 8 -0.37943
4 9 -1.2956
4 10 0.23022
5 1 1.1574
5 2 0.71203
5 3 1.0309
5 4 1.9035
5 5 0.66869
5 6 0.46976
5 7 -0.31242
5 8 -1.0098
5 9 -0.16017
5 10 -0.055089
6 1 -1.4935
6 2 0.0068701
6 3 0.76397
6 4 0.13412
6 5 -0.36506
6 6 -0.093885
6 7 -0.46345
6 8 0.45901
6 9 -0.3404
6 10 -0.45926
7 1 -0.86785
7 2 -0.1634
7 3 0.043536
7 4 0.62364
7 5 -0.38783
7 6 1.2379
7 7 0.36635
7 8 -0.27407
7 9 0.53955
7 10 0.26264
8 1 -0.49472
8 2 0.33707
8 3 0.34908
8 4 0.39176
8 5 0.49744
8 6 -0.024764
8 7 0.13152
8 8 0.83401
8 9 0.3669
8 10 0.65591
9 1 0.26119
9 2 0.96254
9 3 0.53369
9 4 -0.38361
9 5 -0.31952
9 6 -0.032861
9 7 0.42385
9 8 0.60828
9 9 0.94206
9 10 0.65124
10 1 0.58401
10 2 0.28137
10 3 0.75139
10 4 0.66865
10 5 -0.61473
10 6 0.14
10 7 -0.44916
10 8 -0.41535
10 9 0.072928
10 10 -0.34029
1 1 -1.5582
1 2 -1.9252
1 3 -1.3097
1 4 -2.6259
1 5 -0.86581
1 6 -1.8963
1 7 0.58395
1 8 0.48188
1 9 2.882
1 10 3.7548
2 1 -1.2683
2 2 -1.3114
2 3 -1.1344
2 4 -1.2372
2 5 -1.4385
2 6 -0.38154
2 7 0.21844
2 8 1.2685
2 9 2.0933
2 10 1.6789
3 1 -0.67296
3 2 -0.46436
3 3 -1.1013
3 4 -0.75914
3 5 -0.49573
3 6 -0.071953
3 7 -0.36423
3 8 0.2675
3 9 1.2086
3 10 1.4457
4 1 0.59226
4 2 0.35089
4 3 1.0304
4 4 0.91696
4 5 0.93319
4 6 0.2622
4 7 -0.46816
4 8 0.87504
4 9 0.73656
4 10 0.89449
5 1 0.74513
5 2 0.73003
5 3 1.0218
5 4 0.74639
5 5 0.70416
5 6 -0.29666
5 7 -0.74854
5 8 0.78541
5 9 0.42556
5 10 1.0588
6 1 0.019868
6 2 0.17096
6 3 0.31712
6 4 0.37095
6 5 0.51432
6 6 -0.67542
6 7 -1.0559
6 8 -0.27615
6 9 0.63227
6 10 1.8216
7 1 0.11227
7 2 1.2998
7 3 1.361
7 4 0.84188
7 5 -0.20492
7 6 -0.32484
7 7 -0.58076
7 8 -0.16101
7 9 0.80934
7 10 0.35618
8 1 -0.59692
8 2 1.0501
8 3 0.42325
8 4 -0.78226
8 5 -0.0093265
8 6 0.49451
8 7 -0.57139
8 8 -0.71568
8 9 -1.0949
8 10 -1.322
9 1 -0.3825
9 2 -0.43926
9 3 -0.45886
9 4 0.18823
9 5 0.36943
9 6 -0.01429
9 7 -0.9238
9 8 -0.81771
9 9 -0.58659
9 10 -0.56081
10 1 -1.4616
10 2 -0.83716
10 3 0.83614
10 4 0.28808
10 5 -0.12755
10 6 -1.0188
10 7 -1.2117
10 8 -0.21896
10 9 -1.3982
10 10 -1.9128
1 1 1.5017
1 2 1.1149
1 3 1.5846
1 4 0.49772
1 5 1.6667
1 6 -0.1268
1 7 0.12223
1 8 -0.17968
1 9 0.41108
1 10 1.5414
2 1 0.46015
2 2 -0.18267
2 3 0.18842
2 4 -0.073743
2 5 0.89561
2 6 -0.18944
2 7 0.094503
2 8 0.11414
2 9 0.75025
2 10 0.64978
3 1 0.020306
3 2 -0.25737
3 3 -1.135
3 4 -0.35354
3 5 -0.001421
3 6 -0.12285
3 7 -0.61034
3 8 -0.25232
3 9 0.005621
3 10 -1.3972
4 1 -0.76662
4 2 -0.49325
4 3 -0.76528
4 4 -2.3272
4 5 -0.32207
4 6 0.08859
4 7 0.31069
4 8 0.75689
4 9 -0.36381
4 10 0.10409
5 1 -0.80493
5 2 -0.90191
5 3 -0.64442
5 4 -1.4952
5 5 -0.32429
5 6 -0.017915
5 7 -0.30078
5 8 -0.090466
5 9 1.2656
5 10 0.74413
6 1 0.16902
6 2 0.052467
6 3 -0.23645
6 4 -0.19061
6 5 0.15529
6 6 -0.57483
6 7 -1.1003
6 8 -0.47875
6 9 0.17602
6 10 -0.70837
7 1 0.092632
7 2 -0.73462
7 3 -0.3454
7 4 -0.82274
7 5 -0.51007
7 6 -0.51348
7 7 -1.7752
7 8 -0.58945
7 9 0.30645
7 10 -0.50629
8 1 -0.15482
8 2 -0.4444
8 3 0.1943
8 4 -0.94296
8 5 -0.67503
8 6 -0.7453
8 7 -1.4938
8 8 -0.80872
8 9 -0.052597
8 10 -1.0797
9 1 -0.76072
9 2 0.034279
9 3 0.035288
9 4 -0.47851
9 5 -0.9365
9 6 -0.56425
9 7 -0.75692
9 8 -0.72401
9 9 -0.52698
9 10 -1.2094
10 1 -1.2616
10 2 -0.85022
10 3 -1.2871
10 4 0.61099
10 5 0.058311
10 6 -0.67977
10 7 -0.56729
10 8 -0.97489
10 9 -0.74104
10 10 -0.85617
1 1 -0.81706
1 2 -0.65906
1 3 -0.20288
1 4 0.0097926
1 5 0.74292
1 6 0.31406
1 7 -0.16505
1 8 -0.93741
1 9 -0.22614
1 10 -0.92806
2 1 -0.55144
2 2 -0.059045
2 3 0.095708
2 4 -0.32775
2 5 -0.05043
2 6 -0.90495
2 7 -0.56643
2 8 -0.44872
2 9 -0.5734
2 10 -1.2869
3 1 -0.32205
3 2 -0.49441
3 3 -0.67451
3 4 0.22427
3 5 -0.63732
3 6 -1.7795
3 7 -1.3172
3 8 0.058403
3 9 -0.87751
3 10 -1.176
4 1 0.11018
4 2 -0.67382
4 3 -0.39696
4 4 0.1598
4 5 0.11349
4 6 -0.17633
4 7 -1.0084
4 8 -0.69774
4 9 -0.84491
4 10 -1.569
5 1 0.28874
5 2 -0.28612
5 3 -0.91938
5 4 0.0042778
5 5 0.65028
5 6 0.20493
5 7 -0.23058
5 8 -0.92533
5 9 -1.3078
5 10 -0.050186
6 1 0.82354
6 2 -0.014977
6 3 -0.73324
6 4 0.39265
6 5 -0.10154
6 6 0.43223
6 7 -0.44831
6 8 -0.31979
6 9 -0.37283
6 10 0.035346
7 1 1.1923
7 2 0.95413
7 3 0.98179
7 4 0.39208
7 5 -0.28378
7 6 -1.3313
7 7 -1.5069
7 8 -1.0779
7 9 -0.62778
7 10 1.8462
8 1 0.68447
8 2 1.1256
8 3 -0.1701
8 4 0.85436
8 5 -0.0047328
8 6 -0.66924
8 7 -0.34008
8 8 -0.43798
8 9 -0.47153
8 10 -0.11979
9 1 1.1134
9 2 1.5582
9 3 0.49476
9 4 0.46428
9 5 0.9354
9 6 0.84867
9 7 0.75609
9 8 -1.0049
9 9 -0.45265
9 10 -0.74576
10 1 -0.27515
10 2 0.35115
10 3 1.1861
10 4 0.98898
10 5 0.21486
10 6 -0.83618
10 7 0.015597
10 8 -0.83299
10 9 -0.2658
10 10 0.061564
1 1 1.0847
1 2 1.9526
1 3 1.4559
1 4 1.2725
1 5 0.11601
1 6 -0.55716
1 7 -1.1344
1 8 -0.92588
1 9 0.14647
1 10 -0.54407
2 1 1.8636
2 2 1.044
2 3 -0.053585
2 4 0.32422
2 5 -0.17135
2 6 -0.16723
2 7 -1.0589
2 8 -0.2573
2 9 -0.2436
2 10 -0.86413
3 1 1.4981
3 2 0.66796
3 3 -0.010454
3 4 0.016212
3 5 -0.23302
3 6 -0.59975
3 7 -1.7644
3 8 -0.51085
3 9 -0.3481
3 10 -2.3364
4 1 1.2338
4 2 0.59601
4 3 0.10002
4 4 -0.57298
4 5 0.27338
4 6 -0.63656
4 7 -0.70863
4 8 -1.3946
4 9 -0.85695
4 10 -1.4846
5 1 1.0698
5 2 0.397
5 3 1.1341
5 4 0.90212
5 5 0.52142
5 6 -0.24757
5 7 -0.71933
5 8 -1.2248
5 9 -1.0037
5 10 -1.4199
6 1 0.697
6 2 0.67897
6 3 -0.037977
6 4 0.42927
6 5 0.73508
6 6 0.46973
6 7 -0.77912
6 8 -1.5954
6 9 0.078578
6 10 -1.1593
7 1 -0.88098
7 2 0.35062
7 3 0.16084
7 4 0.41738
7 5 0.74172
7 6 0.46485
7 7 0.075388
7 8 -0.84538
7 9 -0.53554
7 10 -1.5093
8 1 0.58167
8 2 0.16468
8 3 0.34762
8 4 0.16298
8 5 -0.27006
8 6 0.08014
8 7 1.5419
8 8 0.27913
8 9 -0.69523
8 10 -0.48911
9 1 0.7055
9 2 0.078586
9 3 -0.28458
9 4 -0.37242
9 5 -0.21641
9 6 -0.34865
9 7 0.85598
9 8 0.18734
9 9 0.22394
9 10 1.0592
10 1 -0.092963
10 2 1.3653
10 3 1.2755
10 4 -0.14577
10 5 -0.36608
10 6 -0.0095181
10 7 0.47785
10 8 0.49047
10 9 0.52567
10 10 1.3327
1 1 0.084506
1 2 -0.13379
1 3 -0.47491
1 4 -0.043682
1 5 -0.65521
1 6 -0.052312
1 7 -0.12092
1 8 -1.0912
1 9 -0.66403
1 10 0.08132
2 1 -0.045233
2 2 0.48315
2 3 0.096673
2 4 -0.33502
2 5 -0.52595
2 6 -0.68735
2 7 -0.34867
2 8 -1.2754
2 9 -1.3937
2 10 -0.4887
3 1 -0.31061
3 2 -0.022152
3 3 0.47162
3 4 0.20441
3 5 0.059868
3 6 -0.2901
3 7 -0.4409
3 8 -1.1976
3 9 -0.73539
3 10 -1.435
4 1 0.30343
4 2 0.11239
4 3 1.8881
4 4 1.2312
4 5 0.45089
4 6 0.084228
4 7 -0.19204
4 8 -1.1114
4 9 -1.7262
4 10 -0.56662
5 1 -0.17351
5 2 0.34411
5 3 0.85914
5 4 0.43333
5 5 0.11873
5 6 0.41948
5 7 0.49702
5 8 -0.67355
5 9 -0.71335
5 10 -0.56962
6 1 -0.72632
6 2 0.182
6 3 0.29566
6 4 0.21552
6 5 -0.46146
6 6 -0.059419
6 7 0.11557
6 8 -1.0477
6 9 -0.29064
6 10 -1.2339
7 1 -0.27475
7 2 1.0619
7 3 0.40953
7 4 -0.050585
7 5 0.00087871
7 6 0.40448
7 7 -0.25119
7 8 -0.41342
7 9 -0.133
7 10 -0.28252
8 1 0.23176
8 2 2.0917
8 3 1.5435
8 4 0.075721
8 5 -0.10405
8 6 -0.063779
8 7 1.1413
8 8 0.40685
8 9 -0.58853
8 10 -0.49277
9 1 0.04969
9 2 1.481
9 3 0.69981
9 4 0.14286
9 5 0.065013
9 6 -0.37731
9 7 0.40477
9 8 0.68332
9 9 -0.18014
9 10 -1.6154
10 1 0.30045
10 2 -0.43197
10 3 0.20984
10 4 0.40885
10 5 -0.012176
10 6 0.012924
10 7 -0.97699
10 8 0.25918
10 9 -1.2407
10 10 -2.4877
1 1 1.9568
1 2 1.4
1 3 0.43733
1 4 -0.43196
1 5 -0.16741
1 6 0.1497
1 7 0.21556
1 8 1.1755
1 9 1.531
1 10 1.9811
2 1 1.0004
2 2 0.50312
2 3 0.57932
2 4 0.34859
2 5 0.35882
2 6 0.5033
2 7 -0.30434
2 8 0.53376
2 9 0.88751
2 10 0.82788
3 1 0.28532
3 2 -0.68586
3 3 0.13507
3 4 0.0048657
3 5 -0.12591
3 6 -0.32573
3 7 0.17317
3 8 0.67218
3 9 -0.68763
3 10 0.35134
4 1 -0.31966
4 2 -0.51346
4 3 0.26837
4 4 -0.037354
4 5 0.45119
4 6 -0.57281
4 7 -0.11622
4 8 0.076975
4 9 0.60791
4 10 0.66343
5 1 0.18332
5 2 0.2538
5 3 0.34382
5 4 0.5546
5 5 0.21333
5 6 0.80252
5 7 0.47662
5 8 1.1387
5 9 0.39022
5 10 0.76584
6 1 -0.63939
6 2 0.47384
6 3 -0.67462
6 4 0.3125
6 5 0.70997
6 6 0.59881
6 7 0.99534
6 8 1.1245
6 9 0.6379
6 10 0.3624
7 1 0.11995
7 2 -0.78728
7 3 -0.13309
7 4 -0.38062
7 5 0.43758
7 6 0.029345
7 7 0.40294
7 8 -0.32999
7 9 0.83065
7 10 0.85057
8 1 1.3007
8 2 0.66175
8 3 1.1035
8 4 0.26512
8 5 0.15
8 6 0.67162
8 7 0.60928
8 8 1.1583
8 9 0.86711
8 10 0.052528
9 1 0.72511
9 2 0.83225
9 3 1.4767
9 4 1.2465
9 5 0.62551
9 6 0.18133
9 7 0.54219
9 8 0.61455
9 9 0.069688
9 10 0.91685
10 1 0.87253
10 2 2.1886
10 3 1.4976
10 4 1.3471
10 5 1.614
10 6 0.81966
10 7 0.4422
10 8 -0.011136
10 9 -0.6524
10 10 -0.39135
1 1 1.0954
1 2 0.68865
1 3 0.31133
1 4 -0.47359
1 5 0.16099
1 6 1.3591
1 7 -0.32577
1 8 -0.13171
1 9 0.62947
1 10 0.44251
2 1 0.92282
2 2 0.91816
2 3 0.76012
2 4 0.24178
2 5 -0.068355
2 6 0.25886
2 7 0.22525
2 8 -0.79252
2 9 0.14529
2 10 1.1726
3 1 0.38776
3 2 0.068483
3 3 0.058235
3 4 0.24309
3 5 -0.45677
3 6 0.51896
3 7 1.3932
3 8 0.64736
3 9 0.48068
3 10 0.74987
4 1 0.30978
4 2 -0.098167
4 3 -0.10243
4 4 -0.060663
4 5 0.66854
4 6 0.11733
4 7 1.2778
4 8 0.21566
4 9 0.46415
4 10 0.63132
5 1 0.22002
5 2 0.27927
5 3 0.39181
5 4 1.0721
5 5 0.8424
5 6 -0.75326
5 7 -0.1773
5 8 0.31369
5 9 0.78829
5 10 0.86142
6 1 0.60782
6 2 1.1523
6 3 -0.24421
6 4 -0.70425
6 5 -0.91406
6 6 -0.25592
6 7 -0.31783
6 8 0.90311
6 9 1.0813
6 10 1.6632
7 1 0.23327
7 2 0.13924
7 3 0.24131
7 4 -0.75094
7 5 0.16098
7 6 0.58843
7 7 0.14414
7 8 1.1983
7 9 1.2397
7 10 1.282
8 1 0.054621
8 2 0.96913
8 3 1.1722
8 4 0.88584
8 5 0.43832
8 6 0.35612
8 7 0.14986
8 8 0.2759
8 9 0.561
8 10 0.1761
9 1 0.47944
9 2 1.237
9 3 1.5481
9 4 0.66968
9 5 -0.3433
9 6 0.0070064
9 7 -0.66577
9 8 0.091003
9 9 0.47818
9 10 0.062905
10 1 1.0756
10 2 0.84519
10 3 1.2029
10 4 0.63381
10 5 -0.20783
10 6 0.23517
10 7 0.29097
10 8 -0.29507
10 9 0.0818
10 10 -0.061862
1 1 -0.60204
1 2 0.65
1 3 -0.33662
1 4 -0.26463
1 5 0.65212
1 6 -0.6876
1 7 -0.94691
1 8 -1.0972
1 9 -0.19294
1 10 -0.28093
2 1 -0.87526
2 2 -0.081139
2 3 -0.87035
2 4 -0.74718
2 5 -0.26173
2 6 -1.1377
2 7 -0.81349
2 8 0.013986
2 9 -0.56303
2 10 0.033915
3 1 -0.80039
3 2 -0.38038
3 3 -0.14681
3 4 -1.3574
3 5 -1.1031
3 6 -0.53416
3 7 -0.71843
3 8 -0.30968
3 9 -0.17786
3 10 -0.32835
4 1 0.073412
4 2 -0.21385
4 3 -0.2436
4 4 -0.59427
4 5 0.10118
4 6 -0.92508
4 7 0.32233
4 8 -0.038958
4 9 0.074636
4 10 -0.7109
5 1 0.626
5 2 -0.48074
5 3 -0.71395
5 4 -1.6909
5 5 -0.56445
5 6 -0.83992
5 7 0.0088717
5 8 -0.34586
5 9 -0.17763
5 10 0.85025
6 1 0.72631
6 2 -0.83441
6 3 -0.85932
6 4 -1.2019
6 5 -0.3461
6 6 -0.52261
6 7 -0.2188
6 8 0.1562
6 9 0.1176
6 10 -0.0045701
7 1 0.90036
7 2 -0.66526
7 3 -1.5311
7 4 -0.70255
7 5 -0.39794
7 6 0.20198
7 7 0.45935
7 8 0.4518
7 9 0.82838
7 10 0.76867
8 1 0.16852
8 2 -0.63111
8 3 -1.1804
8 4 -0.69962
8 5 0.05342
8 6 0.16314
8 7 0.59872
8 8 -0.12264
8 9 -0.73362
8 10 0.057699
9 1 0.64873
9 2 -0.052743
9 3 -0.5923
9 4 -0.2954
9 5 -0.74368
9 6 0.32805
9 7 0.079574
9 8 -0.63894
9 9 -0.21909
9 10 0.64924
10 1 0.17714
10 2 -1.1491
10 3 -0.45945
10 4 -0.85382
10 5 1.4735
10 6 -0.029148
10 7 -0.4445
10 8 -0.72929
10 9 -0.10109
10 10 -0.027009
$\endgroup$

1 Answer 1

1
$\begingroup$

Indeed the empirical correlations you mentioned will be the 'raw data' to which a parametric correlation function is fit. In spatial statistics this is referred to as the 'variogram'. As you suggest, you are able to: 1) pair the data; 2) put the pairs into distance bins; and 3) calculate correlations at each distance. This gives you empirical correlations as a function of distance - i.e. the empirical variogram. Now you have a scatterplot of points to which you can fit a Gaussian or exponential curve. It is common to try a few and see which one minimizes the error or the AIC/BIC, etc. See a basic example here which uses the R packages sp and gstat. In these packages the pairing/binning is handled for you.

$\endgroup$
9
  • 1
    $\begingroup$ I need to fit the correlogram and get the params of the correlogram. How can I do it? $\endgroup$
    – user34790
    Aug 2, 2013 at 14:23
  • $\begingroup$ I suspect you mean 'variogram'. The variogram refers to autocorrelation in space and correlogram refers to autocorrelation in time. They do the same thing but are approached differently, so you should be clear what you are referring to.. That aside, the note I linked gives you basic directions on how to fit a variogram and estimate the parameters using an R package. There are really two steps: 1) find the empirical variogram which will give you a scatterplot of correlation vs. distance; and 2) fit a parametric curve to the scatterplot. This can be done using nls in R. $\endgroup$ Aug 2, 2013 at 14:38
  • $\begingroup$ I want correlogram. Autocorrelation in space $\endgroup$
    – user34790
    Aug 2, 2013 at 14:45
  • $\begingroup$ variogram starts with zero at perfect condition while correlogram starts with 1 at origin. So I want the opposite of variorum $\endgroup$
    – user34790
    Aug 2, 2013 at 14:58
  • $\begingroup$ I guess using the fitted variogram, the params that I get like exponential model, sill, nugget and range. I can use the exact model to generate a correlation function. They are basically same if I am correct. However, sill in case of correlogram will be like 0. However in variogram it will be like 1 $\endgroup$
    – user34790
    Aug 2, 2013 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.