[Robast-commits] r736 - branches/robast-1.0/pkg/RobExtremes/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 3 09:58:03 CEST 2014
Author: ruckdeschel
Date: 2014-04-03 09:58:03 +0200 (Thu, 03 Apr 2014)
New Revision: 736
Modified:
branches/robast-1.0/pkg/RobExtremes/R/GEVFamily.R
branches/robast-1.0/pkg/RobExtremes/R/GEVFamilyMuUnknown.R
branches/robast-1.0/pkg/RobExtremes/R/GParetoFamily.R
branches/robast-1.0/pkg/RobExtremes/R/startEstGEV.R
Log:
RobExtremes: yet another fix with the search interval for GEV
Modified: branches/robast-1.0/pkg/RobExtremes/R/GEVFamily.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremes/R/GEVFamily.R 2014-04-03 01:48:39 UTC (rev 735)
+++ branches/robast-1.0/pkg/RobExtremes/R/GEVFamily.R 2014-04-03 07:58:03 UTC (rev 736)
@@ -257,10 +257,10 @@
}
# print(e0); print(str(x)); print(head(summary(x))); print(mu)
if(e0[2]>0) if(any(x < mu-e0[1]/e0[2]))
- stop("some data smaller than 'loc-scale/shape' ")
+ stop("shape is positive and some data smaller than 'loc-scale/shape' ")
if(e0[2]<0) if(any(x > mu-e0[1]/e0[2]))
- stop("some data larger than 'loc-scale/shape' ")
+ stop("shape is negative and some data larger than 'loc-scale/shape' ")
names(e0) <- NULL
return(e0)
Modified: branches/robast-1.0/pkg/RobExtremes/R/GEVFamilyMuUnknown.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremes/R/GEVFamilyMuUnknown.R 2014-04-03 01:48:39 UTC (rev 735)
+++ branches/robast-1.0/pkg/RobExtremes/R/GEVFamilyMuUnknown.R 2014-04-03 07:58:03 UTC (rev 736)
@@ -143,10 +143,10 @@
}
# print(e0); print(str(x)); print(head(summary(x))); print(mu)
if(e0[3]>0) if(any(x < e0[1]-e0[2]/e0[3]))
- stop("some data smaller than 'loc-scale/shape' ")
+ stop("shape is positive and some data smaller than 'loc-scale/shape' ")
if(e0[3]<0) if(any(x > e0[1]-e0[2]/e0[3]))
- stop("some data larger than 'loc-scale/shape' ")
+ stop("shape is negative and some data larger than 'loc-scale/shape' ")
names(e0) <- NULL
return(e0)
Modified: branches/robast-1.0/pkg/RobExtremes/R/GParetoFamily.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremes/R/GParetoFamily.R 2014-04-03 01:48:39 UTC (rev 735)
+++ branches/robast-1.0/pkg/RobExtremes/R/GParetoFamily.R 2014-04-03 07:58:03 UTC (rev 736)
@@ -146,6 +146,8 @@
if(any(x < tr-.Machine$double.eps))
stop("some data smaller than 'loc' ")
+ if(e0[2]<0) if(any(x > tr-e0[1]/e0[2]))
+ stop("shape is negative and some data larger than 'loc-scale/shape' ")
# if(any(x < tr-e0["scale"]/e0["shape"]))
# stop("some data smaller than 'loc-scale/shape' ")
Modified: branches/robast-1.0/pkg/RobExtremes/R/startEstGEV.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremes/R/startEstGEV.R 2014-04-03 01:48:39 UTC (rev 735)
+++ branches/robast-1.0/pkg/RobExtremes/R/startEstGEV.R 2014-04-03 07:58:03 UTC (rev 736)
@@ -11,7 +11,8 @@
mygev1 <- GEV(loc=0,scale=sig,shape=xi)
CvMDist(x0,mygev1)
}
- sigCvMMD1 <- optimize(funl, interval=c(1e-5,s0))$minimum
+ intv <- if(xi<0) c(1e-5, max(xi*min(x)-mu,2e-5)) else c(max(1e-5,xi*min(x)-mu),s0)
+ sigCvMMD1 <- optimize(funl, interval=intv)$minimum
mygev <- GEVFamily(loc=0,scale=sigCvMMD1,shape=xi, withPos=withPos,
start0Est = fu, ..withWarningGEV=FALSE)
mde0 <- MDEstimator(x0, mygev, distance=CvMDist, startPar=c("scale"=sigCvMMD1,"shape"=xi))
More information about the Robast-commits
mailing list