simAtSite: Simulation of at-site data

Description Usage Arguments Details See Also Examples

Description

Returns a matrix of the simulation of at-site data based on the choice of a marginal distribution and a copula model.

Usage

1
2
3
simAtSite(n, distr = "gev", marg = c(0, 1, 0), cop = "norm", h = NULL,
  type = "exp", p = NULL, sigma = NULL, demi = NULL, nu = Inf,
  unpivot = FALSE)

Arguments

n

Number of simulation.

distr

The marginal distribution. See vec2par.

marg

The parameter of the marginal distribution. Either a vector or a matrix with parameters in rows.

cop

A string representing the copula familly. Possible choice: Normal ('norm'), t-copula ('t'), Chi-square ('chisq'), squared t-copula ('tsq'), reverse chi-square ('rchisq') and reverse squared t-copula ('rtsq').

h

A matrix of distances. If model == 'ind' and distr == 'unif', a number of sites must be provided instead.

type

A string representing a correlation model. See corModel

p

The parameters of the correlation model .

sigma, demi

Covariance matrix or its square root.

nu

Degree of freedom of a t-copula (if necessary).

unpivot

If TRUE the results is returns in the form of a table with columns : id, time, value.

Details

The Chi-squared and the squared t-copula are the copulas of the squared variables coming from a multivariate Normal and Student distribution respectively. The "squared" copulas introduce radial asymmetry and their reverse have asymmetry in the opposite direction.

See Also

corModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
xx <- simAtSite(100, distr = 'gev', marg = c(100, 10, .1),
                cop = 'ind', h = 10, unpivot = TRUE)

coord <- replicate(2,runif(200,0,500))
h <- as.matrix(dist(coord))

# normal copula
xx <- simAtSite(1000, marg = c(100,20,-.1), h = h, p = c(400,0))

hist(xx[,2])

# t-copula

demi <- chol(corModel(c(400,0),h))
xx <- simAtSite(100, distr = 'unif',
                cop = 't', demi = demi, nu = 5)

hist(xx)

martindurocher/floodRFA documentation built on June 5, 2019, 8:44 p.m.