[Robast-commits] r742 - branches/robast-1.0/pkg/RobExtremes/inst/scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 3 13:46:38 CEST 2014
Author: ruckdeschel
Date: 2014-04-03 13:46:37 +0200 (Thu, 03 Apr 2014)
New Revision: 742
Added:
branches/robast-1.0/pkg/RobExtremes/inst/scripts/GEVcheck.R
Log:
RobExtremes: committed script to check GEV ...
Added: branches/robast-1.0/pkg/RobExtremes/inst/scripts/GEVcheck.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremes/inst/scripts/GEVcheck.R (rev 0)
+++ branches/robast-1.0/pkg/RobExtremes/inst/scripts/GEVcheck.R 2014-04-03 11:46:37 UTC (rev 742)
@@ -0,0 +1,23 @@
+require(RobExtremes)
+set.seed(123)
+
+x <- rgev(100,shape=2,scale=30,loc=4) ### x still causes problems....
+x1 <- rgev(100,shape=-.2,scale=30,loc=4)
+gev0 <- GEVFamilyMuUnknown(withPos=FALSE)
+gev1 <- GEVFamilyMuUnknown(loc=quantile(x,exp(-1)),withPos=FALSE)
+MLEstimator(x,gev0)
+MLEstimator(x,gev1)
+MLEstimator(x1,gev0)
+MLEstimator(x1,gev1)
+fucheck <- function(x,mu,sigma,xi){
+ 1+min((x-mu)/sigma*xi)
+}
+(est1 <- RobExtremes:::.getMuBetaXiGEV(x,withPos=FALSE))
+fucheck(x,mu=est1[1],sigma=est1[2],xi=est1[3])
+(est2 <- RobExtremes:::.getBetaXiGEV(x,mu=quantile(x,exp(-1)),withPos=FALSE))
+fucheck(x,mu=quantile(x,exp(-1)),sigma=est2[1],xi=est2[2])
+
+(est3 <- RobExtremes:::.getMuBetaXiGEV(x1,withPos=FALSE))
+fucheck(x1,mu=est3[1],sigma=est3[2],xi=est3[3])
+(est4 <- RobExtremes:::.getBetaXiGEV(x1,mu=quantile(x,exp(-1)),withPos=FALSE))
+fucheck(x1,mu=quantile(x,exp(-1)),sigma=est4[1],xi=est4[2])
More information about the Robast-commits
mailing list