[Robast-commits] r553 - in branches/robast-0.9/pkg/RobExtremes: R inst/AddMaterial/interpolation

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 24 23:07:01 CET 2013


Author: ruckdeschel
Date: 2013-01-24 23:07:01 +0100 (Thu, 24 Jan 2013)
New Revision: 553

Modified:
   branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R
   branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationscripts.R
Log:
RobExtremes: inserted scripts for generating interpol grids for GEVD Weibull Gamma

Modified: branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R	2013-01-24 20:25:57 UTC (rev 552)
+++ branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R	2013-01-24 22:07:01 UTC (rev 553)
@@ -108,7 +108,7 @@
   if(missing(sysRdaFolder)) stop("You must specify argument 'sysRdaFolder'.")
 
   if(missing(GridFileName))
-    GridFileName <- paste(sub("^\\.(.+)","\\1"),".Rdata",sep="")
+     GridFileName <- paste(sub("^\\.(.+)","\\1",nameInSysdata),".Rdata",sep="")
   newEnv <- new.env()
   sysdataFile <- file.path(sysRdaFolder,"sysdata.rda")
   cat("sysdataFile = ", sysdataFile, "\n")
@@ -120,7 +120,7 @@
 
   cat("whatIsThereAlready = ", head(whatIsThereAlready), "\n")
 
