MC: Rainfall Monte-Carlo simulator

View source: R/MC_sim.R

MCR Documentation

Rainfall Monte-Carlo simulator

Description

Function simulate given number of rainfall events with Latin Hypercube Monte-Carlo method. Correlations between rainfall parameters are taken into account by Iman-Conover method of simulating data.

Usage

MC(dt, rt = NULL, n = 1000)

Arguments

dt

data frame of sample of rainfall events

rt

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

n

number of rainfall events to simulate

Details

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

Value

return data frame of simulated rainfall parameters, number of simulated rows could be less than n because function remove nonsensical simulations like t < 0 or P < 0

Examples

dt <- data.frame(P = rgamma(100, shape = 12, rate = 0.2), t = rlnorm(100, meanlog = 5, sdlog = 1))
MC(dt, rt = c(0,150), n = 1000)

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