Commit 87b349f6 authored by Jana Ulrich's avatar Jana Ulrich
Browse files

updates news, comments, description, ran checks for version 2.1.0

parent 243be5af
Package: IDF
Type: Package
Title: Estimation and Plotting of IDF Curves
Version: 2.0.0.9000
Date: 2021-03-04
Version: 2.1.0
Date: 2021-04-07
Authors@R: c(person("Jana", "Ulrich", email = "jana.ulrich@met.fu-berlin.de", role = c("aut", "cre")),
person("Laura","Mack", email= "laura.mack@fu-berlin.de",role="ctb"),
person("Oscar E.","Jurado", email= "jurado@zedat.fu-berlin.de",role="ctb"),
person("Felix S.","Fauer", email= "felix.fauer@met.fu-berlin.de",role="ctb"),
person("Christoph", "Ritschel", role = "aut"),
person("Carola", "Detring", role = "ctb"),
person("Sarah", "Joedicke", role = "ctb"))
......@@ -16,7 +17,7 @@ Description: Intensity-duration-frequency (IDF) curves are a widely used analysi
precipitation time series on the basis of a duration-dependent
generalized extreme value distribution
[Koutsoyiannis et al., 1998, <doi:10.1016/S0022-1694(98)00097-3>].
Author: Jana Ulrich [aut, cre], Laura Mack [ctb], Oscar E. Jurado [ctb], Christoph Ritschel [aut], Carola Detring [ctb], Sarah Joedicke [ctb]
Author: Jana Ulrich [aut, cre], Laura Mack [ctb], Oscar E. Jurado [ctb], Felix S. Fauer [ctb], Christoph Ritschel [aut], Carola Detring [ctb], Sarah Joedicke [ctb]
Maintainer: Jana Ulrich <jana.ulrich@met.fu-berlin.de>
Imports: stats,
evd,
......
# IDF 2.0.0.9000
# IDF 2.1.0
## New features:
The package now enables the usage of multiscaling and flattening in IDF curves. All functions are adapted to the new features. With default arguments, the new features are not used.
The package now enables the usage of multiscaling and flattening in IDF curves. All functions are adapted to these new features. With default arguments, the new features are not used.
## Bug fixes
......@@ -13,7 +13,7 @@ The package now enables the usage of multiscaling and flattening in IDF curves.
# IDF 2.0.0
The package was extended to allow generalized linear modeling of the d-GEV parameters. This can be used to model for example spatial variations of the parameters.
The packet was extensively revised and restructured and some functions were removed as they were too specific.
The package was extensively revised and restructured and some functions were removed as they were too specific.
# IDF 1.0.0
......
......@@ -6,7 +6,7 @@
#'
#' @description Probability density function of duration-dependent GEV distribution
#' @param q vector of quantiles
#' @param mut,sigma0,xi numeric value, giving modified location \eqn{\tilde{\mu}}, scale offset \eqn{\tilde{\sigma_0}} and
#' @param mut,sigma0,xi numeric value, giving modified location \eqn{\tilde{\mu}}, scale offset \eqn{\sigma_0} and
#' shape parameter \eqn{\xi}.
#' @param theta numeric value, giving duration offset \eqn{\theta} (defining curvature of the IDF curve)
#' @param eta numeric value, giving duration exponent \eqn{\eta} (defining slope of the IDF curve)
......
......@@ -65,7 +65,7 @@ plot(ann.max$ds,ann.max$xdat,log='xy',xlab = 'Duration [h]',ylab='Intensity [mm/
```
* Step 2: fit d-GEV to annual maxima
```{r fit}
```{r fit,warning=FALSE}
fit <- gev.d.fit(xdat = ann.max$xdat,ds = ann.max$ds,sigma0link = make.link('log'))
# checking the fit
gev.d.diag(fit,pch=1,)
......@@ -96,6 +96,78 @@ IDF.plot(durations,params,add=TRUE)
```
## IDF Features
This Example depicts the different features that can be used to model the IDF curves.
Here we assume, that the block maxima of each duration can be modeled with the GEV distribution ($\xi\neq0$):
$$G(z;\mu,\sigma,\xi)=\exp \left\lbrace -\left[
1+\xi \left( \frac{z-\mu}{\sigma} \right)
\right]^{-1/\xi} \right\rbrace,$$
where the GEV parameters depend on duration according to:
$$
\sigma(d)=\sigma_0(d+\theta)^{-\eta_2}+\tau, \\
\mu(d) = \tilde{\mu}\cdot\sigma_0(d+\theta)^{-\eta}+\tau, \\
\xi(d) = \text{const.}
$$
The function `gev.d.fit` provides the options:
* `theta_zero = TRUE` $\theta = 0$
* `eta2_zero = TRUE` $\eta_2 = \eta$
* `tau_zero = TRUE` $\tau = 0$
resulting in the following features for IDF-curves:
* simple scaling: using only parameters $\tilde{\mu}, \sigma_0, \xi, \eta$
* curvature for small durations: allowing $\theta \neq 0$ (default)
* multi-scaling: allowing $\eta_2 \neq \eta$
* flattening for long durations: allowing $\tau \neq 0$.
Example:
```{r idf_features,warning=FALSE}
### sampling example data
set.seed(42)
# durations
ds <- 1/60*2^(seq(0,13,1))
# random data for each duration
xdat <- sapply(ds,rgev.d,n = 20,mut = 2,sigma0 =3,xi = 0.2,theta = 0.1,eta = 0.6,tau = 0.1,eta2 = 0.8)
# transform to data.frame
example <- data.frame(xdat=as.numeric(xdat),ds=rep(ds,each=dim(xdat)[1]))
### different fit options
fit.simple <- gev.d.fit(xdat=example$xdat,ds = example$ds,theta_zero = TRUE,show=FALSE)
fit.theta <- gev.d.fit(xdat=example$xdat,ds = example$ds,show=FALSE)
fit.eta2 <- gev.d.fit(xdat=example$xdat,ds = example$ds,eta2_zero = FALSE,show=FALSE)
fit.tau <- gev.d.fit(xdat=example$xdat,ds = example$ds,eta2_zero = FALSE,tau_zero = FALSE,show=FALSE)
### compare resulting idf-curves
# group fits
all.fits <- list(fit.simple,fit.theta,fit.eta2,fit.tau)
fit.cols <- c('red','purple','blue','darkgreen')
fit.labels <- c('simple-scaling','theta!=0','eta2!=eta','tau!=0')
# plotting probabilities
idf.probs <- c(0.5,0.75,0.99)
# create 4 plots for each additional parameter
par(mfrow=c(2,2),mar=c(0.2,0.2,0.2,0.2),oma=c(3.5,4.5,0,0),mgp=c(2.5,0.6,0))
for(i.fit in 1:length(all.fits)){
plot(example$ds,example$xdat,log='xy',type='n',axes=FALSE)
box()
boxplot(example$xdat~example$ds,at=ds,add = TRUE,
boxwex=0.2,cex=0.4,axes=FALSE)
if(i.fit %in% c(1,3)){
axis(2,las=2)
mtext('Intensity [mm/h]',2,3)
}
if(i.fit %in% 3:4){
axis(1,at=c(0.1,1,24,120),labels = c(0.1,1,24,120))
mtext('Duration [h]',1,2)
}
for(i.p in 1:length(idf.probs)){
IDF.plot(1/60*2^(seq(0,13,0.5)),gev.d.params(all.fits[[i.fit]]),probs = idf.probs[i.p],add = TRUE,legen=FALSE
,lty=i.p,cols = fit.cols[i.fit])
}
mtext(fit.labels[i.fit],3,-1.25)
}
legend('topright',lty=rev(1:3),legend = rev(idf.probs),title = 'p-quantile')
```
\ No newline at end of file
......@@ -74,13 +74,13 @@ fit <- gev.d.fit(xdat = ann.max$xdat,ds = ann.max$ds,sigma0link = make.link('log
#> [1] 0
#>
#> $nllh
#> [1] 66.68023
#> [1] 57.67781
#>
#> $mle
#> [1] 6.417126e+00 4.574141e-01 -1.141939e-02 1.514669e-09 8.020513e-01
#> [1] 7.253936e+00 2.905276e-01 9.574134e-02 1.067175e-10 8.025047e-01
#>
#> $se
#> [1] 3.957887e-01 7.238275e-02 4.930392e-02 2.000070e-06 1.125074e-02
#> [1] 4.308783e-01 6.889894e-02 6.099439e-02 2.000065e-06 1.119207e-02
# checking the fit
gev.d.diag(fit,pch=1,)
```
......@@ -91,8 +91,8 @@ gev.d.diag(fit,pch=1,)
# parameter estimates
params <- gev.d.params(fit)
print(params)
#> mut sigma0 xi theta eta
#> 1 6.417126 1.579983 -0.01141939 1.514669e-09 0.8020513
#> mut sigma0 xi theta eta eta2 tau
#> 1 7.253936 1.337133 0.09574134 1.067175e-10 0.8025047 0.8025047 0
# plotting the probability density for a single duration
q.min <- floor(min(ann.max$xdat[ann.max$ds%in%1:2]))
......@@ -104,7 +104,7 @@ for(d in 1:2){ # d=1h and d=2h
hist(ann.max$xdat[ann.max$ds==d],main = paste('d=',d),q.min:q.max
,freq = FALSE,add=TRUE,border = d)
# etimated prob. density:
lines(q,dgev.d(q,params$mut,params$sigma0,params$xi,params$theta,params$eta,d = d),col=d)
lines(q,dgev.d(q,params$mut,params$sigma0,params$xi,params$theta,params$eta,params$tau,d = d),col=d)
}
legend('topright',col=1:2,lwd=1,legend = paste('d=',1:2,'h'),title = 'Duration')
```
......@@ -121,3 +121,81 @@ IDF.plot(durations,params,add=TRUE)
```
<img src="man/figures/README-idf-1.png" width="100%" />
## IDF Features
This Example depicts the different features that can be used to model
the IDF curves. Here we assume, that the block maxima of each duration
can be modeled with the GEV distribution (\(\xi\neq0\)):
\[G(z;\mu,\sigma,\xi)=\exp \left\lbrace -\left[
1+\xi \left( \frac{z-\mu}{\sigma} \right)
\right]^{-1/\xi} \right\rbrace,\]
where the GEV parameters depend on duration according to:
\[
\sigma(d)=\sigma_0(d+\theta)^{-\eta_2}+\tau, \\
\mu(d) = \tilde{\mu}\cdot\sigma_0(d+\theta)^{-\eta}+\tau, \\
\xi(d) = \text{const.}
\]
The function `gev.d.fit` provides the options: \* `theta_zero = TRUE`
\(\theta = 0\) \* `eta2_zero = TRUE` \(\eta_2 = \eta\) \* `tau_zero =
TRUE` \(\tau = 0\)
resulting in the following features for IDF-curves: \* simple scaling:
using only parameters \(\tilde{\mu}, \sigma_0, \xi, \eta\) \* curvature
for small durations: allowing \(\theta \neq 0\) (default) \*
multi-scaling: allowing \(\eta_2 \neq \eta\) \* flattening for long
durations: allowing \(\tau \neq 0\).
Example:
``` r
### sampling example data
set.seed(42)
# durations
ds <- 1/60*2^(seq(0,13,1))
# random data for each duration
xdat <- sapply(ds,rgev.d,n = 20,mut = 2,sigma0 =3,xi = 0.2,theta = 0.1,eta = 0.6,tau = 0.1,eta2 = 0.8)
# transform to data.frame
example <- data.frame(xdat=as.numeric(xdat),ds=rep(ds,each=dim(xdat)[1]))
### different fit options
fit.simple <- gev.d.fit(xdat=example$xdat,ds = example$ds,theta_zero = TRUE,show=FALSE)
fit.theta <- gev.d.fit(xdat=example$xdat,ds = example$ds,show=FALSE)
fit.eta2 <- gev.d.fit(xdat=example$xdat,ds = example$ds,eta2_zero = FALSE,show=FALSE)
fit.tau <- gev.d.fit(xdat=example$xdat,ds = example$ds,eta2_zero = FALSE,tau_zero = FALSE,show=FALSE)
### compare resulting idf-curves
# group fits
all.fits <- list(fit.simple,fit.theta,fit.eta2,fit.tau)
fit.cols <- c('red','purple','blue','darkgreen')
fit.labels <- c('simple-scaling','theta!=0','eta2!=eta','tau!=0')
# plotting probabilities
idf.probs <- c(0.5,0.75,0.99)
# create 4 plots for each additional parameter
par(mfrow=c(2,2),mar=c(0.2,0.2,0.2,0.2),oma=c(3.5,4.5,0,0),mgp=c(2.5,0.6,0))
for(i.fit in 1:length(all.fits)){
plot(example$ds,example$xdat,log='xy',type='n',axes=FALSE)
box()
boxplot(example$xdat~example$ds,at=ds,add = TRUE,
boxwex=0.2,cex=0.4,axes=FALSE)
if(i.fit %in% c(1,3)){
axis(2,las=2)
mtext('Intensity [mm/h]',2,3)
}
if(i.fit %in% 3:4){
axis(1,at=c(0.1,1,24,120),labels = c(0.1,1,24,120))
mtext('Duration [h]',1,2)
}
for(i.p in 1:length(idf.probs)){
IDF.plot(1/60*2^(seq(0,13,0.5)),gev.d.params(all.fits[[i.fit]]),probs = idf.probs[i.p],add = TRUE,legen=FALSE
,lty=i.p,cols = fit.cols[i.fit])
}
mtext(fit.labels[i.fit],3,-1.25)
}
legend('topright',lty=rev(1:3),legend = rev(idf.probs),title = 'p-quantile')
```
<img src="man/figures/README-idf_features-1.png" width="100%" />
## Resubmission
This is a resubmission. In this version I have:
* Updated the date in the description
## Test environments
* local ,Debian Linux 4.19.160-2, R 3.6.3
* Ubuntu Linux 16.04 LTS, R-release, GCC
* Fedora Linux, R-devel, clang, gfortran
* Windows Server 2008 R2 SP1, R-devel, 32/64 bit
* local: Debian Linux 4.19.160-2, R 3.6.3
* win-builder (devel and release)
* rhub:
- Windows Server 2008 R2 SP1, R-devel, 32/64 bit
- Ubuntu Linux 20.04.1 LTS, R-release, GCC
- Fedora Linux, R-devel, clang, gfortran
## R CMD check results
There were no ERRORs and WARNINGs.
There was 1 NOTE:
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Jana Ulrich <jana.ulrich@met.fu-berlin.de>'
New submission
Package was archived on CRAN
Possibly mis-spelled words in DESCRIPTION:
IDF (3:35, 12:44, 15:64)
Koutsoyiannis (18:16)
Mailhot (14:21)
al (14:32, 18:33)
et (14:29, 18:30)
CRAN repository db overrides:
X-CRAN-Comment: Archived on 2020-03-13 as check problems were not
corrected in time.
Status: OK
There were no ERRORs and WARNINGs and NOTEs.
The maintainer of this package has changed. The former maintainer did not inform us that check problems had occurred.
This submission is a substantially revised version.
## Reverse dependencies
There are currently no downstream dependencies for this package.
......
......@@ -9,7 +9,7 @@ dgev.d(q, mut, sigma0, xi, theta, eta, d, eta2 = NULL, tau = 0, ...)
\arguments{
\item{q}{vector of quantiles}
\item{mut, sigma0, xi}{numeric value, giving modified location \eqn{\tilde{\mu}}, scale offset \eqn{\tilde{\sigma_0}} and
\item{mut, sigma0, xi}{numeric value, giving modified location \eqn{\tilde{\mu}}, scale offset \eqn{\sigma_0} and
shape parameter \eqn{\xi}.}
\item{theta}{numeric value, giving duration offset \eqn{\theta} (defining curvature of the IDF curve)}
......
man/figures/README-annualmax-1.png

9.53 KB | W: | H:

man/figures/README-annualmax-1.png

9.32 KB | W: | H:

man/figures/README-annualmax-1.png
man/figures/README-annualmax-1.png
man/figures/README-annualmax-1.png
man/figures/README-annualmax-1.png
  • 2-up
  • Swipe
  • Onion skin
man/figures/README-fit-1.png

44.4 KB | W: | H:

man/figures/README-fit-1.png

47.4 KB | W: | H:

man/figures/README-fit-1.png
man/figures/README-fit-1.png
man/figures/README-fit-1.png
man/figures/README-fit-1.png
  • 2-up
  • Swipe
  • Onion skin
man/figures/README-fit-2.png

22.1 KB | W: | H:

man/figures/README-fit-2.png

22 KB | W: | H:

man/figures/README-fit-2.png
man/figures/README-fit-2.png
man/figures/README-fit-2.png
man/figures/README-fit-2.png
  • 2-up
  • Swipe
  • Onion skin
man/figures/README-idf-1.png

36.6 KB | W: | H:

man/figures/README-idf-1.png

36.2 KB | W: | H:

man/figures/README-idf-1.png
man/figures/README-idf-1.png
man/figures/README-idf-1.png
man/figures/README-idf-1.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment