Package gumbel. February 15, 2013

Similar documents
Package depth.plot. December 20, 2015

Package NonpModelCheck

Package invgamma. May 7, 2017

Package Delaporte. August 13, 2017

Package CopulaRegression

Package sbgcop. May 29, 2018

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package pearson7. June 22, 2016

Package sklarsomega. May 24, 2018

Package LindleyR. June 23, 2016

Package darts. February 19, 2015

Package rnmf. February 20, 2015

Package clogitboost. R topics documented: December 21, 2015

Package skellam. R topics documented: December 15, Version Date

Package gma. September 19, 2017

Package ensemblepp. R topics documented: September 20, Title Ensemble Postprocessing Data Sets. Version

Package mpmcorrelogram

Package ProbForecastGOP

Package gtheory. October 30, 2016

Package SpatPCA. R topics documented: February 20, Type Package

Package lomb. February 20, 2015

Package leiv. R topics documented: February 20, Version Type Package

Package elhmc. R topics documented: July 4, Type Package

Package diffeq. February 19, 2015

Package LIStest. February 19, 2015

Package ForwardSearch

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package BayesNI. February 19, 2015

Package CEC. R topics documented: August 29, Title Cross-Entropy Clustering Version Date

The evdbayes Package

Package OGI. December 20, 2017

Package emg. R topics documented: May 17, 2018

Package CorrMixed. R topics documented: August 4, Type Package

Package generalhoslem

Package rgabriel. February 20, 2015

Package EL. February 19, 2015

Package Select. May 11, 2018

Package bpp. December 13, 2016

Package idmtpreg. February 27, 2018

Package face. January 19, 2018

Package MultisiteMediation

Package QuantifQuantile

Lecture Quantitative Finance Spring Term 2015

Package SimSCRPiecewise

Package noncompliance

Package ShrinkCovMat

Package hierdiversity

Package survidinri. February 20, 2015

Package severity. February 20, 2015

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package Blendstat. February 21, 2018

Package alphaoutlier

Package ltsbase. R topics documented: February 20, 2015

Package ppcc. June 28, 2017

The sbgcop Package. March 9, 2007

Package SpatialNP. June 5, 2018

Package covsep. May 6, 2018

Package EBMAforecast

Copulas. MOU Lili. December, 2014

Package scio. February 20, 2015

Package homtest. February 20, 2015

Package sscor. January 28, 2016

The ProbForecastGOP Package

Package condmixt. R topics documented: February 19, Type Package

Package sodavis. May 13, 2018

Package PeriodicTable

Package sdprisk. December 31, 2016

Package Rarity. December 23, 2016

Package RootsExtremaInflections

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package LPTime. March 3, 2015

Package interspread. September 7, Index 11. InterSpread Plus: summary information

Package flora. R topics documented: August 29, Type Package. Title flora: taxonomical information on flowering species that occur in Brazil

Package ensemblebma. R topics documented: January 18, Version Date

Package bayeslm. R topics documented: June 18, Type Package

Package jmuoutlier. February 17, 2017

Trivariate copulas for characterisation of droughts

Package clustergeneration

Package epr. November 16, 2017

Package CoxRidge. February 27, 2015

Package EnergyOnlineCPM

Package clr. December 3, 2018

Copulas. Mathematisches Seminar (Prof. Dr. D. Filipovic) Di Uhr in E

Package CPE. R topics documented: February 19, 2015

Package DiscreteLaplace

Package ICBayes. September 24, 2017

Package EMVS. April 24, 2018

Package thief. R topics documented: January 24, Version 0.3 Title Temporal Hierarchical Forecasting

Package misctools. November 25, 2016

Package SPADAR. April 30, 2017

Package TSPred. April 5, 2017

Package GPfit. R topics documented: April 2, Title Gaussian Processes Modeling Version Date

Package flexcwm. R topics documented: July 11, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.0.

Package MultiRNG. January 10, 2018

Package goftest. R topics documented: April 3, Type Package

Package dhsic. R topics documented: July 27, 2017

First steps of multivariate data analysis

Package FDRSeg. September 20, 2017

Package mmm. R topics documented: February 20, Type Package

Package orclus. R topics documented: March 17, Version Date

Transcription:

Package gumbel February 15, 2013 Type Package Title Gumbel copula Version 1.04 Date 2012-07-31 Author Anne-Lise Caillat, Christophe Dutang, V eronique Larrieu and Triet Nguyen Maintainer Christophe Dutang <christophe.dutang@ensimag.fr> Description stand alone package providing R functions for the Gumbel-Hougaard copula. We provide probability functions (cumulative distribution and density functions), simulation function (Gumbel copula multivariate simulation) and estimation functions (Maximum Likelihood Estimation, Inference For Margins, Moment Based Estimation and Canonical Maximum Likelihood). Depends R (>= 2.9.0) License GPL (>= 2) Repository CRAN Date/Publication 2012-07-31 07:28:56 NeedsCompilation no R topics documented: Gumbel........................................... 2 windata........................................... 6 Index 8 1

