MC_logit: Overflow counting for simulated data

View source: R/MC_sim.R

MC_logitR Documentation

Overflow counting for simulated data

Description

Function simulate given number of rainfall event by Monte-Carlo method and calculate number of overflows in them based on logistic regression model. Rainfall distributions are estimated based on sample data.

Usage

MC_logit(
  dt,
  logit.model = mod,
  rt,
  n = 1000,
  Imp = NULL,
  Impu = NULL,
  Gk = NULL,
  plot = TRUE
)

Arguments

dt

data frame, sample of rainfall events based on which rainfall parameters will be estimated

logit.model

name of logistic regression for Overflow already fitted

rt

numeric vector of length 2, lower and upper bound of rainfall event duration. See details

n

number of simulations

Imp

level of imperviousness of the catchment, in %. Default value NULL - no control for Imp

Impu

the level of imperviousness of the area lying below the analysed catchment, in %. Default value NULL - no control for Impu

Gk

unitary length of the main collector in the catchment per impervious area, in m/ha. Default value NULL - no controln for Gk

plot

logical, choose is you want to plot CDFs

Details

You can choose bounds of rainfall event duration, which filter all events to particular type of rainfall (convectional, frontal or convergence zones)

Value

MC_logit returns number of overflows, CDFs of overflow probability and rainfall intensity for different sets of catchment area parameters

Warning

before you use this function you should fit logistic regression for Overflow

Examples

dt <- data.frame(P = rgamma(100, shape = 12, rate = 0.2),
                 t = rlnorm(100, meanlog = 5, sdlog = 1.5))
mod <- logit(dt.logit)
MC_logit(dt, mod, rt = c(0,150), n = 1000, Imp = 0.2, Impu = 0.1, Gk = 0.05)
mod2 <- logit(dt.logit[, c(1:2,6)]) # no Imp, Impu, Gk
MC_logit(dt, mod2, rt = c(150,630), n = 1000)

dax44/OvfSim documentation built on April 29, 2022, 6:53 a.m.