RegSim: Simulation of a regional dataset with intersite correlation.

Description Usage Arguments Examples

Description

Returns a dataset containing multiple time series in the form of a matrix where the sites are in columns. Different record lengths can be specified for each site and missing values are filled accordingly at the beginning. The rows (time) are independent and the intersite correlation model is based on a multivariate Normal distribution.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
RegSim(x, ...)

## S3 method for class 'matrix'
RegSim(x, distr, nrec, corr = 0, corr.sqrt = FALSE,
  lmom = TRUE, lscale = FALSE, long = FALSE)

## S3 method for class 'intersite'
RegSim(obj, distr, n = 1)

## S3 method for class 'poolgrp'
RegSim(obj, n = 1, long = FALSE, ...)

Arguments

x, obj

Matrix (in rows) of parameters or L-moments for all sites to simulate. Can also be a pooling group or intersite model, where key arguments are extracted from the input object.

distr

Marginal distribution of each site. If only one value is passed as argument, the same is used for all sites.

nrec

Record lengths of the sites. If only one value is passed in argument, the same is used for all sites.

corr

Correlation matrix for the dependence between site. If only one value is passed, the correlation is assumed the for every pair of sites.

corr.sqrt

Squared correlation matrix. Can be passed to speed up multiple calls.

lmom

Logical. Is the argument 'x' a matrix of L-moments or distribution parameters

lscale

Logical. Is the second L-moments the scale ('TRUE') or the LCV ('FALSE').

long

Logical. Should the output be returned in a long format.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Extract data
data(canFlood)
lmom <- canFlood[1:5, c('L1','LCV','LSK')]

## Simulate data base on at-site L-moments
sim <- RegSim(lmom, distr = 'gev', nrec = 11:15, corr = .4)

head(sim)

sim <- RegSim(lmom,
              distr = c(rep('gev',4),'gno'),
              nrec = 10:15,
              corr = .4, long = TRUE)
head(sim)

############################################################################

martindurocher/floodStat documentation built on May 31, 2019, 12:42 a.m.