[Robast-commits] r546 - in branches/robast-0.9/pkg/RobExtremes: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 19 03:48:09 CET 2013


Author: ruckdeschel
Date: 2013-01-19 03:48:08 +0100 (Sat, 19 Jan 2013)
New Revision: 546

Modified:
   branches/robast-0.9/pkg/RobExtremes/R/SnQn.R
   branches/robast-0.9/pkg/RobExtremes/R/interpolLM.R
   branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R
   branches/robast-0.9/pkg/RobExtremes/R/sysdata.rda
   branches/robast-0.9/pkg/RobExtremes/man/PickandsEstimator.Rd
   branches/robast-0.9/pkg/RobExtremes/man/internal-interpolateLM.Rd
   branches/robast-0.9/pkg/RobExtremes/man/interpolateSn.Rd
Log:
RobExtremes: first version that passed the tests

Modified: branches/robast-0.9/pkg/RobExtremes/R/SnQn.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/SnQn.R	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/R/SnQn.R	2013-01-19 02:48:08 UTC (rev 546)
@@ -108,7 +108,9 @@
     function(x, ...){
            if(abs(scale(x)-1)< 1e-12){
 #              sng <- .SnGrids
-              sng <- getFromNamespace(.versionSuff(".SnGrids"), ns = "RobExtremes")
+              sng <- try(getFromNamespace(.versionSuff(".SnGrids"),
+                          ns = "RobExtremes"), silent =TRUE)
+              if(is(sng,"try-error")) return(Sn(as(x,"AbscontDistribution")))
               snf <- sng[["Generalized Pareto Family"]][["fct"]]
               ret <- snf(shape(x))
            }else ret <- scale(x)*Sn(x=x/scale(x))

Modified: branches/robast-0.9/pkg/RobExtremes/R/interpolLM.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/interpolLM.R	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/R/interpolLM.R	2013-01-19 02:48:08 UTC (rev 546)
@@ -39,7 +39,7 @@
                       PFam = GParetoFamily(scale=1,shape=2),
                       optFct = .RMXE.xi,
                       withSmooth = TRUE,
-                      withPrint = FALSE){
+                      withPrint = FALSE, withCall = FALSE){
    print(match.call())
    call <- match.call()
    itLM <- 0
@@ -72,7 +72,7 @@
    res <- .MakeGridList(xiGrid, Y=t(LMGrid), withSmooth = withSmooth)
    print(res)
    return(list(grid = res$grid,
-               fct = res$fct, call = call))
+               fct = res$fct, call = if(withCall) call else NULL))
 }
 
 .MakeGridList <- function(xiGrid, Y, withSmooth = TRUE){

Modified: branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/R/interpolSn.R	2013-01-19 02:48:08 UTC (rev 546)
@@ -59,7 +59,7 @@
 
 getSnGrid <- function(xiGrid = getShapeGrid(), PFam=GParetoFamily(), low=0,
                       upp=1.01, accuracy = 10000, withSmooth = TRUE,
-                      withPrint = FALSE){
+                      withPrint = FALSE, withCall = FALSE){
    call <- match.call()
    itSn <- 0
    getSn <- function(xi){
@@ -93,7 +93,7 @@
           return(y1)
    }
    return(list(grid = cbind(xi=xiGrid,Sn=SnGrid),
-               fct = fct, call = call))
+               fct = fct, call = if(withCall) call else NULL))
 }
 
 .saveInterpGrid <- function(xiGrid = getShapeGrid(), PFam = GParetoFamily(),
@@ -148,7 +148,7 @@
   }else{
     l.ng <- 1
     InterpGrids <- vector("list",1)
-    whatIsThereAlready <- c(whatIsThereAlready,nameInSysdata)
+    whatIsThereAlready <- c(whatIsThereAlready,.versionSuff(nameInSysdata))
   }
 
   if(l.ng>0){

Modified: branches/robast-0.9/pkg/RobExtremes/R/sysdata.rda
===================================================================
(Binary files differ)

Modified: branches/robast-0.9/pkg/RobExtremes/man/PickandsEstimator.Rd
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/man/PickandsEstimator.Rd	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/man/PickandsEstimator.Rd	2013-01-19 02:48:08 UTC (rev 546)
@@ -48,7 +48,7 @@
 \note{
 The scale estimate we use, i.e., with scale = \eqn{\beta}{beta}
 and shape = \eqn{\xi}{xi}, we estimate scale by
-\eqn{\beta= \xi*a_1/(\alpha^\xi-1)}{\code{beta= xi*a1/(alpha^xi-1)}},  differs from
+\eqn{\beta= \xi a_1/(\alpha^\xi-1)}{\code{beta= xi*a1/(alpha^xi-1)}},  differs from
 the one given in the original reference, where it was
 \eqn{\beta= \xi a_1^2/(a_2-2a_1)}{\code{beta= xi * a1^2 /(a2-2*a1)}}.
 The one chosen here avoids taking differences \eqn{a_2-2a_1}{a2-2*a1}

Modified: branches/robast-0.9/pkg/RobExtremes/man/internal-interpolateLM.Rd
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/man/internal-interpolateLM.Rd	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/man/internal-interpolateLM.Rd	2013-01-19 02:48:08 UTC (rev 546)
@@ -26,7 +26,7 @@
                       PFam = GParetoFamily(scale=1, shape=2),
                       optFct = .RMXE.xi,
                       withSmooth = TRUE,
-                      withPrint = FALSE)
+                      withPrint = FALSE, withCall = FALSE)
 
 .MakeGridList(xiGrid, Y, withSmooth = TRUE)
 }
