[Robast-commits] r632 - in branches/robast-0.9/pkg: RobExtremes/R RobExtremesBuffer

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 13 18:38:24 CET 2013


Author: ruckdeschel
Date: 2013-03-13 18:38:23 +0100 (Wed, 13 Mar 2013)
New Revision: 632

Added:
   branches/robast-0.9/pkg/RobExtremesBuffer/interpolRisk-Test.R
Modified:
   branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
Log:
+ removed a chatty comment in GEVFamily.R
+ created a test function for LM interpolation and put it into RobExtremesBuffer/interpolRisk-Test.R
  => Gerald: could you make a formal unit test out of it ?

Modified: branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-03-13 16:31:08 UTC (rev 631)
+++ branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-03-13 17:38:23 UTC (rev 632)
@@ -229,7 +229,7 @@
            if(!is.null(names(e0)))
                e0 <- e0[c("scale", "shape")]
         }
-        print(e0); print(str(x)); print(head(summary(x))); print(mu)
+#        print(e0); print(str(x)); print(head(summary(x))); print(mu)
         if(any(x < mu-e0["scale"]/e0["shape"]))
                stop("some data smaller than 'loc-scale/shape' ")
 

Added: branches/robast-0.9/pkg/RobExtremesBuffer/interpolRisk-Test.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremesBuffer/interpolRisk-Test.R	                        (rev 0)
+++ branches/robast-0.9/pkg/RobExtremesBuffer/interpolRisk-Test.R	2013-03-13 17:38:23 UTC (rev 632)
@@ -0,0 +1,53 @@
+####################################################
+### Tests fuer InterpolRisiken
+####################################################
+PFam <- NULL
+mytest <- function(PF = GParetoFamily, xi = 0.5, seed=130313){
+   PFam <<- PF(shape=xi,scale=1)
+   cat("\n\n\n---------------------------------\n")
+   cat("  ", name(PFam),"  ")
+   cat("\n---------------------------------\n")
+   set.seed(seed)
+   dat0 <- r(PFam)(100)
+   print(head(dat0))
+   cat("\n\n\n---------------------------------\n")
+   cat("RMXE")
+   cat("\n---------------------------------\n")
+   try({
+   print(system.time({re1<-robest(dat0,PFam,risk=RMXRRisk())}))
+   print(re1)
+   print(checkIC(pIC(re1)))
+   },silent=TRUE)
+   cat("\n\n\n---------------------------------\n")
+   cat("OMSE")
+   cat("\n---------------------------------\n")
+   try({
+   system.time(re2<-robest(dat0,PFam,risk=OMSRRisk()))
+   print(re2)
+   print(checkIC(pIC(re2)))
+   },silent=TRUE)
+   cat("\n\n\n---------------------------------\n")
+   cat("MBRE")
+   cat("\n---------------------------------\n")
+   try({
+   system.time(re3<-robest(dat0,PFam,risk=MBRRisk()))
+   print(re3)
+   print(checkIC(pIC(re3)))
+   },silent=TRUE)
+}
+mytest(PF=GParetoFamily)
+mytest(PF=GEVFamily)
+mytest(PF=GammaFamily)
+mytest(PF=WeibullFamily)
+mytest(PF=GParetoFamily,xi=1)
+mytest(PF=GEVFamily,xi=1)
+mytest(PF=GammaFamily,xi=1)
+mytest(PF=WeibullFamily,xi=1)
+mytest(PF=GParetoFamily,xi=0.1)
+mytest(PF=GEVFamily,xi=0.1)
+mytest(PF=GammaFamily,xi=0.1)
+mytest(PF=WeibullFamily,xi=0.1)
+mytest(PF=GParetoFamily,xi=10)
+mytest(PF=GEVFamily,xi=10)
+mytest(PF=GammaFamily,xi=10)
+mytest(PF=WeibullFamily,xi=10)



More information about the Robast-commits mailing list