[Distr-commits] r664 - branches/distr-2.3/pkg/distrEx/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 9 20:43:30 CEST 2010


Author: horbenko
Date: 2010-07-09 20:43:29 +0200 (Fri, 09 Jul 2010)
New Revision: 664

Modified:
   branches/distr-2.3/pkg/distrEx/R/Expectation.R
   branches/distr-2.3/pkg/distrEx/R/GEV.R
Log:
Gumbel  in distrEx has different parametrization as GEV with shape = 0

Modified: branches/distr-2.3/pkg/distrEx/R/Expectation.R
===================================================================
--- branches/distr-2.3/pkg/distrEx/R/Expectation.R	2010-07-09 14:40:07 UTC (rev 663)
+++ branches/distr-2.3/pkg/distrEx/R/Expectation.R	2010-07-09 18:43:29 UTC (rev 664)
@@ -850,10 +850,10 @@
     if(!is.null(low)) if(low <= Min(object)) low <- NULL
     xi <- shape(object); sigma <- scale(object); mu <- loc(object)
     if(is.null(low) && is.null(upp)){
-        if(xi>=1){ return(Inf)}
-        if(xi==0) {return(mu + sigma*(-digamma(1)))}
-        if((xi!=0)&&(xi<1)){ return(mu+sigma*(gamma(1-xi)-1)/xi)}
-     }  
+        if (xi==0) return(mu+sigma*EULERMASCHERONICONSTANT)
+        else if(xi>=1) return(Inf)
+        else return(mu+sigma*(gamma(1-xi)-1)/xi)
+        }       
     else
         return(E(as(object,"AbscontDistribution"), low=low, upp=upp, ...))    
     })

Modified: branches/distr-2.3/pkg/distrEx/R/GEV.R
===================================================================
--- branches/distr-2.3/pkg/distrEx/R/GEV.R	2010-07-09 14:40:07 UTC (rev 663)
+++ branches/distr-2.3/pkg/distrEx/R/GEV.R	2010-07-09 18:43:29 UTC (rev 664)
@@ -64,7 +64,7 @@
               if(!isTRUE(all.equal(loc,location)))
                  stop("Only one of arguments 'loc' and 'location' may be used.")
            if(!missing(location)) loc <- location
-           if(abs(shape) < .Machine$double.eps) return(Gumbel(loc=loc,scale=scale))
+           #if(abs(shape) < .Machine$double.eps) return(Gumbel(loc=loc,scale=scale))
            new("GEV", loc = loc, scale = scale, shape = shape) }
 
 ## extra methods for GEV distribution



More information about the Distr-commits mailing list