[Robast-commits] r653 - branches/robast-0.9/pkg/RobExtremes/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 18 14:38:01 CEST 2013
Author: ruckdeschel
Date: 2013-04-18 14:38:00 +0200 (Thu, 18 Apr 2013)
New Revision: 653
Modified:
branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
Log:
RobExtremes: introduced warning for xi>4.5 in GEVFamily
Modified: branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R 2013-04-17 00:02:50 UTC (rev 652)
+++ branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R 2013-04-18 12:38:00 UTC (rev 653)
@@ -6,6 +6,14 @@
### some reusable blocks of code (to avoid redundancy):
+.warningGEVShapeLarge <- function(xi){
+ if(xi>=4.5)
+ warning("A shape estimate larger than 4.5 was produced.\n",
+ "Shape parameter values larger than 4.5 are critical\n",
+ "in the GEV family as to numerical issues. Be careful with \n",
+ "ALE results obtained here; they might be unreliable.")
+ }
+
### pretreatment of of.interest
.pretreat.of.interest <- function(of.interest,trafo){
if(is.null(trafo)){
@@ -139,7 +147,8 @@
withCentL2 = FALSE,
withL2derivDistr = FALSE){
theta <- c(loc, scale, shape)
-
+ .warningGEVShapeLarge(shape)
+
of.interest <- .pretreat.of.interest(of.interest,trafo)
##symmetry
@@ -253,7 +262,7 @@
modifyPar <- function(theta){
theta <- makeOKPar(theta)
-
+ .warningGEVShapeLarge(theta["shape"])
if(!is.null(names(theta))){
sc <- theta["scale"]
sh <- theta["shape"]
@@ -271,6 +280,7 @@
sc <- force(main(param)[1])
k <- force(main(param)[2])
tr <- fixed(param)[1]
+ .warningGEVShapeLarge(k)
Lambda1 <- function(x) {
y <- x*0
@@ -306,6 +316,7 @@
FisherInfo.fct <- function(param) {
sc <- force(main(param)[1])
k <- force(main(param)[2])
+ .warningGEVShapeLarge(k)
G20 <- gamma(2*k)
G10 <- gamma(k)
G11 <- digamma(k)*gamma(k)
More information about the Robast-commits
mailing list