2 Gumbel Gumbel The Gumbel Hougaard Copula Description Density function, distribution function, random generation, generator and inverse generator function for the Gumbel Copula with parameters alpha. The 4 classic estimation methods for copulas. Usage dgumbel(u, v=null, alpha, dim=2, warning = FALSE) pgumbel(u, v=null, alpha, dim=2) rgumbel(n, alpha, dim=2, method=1) phigumbel(t, alpha=1) invphigumbel(t, alpha=1) gumbel.mbe(x, y, marg = "exp") gumbel.eml(x, y, marg = "exp") gumbel.ifm(x, y, marg = "exp") gumbel.cml(x, y) Arguments u v n vector of quantiles if argument v is provided or matrix of quantiles if argument v is not provided vector of quantiles, needed if u is not a matrix number of observations. If length(n) > 1, the length is taken to be the number required. alpha parameter of the Copula. Must be greater than 1. dim t method an integer specifying the dimension of the copula. dummy variable of the generator φ or the inverse generator φ 1. could be a n-dimensional array an integer code for the method used in simulation. 1 is the common frailty approach, 2 uses the K function (only valid with dim=2). x,y vectors of observations, realizations of random variable X and Y. marg warning a character string specifying the marginals of vector (X, Y ). It must be either "exp"(default value) or "gamma". a logical (default value FALSE) if you want warnings. Details The Gumbel Hougaard Copula with parameter alpha is defined by its generator φ(t) = ( ln(t)) a lpha.

Gumbel 3 The generator and inverse generator are implemented in phigumbel and invphigumbel respectively. As an Archimedean copula, its distribution function is C(u 1,..., u n ) = φ 1 (φ(u 1 )+...+φ(u n )) = exp( (( ln(u 1 )) a lpha+...+( ln(u n )) a lpha) 1 /α). pgumbel and dgumbel computes the distribution function (expression above) and the density (n times differentiation of expression above with respect to u i ). As there is no explicit formulas for the density of a Gumbel copula, dgumbel is not yet impemented for argument dim>3. This two functions works with a dim-dimensional array with the last dimension being equalled to dim or with a matrix with dim columns (see examples). Random generation is carried out with 2 algorithms the common frailty algorithm (method=1) and the K algorithm (method=2). The common frailty algorithm (cf. Marshall & Olkin(1988)) can be sum up in three lines generate y 1, y 2 from exponential distribution of mean 1, generate θ from a stable distribution with parameter(1/alpha, 1, 1, 0), u 1 < phi(y 1 /θ) and u 2 < phi(y 2 /θ). This algorithm works with any dimension. See Chambers et al(1976) for stable random generation. The K algorithm use the fact the distribution function of random variable C(U, V ) is K(t) = t φ(y)/φ (t). The algorithm is generate v 1, t from uniform distribution generate v 2 from the K distribution i.e. v 2 < K 1 (t). u 1 < φ 1 (φ(v 1 )v 2 ) and u 2 < φ 1 (φ(v 1 )(1 v 2 )). Warning, the K algorithm does NOT work with dim>2. We implements the 4 usual method of estimation for copulas, namely the Exact Maximum Likelihood (gumbel.eml), the Inference for Margins (gumbel.ifm), the Moment-base Estimation (gumbel.mbe) and the Canonical Maximum Likelihood (gumbel.cml). For the moment, only two types of marginals are available : exponential distribution (marg="exp") and gamma distribution (marg="gamma"). Value dgumbel gives the density, pgumbel gives the distribution function, rgumbel generates random deviates, phigumbel gives the generator, invphigumbel gives the inverse generator. gumbel.eml, gumbel.ifm, gumbel.mbe and gumbel.cml returns the vector of estimates. Invalid arguments will result in return value NaN. Author(s) A.-L. Caillat, C. Dutang, M. V. Larrieu and T. Nguyen

