NatafInvD: Direct estimation of equivalent correlation coefficients.

Description Usage Arguments Value Note Examples

View source: R/NatafInvD.R

Description

Direct estimation of equivalent correlation coefficients (i.e., in the Gaussian domain).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
NatafInvD(
  targetrho,
  fx,
  fy,
  paramlistfx,
  paramlistfy,
  NatafIntMethod = "GH",
  NoEval = 19,
  polydeg = 8,
  ...
)

Arguments

targetrho

A scalar or vector of target correlation coefficients.

fx

A string indicating the quantile function of the distribution (i.e., the ICDF).

fy

A string indicating the quantile function of the distribution (i.e., the ICDF).

paramlistfx

A named list with the parameters of the distribution.

paramlistfy

A named list with parameters of the distribution.

NatafIntMethod

A string ("GH", "Int", or "MC"), indicating the integration method, to resolve the Nataf integral.

NoEval

A scalar indicating (default: 9) the number of evaluation points for the integration methods.

polydeg

A scalar indicating the order of the fitted polynomial. If polydeg=0, then an alternative parametric curve is fitted (see, Papalexiou, 2018).

...

Additional named arguments for the selected "NatafIntMethod" method.

Value

A named list with two elements: dfnataf: A dataframe that contains the pairs of Gaussian and resulting correlation coefficients, upon which the curve (polynomial or other) was fitted. rzEq: A vector with the equivalent correlation coefficients, that result into the target ones (i.e., targetrho).

Note

Avoid the use of the "GH" method (i.e., NatafIntMethod='GH'), when the marginal(s) are discrete.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## The case of two identrical zero-inflated (i.e., mixed) distributions,
## with p0=0.9 a Gamma distribution
## for the continuous part with shape=0.1 and scale=1.
## Not run: 
fx=fy='qzi'
pfx=pfy=list(Distr=qgamma, p0=0.9, shape=0.1, scale=1)
rhoz=seq(from=0, to=1 , length.out = 21)
rhox=NatafInt(rho = rhoz, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy)
plot(rhox,rhoz, col='red', pch=19); abline(0,1)
rhotarget=seq(from=0.0001, to=0.9999 , length.out = 210)
req=NatafInvD(targetrho = rhotarget, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy,
              NatafIntMethod = 'GH', polydeg=8, NoEval = 9)
points(rhotarget, req, col='blue', pch=17);

req=NatafInvD(targetrho = rhotarget, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy,
              NatafIntMethod = 'GH', polydeg=8, NoEval = 9)
points(rhotarget, req, col='green')

## End(Not run)
## The case with identical Bernoulli distributions, with size=1 and prob=0.2.

## Not run: 
fx=fy='qbinom'
pfx=pfy=list(size=1, prob=0.2)
rhoz=seq(from=0, to=1 , length.out = 21)
rhox=NatafInt(rho = rhoz, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy)
plot(rhox,rhoz, col='red', pch=19); abline(0,1)
rhotarget=seq(from=0.0001, to=0.9999 , length.out = 210)
req=NatafInvD(targetrho = rhotarget, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy,
              NatafIntMethod = 'Int', polydeg=8, NoEval = 9)$rzEq
points(rhotarget, req, col='blue', pch=17);

req2=NatafInvD(targetrho = rhotarget, fx = fx, fy = fy, paramlistfx = pfx, paramlistfy = pfy,
              NatafIntMethod = 'Int', polydeg=8, NoEval = 9)$rzEq
points(rhotarget, req2, col='green')

## End(Not run)

itsoukal/anySim documentation built on May 7, 2020, 11:57 p.m.