[Georob-commits] r11 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 9 13:15:07 CEST 2013


Author: papritz
Date: 2013-07-09 13:15:07 +0200 (Tue, 09 Jul 2013)
New Revision: 11

Modified:
   pkg/ChangeLog
   pkg/R/georob.cv.R
   pkg/R/georob.private.functions.R
   pkg/man/cv.georob.Rd
Log:
changes for fitting geometrically anisotropic variogram functions


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2013-07-04 12:40:02 UTC (rev 10)
+++ pkg/ChangeLog	2013-07-09 11:15:07 UTC (rev 11)
@@ -114,3 +114,13 @@
 * georob.private.functions.R (georob.fit, prepare.likelihood.calculations): new transformation of rotation angles
 * georob.S3methods.R (print.georob, summary.georob): new transformation of rotation angles
 * georob.cv.R (cv.georob): passing initial values of aniso and fit.aniso to georob via update
+
+
+2013-07-05  Andreas Papritz  <papritz at env.ethz.ch>
+
+* georob.cv.R (cv.georob): return "variogram.model" as part of 'fit' component
+
+
+2013-07-09  Andreas Papritz  <papritz at env.ethz.ch>
+
+* georob.private.functions.R (georob.fit): catching errors occuring when fitting anisotropic variogram models with default anisotropy parameters

Modified: pkg/R/georob.cv.R
===================================================================
--- pkg/R/georob.cv.R	2013-07-04 12:40:02 UTC (rev 10)
+++ pkg/R/georob.cv.R	2013-07-09 11:15:07 UTC (rev 11)
@@ -77,6 +77,7 @@
   ## 2013-05-24 AP separate initial variogram parameters for each cross-validation set
   ## 2013-06-12 AP substituting [["x"]] for $x in all lists
   ## 2013-07-02 AP passing initial values of aniso and fit.aniso to georob via update
+  ## 2013-07-05 AP return "variogram.model" as part of fit componnent
     
   ## auxiliary function that fits the model and computes the predictions of
   ## a cross-validation set
@@ -165,7 +166,7 @@
       
       t.georob <- t.georob[c(  
         "tuning.psi", "converged", "convergence.code",
-        "gradient", "param", "aniso",
+        "gradient", "variogram.model", "param", "aniso",
         "coefficients"
       )]
       

Modified: pkg/R/georob.private.functions.R
===================================================================
--- pkg/R/georob.private.functions.R	2013-07-04 12:40:02 UTC (rev 10)
+++ pkg/R/georob.private.functions.R	2013-07-09 11:15:07 UTC (rev 11)
@@ -1480,7 +1480,7 @@
     
     NA
   ) / ( hs * alpha^2 )
-  
+    
   ##  partial derivative of scaled lag distance with respect to scale
   ##  parameter
   
@@ -3220,6 +3220,8 @@
   ## 2013-06-12 AP changes in stored items of Valpha object
   ## 2013-06-12 AP substituting [["x"]] for $x in all lists
   ## 2013-07-03 AP new transformation of rotation angles
+  ## 2013-07-09 AP catching errors occuring when fitting anisotropic
+  ##               variograms with default anisotropy parameters
   
   ##  ToDos:
   
@@ -3527,7 +3529,17 @@
   if( aniso["zeta"] < -90. ||  aniso["zeta"] > 90. ) stop(
     "initial value of parameter 'zeta' must be in [-90, 90]" 
   )
-
+  
+  ## adjust default initial values of anisotropy parameters if these are
+  ## fitted
+  
+  if( fit.aniso["omega"] && aniso["f1"] == 1. ) aniso["f1"] <- aniso["f1"] - sqrt( .Machine$double.eps )
+  if( fit.aniso["phi"] ){
+    if( aniso["f1"] == 1. ) aniso["f1"] <- aniso["f1"] - sqrt( .Machine$double.eps )
+    if( aniso["f2"] == 1. ) aniso["f2"] <- aniso["f2"] - sqrt( .Machine$double.eps )
+  }
+  if( fit.aniso["zeta"] && aniso["f2"] == 1. ) aniso["f2"] <- aniso["f2"] - sqrt( .Machine$double.eps )
+  
   ##  rearrange and check flags controlling anisotropy parameter fitting 
   
   fit.aniso <- fit.aniso[aniso.name]

Modified: pkg/man/cv.georob.Rd
===================================================================
--- pkg/man/cv.georob.Rd	2013-07-04 12:40:02 UTC (rev 10)
+++ pkg/man/cv.georob.Rd	2013-07-09 11:15:07 UTC (rev 11)
@@ -1,4 +1,4 @@
-% 2013-07-02 A. Papritz
+% 2013-07-05 A. Papritz
 % R CMD Rdconv -t html -o bla.html cv.georob.Rd ; open bla.html; R CMD Rd2pdf --force cv.georob.Rd; 
 
 \encoding{macintosh}
@@ -180,8 +180,8 @@
   \code{georob}, fitted for the \eqn{K} reduced data set
   (\code{reduced.output = FALSE}), or \eqn{K} lists with the components
   \code{tuning.psi}, \code{converged}, \cr \code{convergence.code},
-  \code{gradient}, \code{param}, \code{aniso$aniso}, \code{coefficients}
-  along with the standard errors of
+  \code{gradient}, \code{variogram.model}, \code{param},
+  \code{aniso$aniso}, \code{coefficients} along with the standard errors of
   \eqn{\widehat{\mbox{\boldmath$\beta$\unboldmath}}}{hat\beta}, see
   \code{\link{georobObject}}.
  



More information about the Georob-commits mailing list