@@ -43,6 +43,7 @@
   \item{Y}{array or matrix; contains precomputed y-values. }
   \item{optFct}{function with arguments \code{xi} and \code{PFam};
                 determines the Lagrange multipliers. }
+  \item{withCall}{logical of length 1: shall the call be saved, too?}
 }
 \details{
   \code{.MBRE.xi} computes the Lagrange multipliers for the MBRE estimator,
@@ -58,7 +59,7 @@
   Instead of \code{.getSnGrid} in our case this will call \code{.getLMGrid}
   to compute the Lagrange multipliers.
 }
-\note{These functions are only meant for the developers of package \pkg{ROptEst}
+\note{These functions are only meant for the developers of package \pkg{RobExtremes}
       (or respective packages).
       They can be used to speed up things by interpolation.
       Our use case is a speed up for further scale-shape families (or enhance
@@ -88,8 +89,8 @@
 \examples{
 \dontrun{
 ### code to produce grid for GPareto:
-  .saveInterpGrid(sysRdaFolder = "C:/rtest/distr/branches/distr-2.4/pkg/distrMod/R",
-              accuracy = 5000)
+  .saveInterpGrid(sysRdaFolder = "C:/rtest/RobASt/branches/RobASt-0.9/pkg/RobExtremes/R",
+              accuracy = 800)
 }
 }
 \keyword{internal}

Modified: branches/robast-0.9/pkg/RobExtremes/man/interpolateSn.Rd
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/man/interpolateSn.Rd	2013-01-19 01:09:11 UTC (rev 545)
+++ branches/robast-0.9/pkg/RobExtremes/man/interpolateSn.Rd	2013-01-19 02:48:08 UTC (rev 546)
@@ -17,7 +17,7 @@
 
 getSnGrid(xiGrid = getShapeGrid(), PFam=GParetoFamily(), low=0,
                       upp=1.01, accuracy = 10000, withSmooth= TRUE,
-                      withPrint = FALSE)
+                      withPrint = FALSE, withCall = FALSE)
 }
 \arguments{
   \item{gridsize}{integer; the size of the grid to be created. }
@@ -36,6 +36,7 @@
   \item{accuracy}{numeric; argument for \code{\link{Sn}}. }
   \item{withSmooth}{logical of length 1: shall a smoothing spline be used?}
   \item{withPrint}{logical of length 1: shall current shape value be printed out?}
+  \item{withCall}{logical of length 1: shall the call be saved, too?}
 }
 \details{
   \code{getShapeGrid} is a helper function to produce an unequally spaced



More information about the Robast-commits mailing list