[Robast-commits] r671 - branches/robast-0.9/pkg/RobExtremes/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 2 11:20:54 CEST 2013


Author: ruckdeschel
Date: 2013-07-02 11:20:53 +0200 (Tue, 02 Jul 2013)
New Revision: 671

Modified:
   branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
   branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R
Log:
[RobExtremes] added Gerald's second round of corrections as to Weibull and as to ddigamma

Modified: branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-07-01 13:53:49 UTC (rev 670)
+++ branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-07-02 09:20:53 UTC (rev 671)
@@ -185,9 +185,9 @@
                             dd <- ddigamma(-log(p0),1-theta[2])
                             g0 <- gamma(1-theta[2])
                             D1 <- (g0*pg/(1-p0)-1)/theta[2]
-                            D21 <- theta[1]*D1/theta[2]
-                            D22 <- theta[1]*dd/(1-p0)/theta[2]
-                            D2 <- -D21+D22}
+                            D21 <- D1/theta[2]
+                            D22 <- dd/(1-p0)/theta[2]
+                            D2 <- -theta[1]*(D21+D22)}
                             D <- t(c(D1, D2))
                             rownames(D) <- "expected shortfall"
                             colnames(D) <- NULL

Modified: branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R	2013-07-01 13:53:49 UTC (rev 670)
+++ branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R	2013-07-02 09:20:53 UTC (rev 671)
@@ -77,10 +77,11 @@
                             s1 <- 1+1/theta[2]
                             pg <- pgamma(-log(1-p0), s1, lower.tail = FALSE)
                             g0 <- gamma(s1)
+                            ## dd <- ddigamma(Inf,s1)-ddigamma(-log(1-p0),s1)
                             dd <- digamma(s1)*g0 - ddigamma(-log(1-p0),s1)
-                            D1 <-  g0 * pg / (1-p0)
-                            D2 <- theta[1] * dd /(1-p0)}
-                            D <- t(c(D1, D2))
+                            D1 <-  g0 * pg
+                            D2 <- - theta[1] * dd /theta[2]^2}
+                            D <- t(c(D1, D2))/(1-p0)
                             rownames(D) <- "expected shortfall"
                             colnames(D) <- NULL
                             D }, list(p0 = p))



More information about the Robast-commits mailing list