Commit d4ef04ee authored by Christoph Ritschel's avatar Christoph Ritschel
Browse files

*Paketversion1.1*

parent d98f1874
Package: IDF
Type: Package
Title: Estimating intensity-duration-frequency parameters
Version: 1.01
Date: 2016-01-28
Author: Christoph Ritschel, Sarah Joedicke
Title: Estimation and Plotting of IDF Curves
Version: 1.1
Date: 2017-09-29
Author: Christoph Ritschel, Carola Detring, Sarah Joedicke
Maintainer: Christoph Ritschel <christoph.ritschel@met.fu-berlin.de>
Description: The package 'IDF' reads precipitation data from webwerdis and Berlin Stadtmessnetz.
It aggregates these data and calculates yearly intensity maxima. From those maxima intensity-duration-frequency
parameters are estimated. IDF curves based on these estimated parameters can be plotted.
Depends: stats4, evd
Description: Intensity-duration-frequency (IDF) curves are a widely used analysis-tool in hydrology to assess extreme values of precipitation [e.g. Mailhot et al., 2007, <doi:10.1016/j.jhydrol.2007.09.019>]. The package 'IDF' provides a function to read precipitation data from German weather service (DWD) 'webwerdis' <http://www.dwd.de/EN/ourservices/webwerdis/webwerdis.html> files and Berlin station data from 'Stadtmessnetz' <http://www.geo.fu-berlin.de/en/met/service/stadtmessnetz/index.html> files, and additionally IDF parameters can be estimated also from a given data.frame containing a precipitation time series. The data is aggregated to given levels yearly intensity maxima are calculated either for the whole year or given months. From these intensity maxima IDF parameters are estimated on the basis of a duration-dependent generalised extreme value distribution [Koutsoyannis et al., 1998, <doi:10.1016/S0022-1694(98)00097-3>]. IDF curves based on these estimated parameters can be plotted.
Depends:
stats4,
evd,
ismev
License: GPL (>=2)
RoxygenNote: 5.0.1
exportPattern(IDF.read,IDF.fit,IDF.plot)
export(IDF.read,IDF.fit,IDF.plot,TS.acc)
import(ismev,
stats4,
evd)
importFrom("grDevices", "rgb")
importFrom("graphics", "axis", "legend", "points")
importFrom("stats", "filter", "lm")
importFrom("utils", "read.csv2", "read.table", "str")
# Generated by roxygen2: do not edit by hand
# Import all packages listed as Imports or Depends
import(
stats4,
evd
)
This diff is collapsed.
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{IDF.fit}
\alias{IDF.fit}
\title{Fitting IDF model parameters to observations at different durations}
\usage{
IDF.fit(data, agg.lev = c(2, 3, 6, 12, 24, 48, 72, 96), month = "all",
mu = 1, sigma = 1, xi = 0, theta = 0, eta = 1, use.log = FALSE,
DEBUG = FALSE, method = "Nelder-Mead", upper = Inf, lower = -Inf,
plot = FALSE, station.name = "Berlin")
moving.sum = "FALSE", theta.init = 0, use.log = FALSE, DEBUG = FALSE,
method = "Nelder-Mead", upper = Inf, lower = -Inf, plot = FALSE,
probs = c(0.5, 0.9, 0.99), cols = c(rgb(1, 0, 0, 1), rgb(0, 1, 0, 1),
rgb(0, 0, 1, 1)), station.name = "Berlin", data.name = "obs")
}
\arguments{
\item{data}{a \code{list} containing a \code{data.frame} named 't1', preferably generated by function \code{IDF.read}.}
\item{data}{a \code{data,frame}, preferably generated by function \code{IDF.read}. It should at least contain a \code{$RR} and \code{$year} element for the
function tow work properly.}
\item{agg.lev}{a vector of aggregation levels used to fit the IDF curves.}
\item{month}{a value specifying the month to be used for estimating the IDF parameters. Type "all" for all months.}
\item{month}{\code{integer} value specifying the month to be used for estimating the IDF parameters. Type "all" for all months or if
the whole time series should be fitted.}
\item{mu}{location value}
\item{moving.sum}{\code{logical} specifying if moving sum filtering should be applied for time series aggregation.}
\item{sigma}{scale value}
\item{xi}{shape value}
\item{theta}{value defining the curvature of the IDF}
\item{eta}{value defining the slope of the IDF}
\item{theta.init}{inital value defining the curvature of the IDF, default is zero, it is not recommended to change it}
\item{use.log}{\code{logical} value for usage of logarithmic values, default is \code{FALSE}}
\item{DEBUG}{\code{logical} value for usage of debugging, if \code{TRUE} the input parameters and the value of negative
log-likelihood are printed on console for each iteration during optimization.}
\item{DEBUG}{\code{logical} value for usage of debugging, if \code{TRUE} the input parameters and the value of negative}
\item{method}{\code{character} defining the method to be used in \code{optim}, preferences are: "Nelder-Mead", "BFGS", "L-BFGS-B"e}
......@@ -39,7 +35,13 @@ log-likelihood are printed on console for each iteration during optimization.}
\item{plot}{\code{logical} option of creating a plot of IDF curves with estimated parameters.}
\item{station.name}{\code{character} naming of data input, e.g. a observational station name}
\item{probs}{a vector of probabilities for which the IDF curves are calculated}
\item{cols}{a vector of colors for the seperate IDF curves, needs same length as \code{probs}}
\item{station.name}{\code{character} overall naming of the IDF plot, e.g. name of location or model name}
\item{data.name}{\code{character} naming the data points, e.g. obs or model name}
}
\value{
$ints vector of sorted intensities for selected aggregation levels
......@@ -52,13 +54,20 @@ $par vector of estimated IDF model parameters mu,sigma,xi,theta,eta at minimum v
}
\description{
The function \code{IDF.fit} fits the IDF model parameters \code{mu,sigma,xi,eta,theta}
to a list object of observations \code{data} in a data.frame with temporal inforamtion and values of precipitation
at a given temporal resoultion. This precipitation time series gets aggregated at given aggregation levels
\code{agg.lev} and yearly maxima of intensity are caluclated for a specific month or the whole year.
to a data.frame of observations \code{data} with temporal inforamtion (at least years) and values of precipitation
at a given temporal resoultion. This precipitation time series gets aggregated at given aggregation levels.
\code{agg.lev} and yearly maxima of intensity are caluclated for a specific month or the whole year/dataset.
The starting values of the IDF model parameters can be determined by the user as well as specific options to use
during optimization. Logartihmic transformation, debugging, the optimization method, and an option to plot the
IDF curves.
}
\examples{
RR <- rgamma(10*30*24,shape=1)
year <- sort(rep(1:(10),30*24))
data <- data.frame(RR,year)
fit <- IDF.fit(data)
pars <- fit$par
}
\author{
Christoph Ritschel \email{christoph.ritschel@met.fu-berlin.de}
}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{IDF.nll}
\alias{IDF.nll}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{IDF.plot}
\alias{IDF.plot}
......@@ -6,7 +6,7 @@
\usage{
IDF.plot(pars, probs = c(0.5, 0.9, 0.99), dur = c(0.5, 1, 2, 3, 6, 12, 24,
48, 72, 96), cols = c(rgb(1, 0, 0, 1), rgb(0, 1, 0, 1), rgb(0, 0, 1, 1)),
name = "Berlin-Dahlem", ints = NA, ds = NA)
st.name = "Berlin-Dahlem", dt.name = "obs", ints = NA, ds = NA)
}
\arguments{
\item{pars}{a vector of IDF model parameters mu,sigma,xi,eta,theta}
......@@ -17,7 +17,9 @@ IDF.plot(pars, probs = c(0.5, 0.9, 0.99), dur = c(0.5, 1, 2, 3, 6, 12, 24,
\item{cols}{a vector of colors for the seperate IDF curves, needs same length as \code{probs}}
\item{name}{a character string defining the station name for which the IDF curves are calculated, will be printed in legend}
\item{st.name}{\code{character} overall naming of the IDF plot, e.g. name of location or model name}
\item{dt.name}{\code{character} naming the data points, e.g. obs or model name}
\item{ints}{\code{vector} of observational intensities (surted by durations)}
......@@ -28,6 +30,14 @@ The function \code{IDF.plot} plots a set of IDF curves with given IDF model para
several probability levels \code{probs} at given durations \code{dur}. The colors of the curves can be defined with
parameter \code{cols} (need to have same length as \code{probs}). The \code{station.name} will be printed in the legend.
}
\examples{
RR <- rgamma(10*30*24,shape=1)
year <- sort(rep(1:(10),30*24))
data <- data.frame(RR,year)
fit <- IDF.fit(data)
param <- fit$par
IDF.plot(pars=param,st.name="example",dt.name="rgamma")
}
\author{
Christoph Ritschel \email{christoph.ritschel@met.fu-berlin.de}
}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{IDF.read}
\alias{IDF.read}
......@@ -10,16 +10,16 @@ IDF.read(file, type)
\item{file}{a \code{character string} naming the file from which the data is to be read.}
\item{type}{a \code{character string} defining the type of data to be read: either "stadtmessnetz" or "webwerdis", depending on if the data comes from the Stadtmessnetz Berlin
or WebWerdis. If type = "webwerdis", the data will be read, then sorted, formatted and missing lines added,
while if type = "stadtmessnetz", the data will just be read and formatted.
or WebWerdis. If type = "webwerdis", the data will be read, then sorted, formatted and missing lines added,
while if type = "stadtmessnetz", the data will just be read and formatted.
Both source types have a different layout in the original file.}
}
\value{
Liste a \code{list} containing a \code{data.frame} of date and time information and precipitation values for each time step
Liste a \code{data.frame} of date and time information and precipitation values for each time step
}
\description{
The function \code{IDF.read} reads a file in table format and creates a \code{list} from it, writing the data frame as first entry
and adds some attributes (station information, aggregation time, data source). The only data values used are:
The function \code{IDF.read} reads a file in table format and creates a \code{data.frame} from it
and adds some attributes (station information, aggregation time, data source). The only data values used are:
date, precipitation
The \code{data.frame} will have the following format:
| year | mon | day | hour | min | RR |
......@@ -27,16 +27,15 @@ The \code{data.frame} will have the following format:
| | | | | | |
}
\details{
This function is designed to prepare a data file for aggregation by functions \code{IDF.agg} or \code{IDF.magg}.
This function is designed to prepare a data file for doing an estimation on IDF parameters in function \code{IDF.fit}.
The time given in the data is the end time, so the precipitation was measured up to that time.
}
\note{
The first entry of the list will be a \code{data.frame} named 't1'.
}
\author{
Sarah Joedicke \email{sarah.joedicke@fu-berlin.de}
Christoph Ritschel \email{christoph.ritschel@met.fu-berlin.de}
}
\seealso{
read.table, IDF.agg, IDF.magg
read.table, IDF.fit
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{TS.acc}
\alias{TS.acc}
\title{Accumulation of a time series}
\usage{
TS.acc(x,acc.val,moving.sum="FALSE")
}
\arguments{
\item{x}{\code{vector} of a time series}
\item{acc.val}{\code{value} specifying the accumulation level, minimum value is 2}
\item{moving.sum}{\code{logical} 'TRUE' means moving sum will be applied}
}
\value{
x.acc \code{TS.acc} returns a \code{vector} of an accumulated time series
}
\description{
\code{TS.acc} accumulates a given time series \code{x} at a given accumulation level \code{acc.val}. Minimum value
for acc.val is 2 [unit time]. Option for using moving sum is given.
}
\examples{
TS <- rgamma(n=1000,shape=1)
acc.2 <- TS.acc(TS,acc.val=2)
\donttest{
acc.24 <- TS.acc(TS,acc.val=24,moving.sum=TRUE)
}
}
\author{
Christoph Ritschel \email{christoph.ritschel@met.fu-berlin.de}
Carola Detring \email{carola.detring@met.fu-berlin.de}
}
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{dgev.d}
\alias{dgev.d}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{fit.fun}
\alias{fit.fun}
......@@ -40,7 +40,7 @@ $min value of negative log-likelihood at optimization minimum
$par vector of IDF parameters at optimization minimum
}
\description{
The function \code{fit.fun} fits IDF model parameters \code{mu,sigma,xi,theta,eta} to a set of given observations \code{obs},
The function \code{fit.fun} fits IDF model parameters \code{mu,sigma,xi,theta,eta} to a set of given observations \code{obs},
typically a series of yearly maxima at different durations \code{d}. Options for using logarithmic parameter values and debugging
are given. Also the \code{optim} parameters \code{method} and \code{upper,lower} can be defined.
}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{qgev.d}
\alias{qgev.d}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IDF.R
\name{rgev.d}
\alias{rgev.d}
......
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