NatafGH: Solve the Nataf integral with the Gauss-Hermite integration...

Description Usage Arguments Value Note Examples

View source: R/NatafGH.R

Description

Estimation of the resulting (i.e., in the actual domain) correlation coefficients, given the equivalent correlation coefficients (i.e., in the Gaussian domain).

Usage

1
NatafGH(rho, fx, fy, paramlistfx, paramlistfy, nodes = 21, prune = 0)

Arguments

rho

A scalar or vector of correlation coefficients (i.e., in seq(from=0, to=1, by=0.1)).

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.

nodes

A scalar indicating the number of nodes for Gauss-Hermite integration (default: nodes=21).

prune

A scalar in (0,1) indicating the percentage of pruning for Gauss-Hermite integration (default: nodes=0).

Value

A vector of correlation coefficients in the actual domain

Note

Avoid the use of this function, when the marginal(s) are discrete. This R function is based on the blog-post of Matthew S. Shotwell (https://biostatmatt.com/archives/2754).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## The case of two identrical Gamma distributions, with shape=1 and scale=1.
## Not run: 
fx=fy='qgamma'
pfx=pfy=list(shape=1, scale=1)
rhoz=seq(from=0, to=1 , by=0.05)
rhox=NatafGH(rho = rhoz, fx = fx, fy = fy, paramlistfx = pfx,
paramlistfy = pfy, nodes = 10, prune = 0)
plot(rhoz,rhox); abline(0,1)

## The case of two identrical zero-inflated (i.e., mixed) distributions,
with p0=0.7 a Gamma distribution
## for the continuous part with shape=1 and scale=1.

fx=fy='qzi'
pfx=pfy=list(Distr=qgamma, p0=0.7, shape=0.5, scale=1)
rhoz=seq(from=0, to=1 , by=0.05)
rhox=NatafGH(rho = rhoz, fx = fx, fy = fy, paramlistfx = pfx,
paramlistfy = pfy, nodes = 21, prune = 0)
plot(rhoz,rhox); abline(0,1)

## End(Not run)

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