4 Gumbel References Nelsen, R. (2006), An Introduction to Copula, Second Edition, Springer. Marshall & Olkin(1988), Families of multivariate distributions, Journal of the American Statistical Association. Chambers et al (1976), A method for simulating stable random variables, Journal of the American Statistical Association. Nelsen, R. (2005), Dependence Modeling with Archimedean Copulas, booklet available at www.lclark.edu/~mathsci/brazil2.p Examples #dim=2 u<-seq(0,1,.1) v<-u #classic parametrization #independance case (alpha=1) dgumbel(u,v,1) pgumbel(u,v,1) #another parametrization dgumbel(cbind(u,v), alpha=1) pgumbel(cbind(u,v), alpha=1) #dim=3 - equivalent parametrization x <- cbind(u,u,u) y <- array(u, c(1,11,3)) pgumbel(x, alpha=2, dim=3) pgumbel(y, alpha=2, dim=3) dgumbel(x, alpha=2, dim=3) dgumbel(y, alpha=2, dim=3) #dim=4 x <- cbind(x,u) pgumbel(x, alpha=3, dim=4) y <- array(u, c(2,1,11,4)) pgumbel(y, alpha=3, dim=4) #independence case rand <- t(rgumbel(200,1)) plot(rand[1,], rand[2,], col="green", main="gumbel copula") #positive dependence rand <- t(rgumbel(200,2)) plot(rand[1,], rand[2,], col="red", main="gumbel copula") #comparison of random generation algorithms nbsimu <- 10000 #Marshall Olkin algorithm system.time(rgumbel(nbsimu, 2, dim=2, method=1))[3] #K algortihm system.time(rgumbel(nbsimu, 2, dim=2, method=2))[3]

Gumbel 5 #pseudo animation ## Not run: anim <-function(n, max=50) { for(i in seq(1,max,length.out=n)) { u <- t(rgumbel(10000, i, method=2)) plot(u[1,], u[2,], col="green", main="gumbel copula", xlim=c(0,1), ylim=c(0,1), pch=".") cat() } } anim(20, 20) ## End(Not run) #3D plots #plot the density x <- seq(.05,.95, length = 30) y <- x z <- outer(x, y, dgumbel, alpha=2) persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 100, shade = 0.25, ticktype = "detailed", xlab = "x", ylab = "y", zlab = "density") #with wonderful colors #code of P. Soutiras zlim <- c(0, max(z)) ncol <- 100 nrz <- nrow(z) ncz <- ncol(z) jet.colors <- colorramppalette(c("#00007f", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")) couleurs <- tail(jet.colors(1.2*ncol),ncol) fcol <- couleurs[trunc(z/zlim[2]*(ncol-1))+1] dim(fcol) <- c(nrz,ncz) fcol <- fcol[-nrz,-ncz] persp(x, y, z, col=fcol, zlim=zlim, theta=30, phi=30, ticktype = "detailed", box = TRUE, xlab = "x", ylab = "y #plot the distribution function z <- outer(x, y, pgumbel, alpha=2) persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 100, shade = 0.25, ticktype = "detailed", xlab = "u", ylab = "v", zlab = "cdf") #parameter estimation #true value : lambdax=lambday=1, alpha=2 simu <- qexp(rgumbel(200, 2)) gumbel.mbe(simu[,1], simu[,2])

6 windata gumbel.ifm(simu[,1], simu[,2]) gumbel.eml(simu[,1], simu[,2]) gumbel.cml(simu[,1], simu[,2]) #true value : lambdax=lambday=1, alphax=alphay=2, alpha=3 simu <- qgamma(rgumbel(200, 3), 2, 1) gumbel.mbe(simu[,1], simu[,2], "gamma") gumbel.ifm(simu[,1], simu[,2], "gamma") gumbel.eml(simu[,1], simu[,2], "gamma") gumbel.cml(simu[,1], simu[,2]) windata Daily Climatological data between August 2005 and May 2007 Description Usage Format Daily Climatological data recorded in two French cities: Echirolles and St Martin-En-Haut. Weather stations are located at Echirolles (ELEV: 237m, LAT: 45 06 00" N LONG: 5 42 00" E) and La Rafiliere (ELEV: 575m, LAT: 45 39 00" N LONG: 4 33 00" E), respectively. data(windstmartin) data(windechirolles) windstmartin and windechirolles are data frames of 15 columns: YEAR Year. MONTH Month number. DAY Day number. TEMP.MEAN Average temperature (Celsius degree). TEMP.HIGH Maximum temperature. TIME.TH Time of the maximum temperature (hh:mm). TEMP.LOW Minimum temperature. TIME.TL Time of the minimum temperature. HDD Heating Degree Days. CDD Cooling Degree Days. RAIN Rain (mm). WIND.MEAN Wind speed average (km/h). WIND.HIGH Wind speed maximum. WIND.TH Time of the wind speed maximum. DOM.DIR Dominant direction of the wind, a character string where "N" for North, "NE" for North- East, etc...

windata 7 Source http://www.meteoisere.com/vantage/ and http://hautsdulyonnais.free.fr/

Index Topic datasets windata, 6 Topic distribution Gumbel, 2 dgumbel (Gumbel), 2 Gumbel, 2 gumbel (Gumbel), 2 invphigumbel (Gumbel), 2 pgumbel (Gumbel), 2 phigumbel (Gumbel), 2 rgumbel (Gumbel), 2 windata, 6 windechirolles (windata), 6 windstmartin (windata), 6 8