Commits

Paul Hiemstra committed 886c3e7

Added examples of miscFitOptions to the documentation of
autofitVariogram and to the tests of the automap package

  • Participants
  • Parent commits bccfb20

Comments (0)

Files changed (3)

File man/autofitVariogram.rd

 coordinates(meuse) =~ x+y
 variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse)
 plot(variogram)
+
+# Settings additional fitting options
+variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
+    miscFitOptions = list(merge.small.bins = FALSE))
+plot(variogram)
+
+# Settings the minimum number of pairs per bin quite high
+# to see the effect of merging bins
+variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
+    miscFitOptions = list(min.np.bin = 500))
+plot(variogram)
+
+# ...and diable the merging, note the difference between the two plots
+variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
+    miscFitOptions = list(min.np.bin = 500, merge.small.bins = FALSE))
+plot(variogram)
 }

File tests/automap.R

 data(meuse.grid)
 gridded(meuse.grid) =~ x+y
 
+# Fitting some variograms
+variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
+    miscFitOptions = list(min.np.bin = 500))
+variogram
+
+# ...and diable the merging, note the difference between the two plots
+variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
+    miscFitOptions = list(min.np.bin = 500, merge.small.bins = FALSE))
+variogram
+
 # Ordinary kriging
 kriging_result = autoKrige(zinc~1, meuse, meuse.grid)
 summary(kriging_result)

File tests/automap.Rout.save

 > data(meuse.grid)
 > gridded(meuse.grid) =~ x+y
 > 
+> # Fitting some variograms
+> variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
++     miscFitOptions = list(min.np.bin = 500))
+> variogram
+$exp_var
+    np      dist    gamma dir.hor dir.ver   id
+1  500  174.0355 38065.17       0       0 var1
+2  711  337.6036 50150.73       0       0 var1
+3  830  502.0477 50347.61       0       0 var1
+4 1349  713.2149 61255.29       0       0 var1
+5 1314  961.2718 70311.91       0       0 var1
+6 1139 1213.4116 75870.33       0       0 var1
+7 1355 1506.5505 72043.88       0       0 var1
+
+$var_model
+  model     psill    range kappa
+1   Nug  5294.243    0.000   0.0
+2   Ste 91418.206 1781.654   0.2
+
+$sserr
+[1] 130690.3
+
+attr(,"class")
+[1] "autofitVariogram" "list"            
+> 
+> # ...and diable the merging, note the difference between the two plots
+> variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse, 
++     miscFitOptions = list(min.np.bin = 500, merge.small.bins = FALSE))
+> variogram
+$exp_var
+     np      dist    gamma dir.hor dir.ver   id
+1    17   59.3347 23959.65       0       0 var1
+2    36   86.0145 16671.65       0       0 var1
+3   114  131.0287 33270.31       0       0 var1
+4   149  176.1885 52846.33       0       0 var1
+5   184  226.7565 34555.29       0       0 var1
+6   711  337.6036 50150.73       0       0 var1
+7   830  502.0477 50347.61       0       0 var1
+8  1349  713.2149 61255.29       0       0 var1
+9  1314  961.2718 70311.91       0       0 var1
+10 1139 1213.4116 75870.33       0       0 var1
+11 1355 1506.5505 72043.88       0       0 var1
+
+$var_model
+  model     psill    range kappa
+1   Nug  2454.994   0.0000   0.0
+2   Ste 68746.155 482.0264   0.3
+
+$sserr
+[1] 2044182
+
+attr(,"class")
+[1] "autofitVariogram" "list"            
+> 
 > # Ordinary kriging
 > kriging_result = autoKrige(zinc~1, meuse, meuse.grid)
 [using ordinary kriging]