-  if(exists(.versionSuff(nameInSysdata),envir=newEnv)){
+  if(exists(.versionSuff(nameInSysdata),envir=newEnv,inherits=FALSE)){
     InterpGrids <- get(.versionSuff(nameInSysdata), envir=newEnv)
     namesInterpGrids <- names(InterpGrids)
     cat(gettext("Names of existing grids:\n"))

Modified: branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationscripts.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationscripts.R	2013-01-24 20:25:57 UTC (rev 552)
+++ branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationscripts.R	2013-01-24 22:07:01 UTC (rev 553)
@@ -10,10 +10,12 @@
                 sysRdaFolder = .myFolder, accuracy = 5000,upp=10)
 
 ### produce LM grids
+.saveInterpGrid <- RobExtremes:::.saveInterpGrid
 .svInt <- RobExtremes:::.svInt
 .OMSE.xi <- RobExtremes:::.OMSE.xi
 .MBRE.xi <- RobExtremes:::.MBRE.xi
 .RMXE.xi <- RobExtremes:::.RMXE.xi
+.modify.xi.PFam.call <- RobExtremes:::.modify.xi.PFam.call
 .svInt(.OMSE.xi, ".OMSE", sysRdaFolder = .myFolder)
 .svInt(.MBRE.xi, ".MBRE", sysRdaFolder = .myFolder)
 .svInt(.RMXE.xi, ".RMXE", sysRdaFolder = .myFolder)
@@ -36,3 +38,97 @@
 require(RobExtremes); RobExtremes:::.recomputeInterpolators("sysdata.rda", sysRdaFolder = ".")
 fct <- getFromNamespace(".OMSE.N", "RobExtremes")[[1]]$fct
 fct[[1]](2);fct[[2]](2)
+
+
+#############################################################################
+### GEVD
+#############################################################################
+## on R-3.0.0
+require(RobExtremes)
+.basepath <- "C:/rtest/RobASt/branches/robast-0.9/pkg"
+.saveInterpGrid <- RobExtremes:::.saveInterpGrid
+.svInt <- RobExtremes:::.svInt
+.OMSE.xi <- RobExtremes:::.OMSE.xi
+.MBRE.xi <- RobExtremes:::.MBRE.xi
+.RMXE.xi <- RobExtremes:::.RMXE.xi
+.modify.xi.PFam.call <- RobExtremes:::.modify.xi.PFam.call
+.myFolder <- file.path(.basepath,"RobExtremes/R")
+.myFolder1 <- file.path(.basepath,"RobExtremesBuffer/tmp1")
+.myFolder2 <- file.path(.basepath,"RobExtremesBuffer/tmp2")
+.myFolder3 <- file.path(.basepath,"RobExtremesBuffer/tmp3")
+PF <- GEVFamily()
+.saveInterpGrid(getShapeGrid(gridsize=500, cutoff.at.0=0.005),
+                sysRdaFolder = .myFolder, accuracy = 5000,upp=10,
+                PFam = PF)
+## to make this parallel, we write the results to different folders:
+.svInt(.OMSE.xi, ".OMSE", PFam = PF, sysRdafolder = .myFolder1)
+.svInt(.MBRE.xi, ".MBRE", PFam = PF, sysRdafolder = .myFolder2)
+.svInt(.RMXE.xi, ".RMXE", PFam = PF, sysRdafolder = .myFolder3)
+
+### merge and thin out results on R-3.0.0
+rdafiles <- file.path(c(myFolder,.myFolder1,myFolder2,.myFolder3),"sysdata.rda")
+.recomputeInterpolators("sysdata.rda", sysRdaFolder = myFolder)
+ ## on R-2.15.2
+require(RobExtremes); RobExtremes:::.recomputeInterpolators(.myfiles1, sysRdaFolder = .myfolder2)
+
+#############################################################################
+### Weibull
+#############################################################################
+## on R-3.0.0
+require(RobExtremes)
+.basepath <- "C:/rtest/RobASt/branches/robast-0.9/pkg"
+.saveInterpGrid <- .saveInterpGrid
+.svInt <- RobExtremes:::.svInt
+.OMSE.xi <- RobExtremes:::.OMSE.xi
+.MBRE.xi <- RobExtremes:::.MBRE.xi
+.RMXE.xi <- RobExtremes:::.RMXE.xi
+.modify.xi.PFam.call <- RobExtremes:::.modify.xi.PFam.call
+.myFolder <- file.path(.basepath,"RobExtremes/R")
+.myFolder1 <- file.path(.basepath,"RobExtremesBuffer/tmp1")
+.myFolder2 <- file.path(.basepath,"RobExtremesBuffer/tmp2")
+.myFolder3 <- file.path(.basepath,"RobExtremesBuffer/tmp3")
+PF <- WeibullFamily()
+.saveInterpGrid(getShapeGrid(gridsize=500, cutoff.at.0=0.005),
+                sysRdaFolder = .myFolder, accuracy = 5000,upp=10,
+                PFam = PF)
+## to make this parallel, we write the results to different folders:
+.svInt(.OMSE.xi, ".OMSE", PFam = PF, sysRdafolder = .myFolder1)
+.svInt(.MBRE.xi, ".MBRE", PFam = PF, sysRdafolder = .myFolder2)
+.svInt(.RMXE.xi, ".RMXE", PFam = PF, sysRdafolder = .myFolder3)
+
+### merge and thin out results on R-3.0.0
+rdafiles <- file.path(c(myFolder,.myFolder1,myFolder2,.myFolder3),"sysdata.rda")
+.recomputeInterpolators("sysdata.rda", sysRdaFolder = myFolder)
+ ## on R-2.15.2
+require(RobExtremes); RobExtremes:::.recomputeInterpolators(.myfiles1, sysRdaFolder = .myfolder2)
+
+#############################################################################
+### Gamma
+#############################################################################
+## on R-3.0.0
+require(RobExtremes)
+.saveInterpGrid <- RobExtremes:::.saveInterpGrid
+.svInt <- RobExtremes:::.svInt
+.OMSE.xi <- RobExtremes:::.OMSE.xi
+.MBRE.xi <- RobExtremes:::.MBRE.xi
+.RMXE.xi <- RobExtremes:::.RMXE.xi
+.modify.xi.PFam.call <- RobExtremes:::.modify.xi.PFam.call
+.basepath <- "C:/rtest/RobASt/branches/robast-0.9/pkg"
+.myFolder <- file.path(.basepath,"RobExtremes/R")
+.myFolder1 <- file.path(.basepath,"RobExtremesBuffer/tmp1")
+.myFolder2 <- file.path(.basepath,"RobExtremesBuffer/tmp2")
+.myFolder3 <- file.path(.basepath,"RobExtremesBuffer/tmp3")
+PF <- GammaFamily()
+.saveInterpGrid(getShapeGrid(gridsize=500, cutoff.at.0=0.005),
+                sysRdaFolder = .myFolder, accuracy = 5000,upp=10,
+                PFam = PF)
+## to make this parallel, we write the results to different folders:
+.svInt(.OMSE.xi, ".OMSE", PFam = PF, sysRdafolder = .myFolder1)
+.svInt(.MBRE.xi, ".MBRE", PFam = PF, sysRdafolder = .myFolder2)
+.svInt(.RMXE.xi, ".RMXE", PFam = PF, sysRdafolder = .myFolder3)
+
+### merge and thin out results on R-3.0.0
+rdafiles <- file.path(c(myFolder,.myFolder1,myFolder2,.myFolder3),"sysdata.rda")
+.recomputeInterpolators("sysdata.rda", sysRdaFolder = myFolder)
+ ## on R-2.15.2
+require(RobExtremes); RobExtremes:::.recomputeInterpolators(.myfiles1, sysRdaFolder = .myfolder2)



More information about the Robast-commits mailing list