chaospy.Nataf

class chaospy.Nataf(dist, covariance)[source]

Nataf (normal) copula.

Examples:
>>> distribution = chaospy.Nataf(
...     chaospy.Iid(chaospy.Uniform(-1, 1), 2), covariance=[[1, .5], [.5, 1]])
>>> distribution
Nataf(Iid(Uniform(lower=-1, upper=1), 2), [[1.0, 0.5], [0.5, 1.0]])
>>> samples = distribution.sample(3)
>>> samples.round(4)
array([[ 0.3072, -0.77  ,  0.9006],
       [ 0.1262,  0.3001,  0.1053]])
>>> distribution.pdf(samples).round(4)
array([0.292 , 0.1627, 0.2117])
>>> distribution.fwd(samples).round(4)
array([[0.6536, 0.115 , 0.9503],
       [0.4822, 0.8725, 0.2123]])
>>> mesh = numpy.meshgrid([.4, .5, .6], [.4, .5, .6])
>>> distribution.inv(mesh).round(4)
array([[[-0.2   ,  0.    ,  0.2   ],
        [-0.2   ,  0.    ,  0.2   ],
        [-0.2   ,  0.    ,  0.2   ]],

       [[-0.2707, -0.1737, -0.0739],
        [-0.1008,  0.    ,  0.1008],
        [ 0.0739,  0.1737,  0.2707]]])
__init__(dist, covariance)[source]
Args:
dist (Distribution):

The distribution to wrap.

covariance (numpy.ndarray):

Covariance matrix.

Methods

pdf(x_data[, decompose, allow_approx, step_size])

Probability density function.

cdf(x_data)

Cumulative distribution function.

fwd(x_data)

Forward Rosenblatt transformation.

inv(q_data[, max_iterations, tollerance])

Inverse Rosenblatt transformation.

sample([size, rule, antithetic, ...])

Create pseudo-random generated samples.

mom(K[, allow_approx])

Raw statistical moments.

ttr(kloc)

Three terms relation's coefficient generator.

Attributes

interpret_as_integer

Flag indicating that return value from the methods sample, and inv should be interpreted as integers instead of floating point.

lower

Lower bound for the distribution.

stochastic_dependent

True if distribution contains stochastically dependent components.

upper

Upper bound for the distribution.