R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("extRemes-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('extRemes') Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: ismev Package extRemes: For a tutorial and more information go to http://www.esig.ucar.edu/extremevalues/evtk.html > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "dclust" > > ### * dclust > > flush(stderr()); flush(stdout()) > > ### Name: dclust > ### Title: Decluster data by runs declustering. > ### Aliases: dclust > ### Keywords: manip > > ### ** Examples > > # Load a dataset. > data(Tphap) > > plot( Tphap[,"MaxT"]) > abline( h=115) > > # Decluster using a threshold of 115 degrees and a run length of 'r=1'. > temp <- dclust(xdat=Tphap[,"MaxT"], u=115, r=1, cluster.by = Tphap[,"Year"]) > temp[["ncluster"]] # See how many clusters were found. [1] 50 > > # Now do the same as above, but with a run length of 3 for comparison. > # Note: 'r=2' gives same clusters as 'r=1' for these data. > temp2 <- dclust(xdat=Tphap[,"MaxT"], u=115, r=3, cluster.by = Tphap[,"Year"]) > temp2[["ncluster"]] [1] 49 > > > > > cleanEx(); ..nameEx <- "extremalindex" > > ### * extremalindex > > flush(stderr()); flush(stdout()) > > ### Name: extremalindex > ### Title: Estimate the extremal index (theta) > ### Aliases: extremalindex > ### Keywords: univar > > ### ** Examples > > data( Tphap) > temp <- -Tphap[,"MinT"] > look <- extremalindex( temp, -70) > look $theta [1] 0.3326241 $C [1] 30 $run.length [1] 11 $msg [1] "theta.tilde used because a value(s) exists of T > 2." > > > > cleanEx(); ..nameEx <- "extremes.gui" > > ### * extremes.gui > > flush(stderr()); flush(stdout()) > > ### Name: extremes.gui > ### Title: open the toolkit main dialog window > ### Aliases: extremes.gui > ### Keywords: misc > > ### ** Examples > > ## Don't run > # extremes() > > > > cleanEx(); ..nameEx <- "gen.gev" > > ### * gen.gev > > flush(stderr()); flush(stdout()) > > ### Name: gen.gev > ### Title: Simulate data from a generalized extreme value (GEV) > ### Aliases: gen.gev gen.gpd > ### Keywords: distribution > > ### ** Examples > > # obtain a GEV with mean, 4, scale 1.5 and shape of -0.1 > mu <- 4 # location parameter > sigma <- 1.5 # scale parameter > xi <- -0.1 # shape parameter > > params <- c( mu, sigma, xi) > > # generate a sample of size 25 > gen1 <- gen.gev( p=params, n=25) > > # Now generate one with a trend. > gen2 <- gen.gev( p=params, n=25, trend=0.1) > > # Fit 'gen1' to a GEV distribution and plot the diagnostics. > gen1.fit <- gev.fit( gen1) $conv [1] 0 $nllh [1] 47.56516 $mle [1] 4.13057304 1.33460043 0.05415895 $se [1] 0.3149468 0.2406340 0.1979465 > class( gen1.fit) <- "gev.fit" > plot( gen1.fit) > > # Fit 'gen2' to a GEV distribution and plot the diagnostics. > gen2.fit1 <- gev.fit( gen2) $conv [1] 0 $nllh [1] 46.64911 $mle [1] 4.7915893 1.0932289 0.3539209 $se [1] 0.2682725 0.2350770 0.2466251 > class( gen2.fit1) <- "gev.fit" > plot( gen2.fit1) > > > > > cleanEx(); ..nameEx <- "gev.parameterCI" > > ### * gev.parameterCI > > flush(stderr()); flush(stdout()) > > ### Name: gev.parameterCI > ### Title: Return level and shape parameter confidence intervals for GEV > ### (or GP) distribution. > ### Aliases: gev.parameterCI gpd.parameterCI > ### Keywords: manip hplot > > ### ** Examples > > # See extRemes tutorial for examples using the GUI interface. > > > > cleanEx(); ..nameEx <- "return.level" > > ### * return.level > > flush(stderr()); flush(stdout()) > > ### Name: return.level > ### Title: Computes m-year return levels for GEV and GPD with confidence > ### bounds. > ### Aliases: return.level > ### Keywords: hplot > > ### ** Examples > > # Must have the 'ismev' package loaded. > require( ismev) [1] TRUE > data( ftcanmax) > fit <- gev.fit( ftcanmax[,"Prec"]) $conv [1] 0 $nllh [1] 565.4816 $mle [1] 134.6700799 53.2922606 0.1739572 $se [1] 6.16971558 4.88092387 0.09203366 > class( fit) <- "gev.fit" # 'gev.fit' does not actually assign this class, > # but it must be done. > return.level( fit) Please be patient, this may take a few seconds. Loop is 1 to 6 1 2 3 4 5 6 > > > > ### *