Paul Hiemstra avatar Paul Hiemstra committed 54f0218

Added a warning when a users passes on anisotropy parameters to autofitVariogram.
The function sees the anisotropic sample variogram as one big sample variogram.
So it fits an average isotropic variogram model from the anisotropic sample variogram.
I bring this to the attention of the user via a warning.

Comments (0)

Files changed (3)

 Package: automap
 Version: 1.0-11
-Date: 2010/30/05
+Date: 2011/21/07
 Title: Automatic interpolation package
 Author: Paul Hiemstra <p.hiemstra@geo.uu.nl>
 Maintainer: Paul Hiemstra <p.hiemstra@geo.uu.nl>

R/autofitVariogram.r

                                 miscFitOptions = list(),...)
 # This function automatically fits a variogram to input_data
 {
+    # Check for anisotropy parameters
+    if('alpha' %in% names(list(...))) warning('Anisotropic variogram model fitting not supported, see the documentation of autofitVariogram for more details.')
+
     # Take the misc fit options and overwrite the defaults by the user specified ones
     miscFitOptionsDefaults = list(merge.small.bins = TRUE, min.np.bin = 5)
     miscFitOptions = modifyList(miscFitOptionsDefaults, miscFitOptions)

man/autofitVariogram.rd

 Note that when using the power model, and not specifying starting values yourself, the sill is set to 1, 
 the range to 1 and the nugget to 0. This is because the normal initial values for those paramters don't 
 work well with the power model. I consider this a temporary solution, any suggestions are appreciated.
+
+It is possible to pass anisotropy parameters to \code{autofitVariogram}. However, \code{autofitVariogram} does not fit anisotropic variogram models. The function sees the anisotropic sample variogram as one big sample variogram. So it fits an average isotropic variogram model from the anisotropic sample variogram. A warning is issued when a users passes \code{alpha} to \code{autofitVariogram}.
 }
 \value{An object of type \code{autofitVariogram} is returned. This object contains the experimental variogram, 
 the fitted variogram model and the sums of squares (\code{sserr}) between the sample variogram and the
     miscFitOptions = list(min.np.bin = 500))
 plot(variogram)
 
-# ...and diable the merging, note the difference between the two plots
+# ...and disable 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)
+
+\dontrun{
+# An example of autofitVariogram with anisotropic sample variogram.
+# This is not supported, see details section.
+vm.isotropic = autofitVariogram(log(zinc) ~ dist, meuse)
+vm.anisotropic = autofitVariogram(log(zinc) ~ dist, meuse, alpha = c(0,45,90,135))
 }
+
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.