diff --git a/DESCRIPTION b/DESCRIPTION index 4b06596..960498f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: mev Type: Package Title: Modelling of Extreme Values -Version: 1.16 +Version: 1.16.0002 Authors@R: c(person(given="Leo", family="Belzile", role = c("aut", "cre"), email = "belzilel@gmail.com", comment = c(ORCID = "0000-0002-9135-014X")), person(given="Jennifer L.", family="Wadsworth", role=c("aut")), person(given="Paul J.", family="Northrop", role=c("aut")), person(given="Scott D.", family="Grimshaw", role=c("aut")), person(given="Jin", family="Zhang", role=c("ctb")), person(given="Michael A.", family="Stephens", role=c("ctb")), person(given="Art B.", family="Owen", role=c("ctb")), person(given="Raphael", family="Huser", role=c("aut"))) Description: Various tools for the analysis of univariate, multivariate and functional extremes. Exact simulation from max-stable processes [Dombry, Engelke and Oesting (2016) , R-Pareto processes for various parametric models, including Brown-Resnick (Wadsworth and Tawn, 2014, ) and Extremal Student (Thibaud and Opitz, 2015, ). Threshold selection methods, including Wadsworth (2016) , and Northrop and Coleman (2014) . Multivariate extreme diagnostics. Estimation and likelihoods for univariate extremes, e.g., Coles (2001) . License: GPL-3 diff --git a/R/mgplikelihoods.R b/R/mgplikelihoods.R index 4c0840f..6cc95b2 100644 --- a/R/mgplikelihoods.R +++ b/R/mgplikelihoods.R @@ -249,15 +249,15 @@ likmgp <- function(dat, } } if(model %in% c("br", "xstud")){ + if(ncol(dat) == 2L){ + stop("Function does not support bivariate data sets.") + } if (!requireNamespace("mvPot", quietly = TRUE)) { stop( "Package \"mvPot\" must be installed to use this function.", call. = FALSE ) } - } - - genvec1 <- ellips$genvec1 B1 <- ifelse(is.null(ellips$B1), 1009L, ellips$B1) antithetic <- ifelse(is.null(ellips$antithetic), FALSE, ellips$antithetic) @@ -266,7 +266,7 @@ likmgp <- function(dat, } M1 <- ifelse(is.null(ellips$M1), 1L, ellips$M1) ncores <- ifelse(is.null(ellips$ncores), 1L, ellips$ncores) - + } if (model == "br") { intens <- intensBR(tdat = tdat, Lambda = Lambda) exponentMeasure <- sum(.weightsBR(z = tu, Lambda = Lambda, prime = B1, method = "mvPot", genvec = genvec1, nrep = 1) / tu) @@ -434,6 +434,10 @@ clikmgp <- function(dat, numAbovePerRow <- ellips$numAbovePerRow numAbovePerCol <- ellips$numAbovePerCol mmax <- ellips$mmax + if(model %in% c("br","xstud")){ + if(ncol(dat) == 2L){ + stop("Function does not support bivariate data sets.") + } genvec1 <- ellips$genvec1 genvec2 <- ellips$genvec2 B1 <- ifelse(is.null(ellips$B1), 1009L, ellips$B1) @@ -448,6 +452,7 @@ clikmgp <- function(dat, M1 <- ifelse(is.null(ellips$M1), 1L, ellips$M1) M2 <- ifelse(is.null(ellips$M2), 1L, ellips$M2) ncores <- ifelse(is.null(ellips$ncores), 1L, ellips$ncores) + } censored <- ellips$censored if (is.null(censored)) { censored <- matrix(FALSE, nrow = nrow(tdat), ncol = ncol(tdat)) diff --git a/R/multivar.R b/R/multivar.R index 0f15e19..5a6ba01 100644 --- a/R/multivar.R +++ b/R/multivar.R @@ -57,7 +57,7 @@ chibar <- function(dat, confint = c("delta", "profile", "tem"), qu = 0, level = } -#' Bivariate angular function for extrapolation based on rays +#' Bivariate angular dependence function for extrapolation based on rays #' #' The scale parameter \eqn{g(w)} in the Ledford and Tawn approach is estimated empirically for #' \eqn{x} large as \deqn{\frac{\Pr(X_P>xw, Y_P>x(1-w))}{\Pr(X_P>x, Y_P>x)}} @@ -100,7 +100,7 @@ angextrapo <- function(dat, qu = 0.95, w = seq(0.05, 0.95, length = 20)) { } ################## -#' Estimation of the bivariate lambda function of Wadsworth and Tawn (2013) +#' Estimation of the bivariate angular dependence function of Wadsworth and Tawn (2013) #' #' @param dat an \eqn{n} by \eqn{2} matrix of multivariate observations #' @param qu quantile level on uniform scale at which to threshold data. Default to 0.95 diff --git a/man/angextrapo.Rd b/man/angextrapo.Rd index 2e8b020..6baaad4 100644 --- a/man/angextrapo.Rd +++ b/man/angextrapo.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/multivar.R \name{angextrapo} \alias{angextrapo} -\title{Bivariate angular function for extrapolation based on rays} +\title{Bivariate angular dependence function for extrapolation based on rays} \usage{ angextrapo(dat, qu = 0.95, w = seq(0.05, 0.95, length = 20)) } diff --git a/man/frwind.Rd b/man/frwind.Rd index 9ebabdf..7976ced 100644 --- a/man/frwind.Rd +++ b/man/frwind.Rd @@ -8,12 +8,12 @@ A data frame with 17209 observations and 8 variables: \describe{ \item{\code{date}}{date of measurement} -\item{\code{S1}}{wind speed (in km/h) at Cap Cépet} -\item{\code{S2}}{wind speed (in km/h) at Lyon Saint-Exupéry} +\item{\code{S1}}{wind speed (in km/h) at Cap Cepet} +\item{\code{S2}}{wind speed (in km/h) at Lyon Saint-Exupery} \item{\code{S3}}{wind speed (in km/h) at Marseille Marignane} -\item{\code{S4}}{wind speed (in km/h) at Montélimar} -\item{\code{H2}}{humidity (in percentage) at Lyon Saint-Exupéry} -\item{\code{T2}}{mean temperature (in degree Celcius) at Lyon Saint-Exupéry} +\item{\code{S4}}{wind speed (in km/h) at Montelimar} +\item{\code{H2}}{humidity (in percentage) at Lyon Saint-Exupery} +\item{\code{T2}}{mean temperature (in degree Celcius) at Lyon Saint-Exupery} } The \code{metadata} attribute includes latitude and longitude (in degrees, minutes, seconds), altitude (in m), station name and station id. } @@ -21,7 +21,7 @@ The \code{metadata} attribute includes latitude and longitude (in degrees, minut European Climate Assessment and Dataset project \url{https://www.ecad.eu/} } \description{ -Daily mean wind speed (in km/h) at four stations in the south of France, namely Cap Cépet (\code{S1}), Lyon St-Exupéry (\code{S2}), Marseille Marignane (\code{S3}) and Montélimar (\code{S4}). +Daily mean wind speed (in km/h) at four stations in the south of France, namely Cap Cepet (\code{S1}), Lyon St-Exupery (\code{S2}), Marseille Marignane (\code{S3}) and Montelimar (\code{S4}). The data includes observations from January 1976 until April 2023; days containing missing values are omitted. } \examples{ diff --git a/man/lambdadep.Rd b/man/lambdadep.Rd index f93d523..d2cdc32 100644 --- a/man/lambdadep.Rd +++ b/man/lambdadep.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/multivar.R \name{lambdadep} \alias{lambdadep} -\title{Estimation of the bivariate lambda function of Wadsworth and Tawn (2013)} +\title{Estimation of the bivariate angular dependence function of Wadsworth and Tawn (2013)} \usage{ lambdadep(dat, qu = 0.95, method = c("hill", "mle", "bayes"), plot = TRUE) } @@ -32,7 +32,7 @@ a plot of the lambda function if \code{plot=TRUE}, plus an invisible list with c } } \description{ -Estimation of the bivariate lambda function of Wadsworth and Tawn (2013) +Estimation of the bivariate angular dependence function of Wadsworth and Tawn (2013) } \examples{ set.seed(12)