chaospy.TCopula¶
- class chaospy.TCopula(dist, df, covariance)[source]¶
T-Copula.
- Examples:
>>> distribution = chaospy.TCopula( ... chaospy.Iid(chaospy.Uniform(-1, 1), 2), ... df=5, covariance=[[1, .5], [.5, 1]]) >>> distribution TCopula(Iid(Uniform(lower=-1, upper=1), 2), 5.0, [[1.0, 0.5], [0.5, 1.0]]) >>> samples = distribution.sample(3) >>> samples.round(4) array([[ 0.3072, -0.77 , 0.9006], [ 0.1274, 0.3147, 0.1928]]) >>> distribution.pdf(samples).round(4) array([0.2932, 0.1367, 0.1969]) >>> 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.2699, -0.1738, -0.0741], [-0.1011, 0. , 0.1011], [ 0.0741, 0.1738, 0.2699]]])
- __init__(dist, df, covariance)[source]¶
- Args:
- dist (Distribution):
The distribution to wrap in a copula.
- R (numpy.ndarray):
Covariance matrix defining dependencies..
- df (float):
The degree of freedom in the underlying student-t distribution.
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
Flag indicating that return value from the methods sample, and inv should be interpreted as integers instead of floating point.
Lower bound for the distribution.
True if distribution contains stochastically dependent components.
Upper bound for the distribution.