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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 25 05:05:08 CET 2013


Author: ruckdeschel
Date: 2013-01-25 05:05:08 +0100 (Fri, 25 Jan 2013)
New Revision: 557

Modified:
   branches/robast-0.9/pkg/RobExtremes/R/SnQn.R
   branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationsmanipulations.R
   branches/robast-0.9/pkg/RobExtremes/man/Var.Rd
Log:
RobExtremes: created methods for Sn and Weibull, Gammad and GEV

Modified: branches/robast-0.9/pkg/RobExtremes/R/SnQn.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/SnQn.R	2013-01-25 03:27:21 UTC (rev 556)
+++ branches/robast-0.9/pkg/RobExtremes/R/SnQn.R	2013-01-25 04:05:08 UTC (rev 557)
@@ -117,4 +117,42 @@
            return(ret)
     })
 
+ setMethod("Sn", signature(x = "GEV"),
+    function(x, ...){
+           if(abs(scale(x)-1)< 1e-12){
+#              sng <- .SnGrids
+              sng <- try(getFromNamespace(.versionSuff(".SnGrids"),
+                          ns = "RobExtremes"), silent =TRUE)
+              if(is(sng,"try-error")) return(Sn(as(x,"AbscontDistribution")))
+              snf <- sng[["Generalized Extreme Value Family with positive shape parameter: Frechet Family"]][["fct"]]
+              ret <- snf(shape(x))
+           }else ret <- scale(x)*Sn(x=x/scale(x))
+           return(ret)
+    })
 
+ setMethod("Sn", signature(x = "Gammad"),
+    function(x, ...){
+           if(abs(scale(x)-1)< 1e-12){
+#              sng <- .SnGrids
+              sng <- try(getFromNamespace(.versionSuff(".SnGrids"),
+                          ns = "RobExtremes"), silent =TRUE)
+              if(is(sng,"try-error")) return(Sn(as(x,"AbscontDistribution")))
+              snf <- sng[["Gamma family"]][["fct"]]
+              ret <- snf(shape(x))
+           }else ret <- scale(x)*Sn(x=x/scale(x))
+           return(ret)
+    })
+
+ setMethod("Sn", signature(x = "Weibull"),
+    function(x, ...){
+           if(abs(scale(x)-1)< 1e-12){
+#              sng <- .SnGrids
+              sng <- try(getFromNamespace(.versionSuff(".SnGrids"),
+                          ns = "RobExtremes"), silent =TRUE)
+              if(is(sng,"try-error")) return(Sn(as(x,"AbscontDistribution")))
+              snf <- sng[["Weibull Family"]][["fct"]]
+              ret <- snf(shape(x))
+           }else ret <- scale(x)*Sn(x=x/scale(x))
+           return(ret)
+    })
+

Modified: branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationsmanipulations.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationsmanipulations.R	2013-01-25 03:27:21 UTC (rev 556)
+++ branches/robast-0.9/pkg/RobExtremes/inst/AddMaterial/interpolation/interpolationsmanipulations.R	2013-01-25 04:05:08 UTC (rev 557)
@@ -73,3 +73,30 @@
 }
 
 ls(envir=nE); f(); ls(envir=nE)
+
+
+.myFolderA <- file.path(.basepath,"RobExtremesBuffer/all2")
+.myFolderW <- file.path(.basepath,"RobExtremesBuffer/WTS")
+fn00=file.path(.myFolderW,"tmp0/sysdata.rda")
+fn01=file.path(.myFolderW,"tmp1/sysdata.rda")
+fn02=file.path(.myFolderW,"tmp2/sysdata.rda")
+fn1=file.path(.myFoldera,"sysdata.rda")
+fnA <- file.path(.myFolderA,"sysdata.rda")
+#fn2=file.path(.myFoldera,"sysdata-1.rda")
+RobExtremes:::.recomputeInterpolators(c(fn00, fn01,fn02, fn1), sysRdaFolder = .myFolderA, overwrite=TRUE, translate=FALSE)
+nE= new.env()
+load(fnA,envir=nE)
+w = ls(all=T,envir=nE)
+lapply(w, function(x) {u=get(x,envir=nE); print(x);print(names(u))})
+
+.basepath <- "C:/rtest/RobASt/branches/robast-0.9/pkg"
+.myFolderA <- file.path(.basepath,"RobExtremesBuffer/all2")
+fnA0 <- file.path(.myFolderA,"sysdata0.rda")
+fnA <- file.path(.myFolderA,"sysdata.rda")
+file.copy(fnA,fnA0, overwrite=T)
+#fn2=file.path(.myFoldera,"sysdata-1.rda")
+require(RobExtremes); RobExtremes:::.recomputeInterpolators(fnA0, sysRdaFolder = .myFolderA)
+nE= new.env()
+load(fnA,envir=nE)
+w = ls(all=T,envir=nE)
+lapply(w, function(x) {u=get(x,envir=nE); print(x);print(names(u))})

Modified: branches/robast-0.9/pkg/RobExtremes/man/Var.Rd
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/man/Var.Rd	2013-01-25 03:27:21 UTC (rev 556)
+++ branches/robast-0.9/pkg/RobExtremes/man/Var.Rd	2013-01-25 04:05:08 UTC (rev 557)
@@ -36,6 +36,9 @@
 \alias{Sn,Norm-method}
 \alias{Sn,AffLinDistribution-method}
 \alias{Sn,GPareto-method}
+\alias{Sn,Gammad-method}
+\alias{Sn,Weibull-method}
+\alias{Sn,GEV-method}
 \alias{Sn,DiscreteDistribution-method}
 \alias{Qn}
 \alias{Qn-methods}
@@ -90,6 +93,9 @@
 \S4method{Sn}{AffLinDistribution}(x,  ...)
 \S4method{Sn}{Norm}(x,  ...)
 \S4method{Sn}{GPareto}(x,  ...)
+\S4method{Sn}{GEV}(x,  ...)
+\S4method{Sn}{Gammad}(x,  ...)
+\S4method{Sn}{Weibull}(x,  ...)
 
 Qn(x, ...)
 \S4method{Qn}{ANY}(x,  ...)
@@ -183,6 +189,12 @@
     exact evaluation using explicit expressions.}
   \item{\code{Sn}, \code{signature(x = "GPareto")}:}{
     speeded up using interpolation grid.}
+  \item{\code{Sn}, \code{signature(x = "GEV")}:}{
+    speeded up using interpolation grid.}
+  \item{\code{Sn}, \code{signature(x = "Gammad")}:}{
+    speeded up using interpolation grid.}
+  \item{\code{Sn}, \code{signature(x = "Weibull")}:}{
+    speeded up using interpolation grid.}
 
   \item{\code{Qn}, \code{signature(x = "Norm")}:}{
     exact evaluation using explicit expressions.}



More information about the Robast-commits mailing list