copulas.multivariate.gaussian module

GaussianMultivariate module.

class copulas.multivariate.gaussian.GaussianMultivariate(distribution=<class 'copulas.univariate.base.Univariate'>, random_state=None)[source]

Bases: Multivariate

Class for a multivariate distribution that uses the Gaussian copula.

Parameters:

distribution (str or dict) – Fully qualified name of the class to be used for modeling the marginal distributions or a dictionary mapping column names to the fully qualified distribution names.

columns = None
correlation = None
cumulative_distribution(X)[source]

Compute the cumulative distribution value for each point in X.

Parameters:

X (pandas.DataFrame) – Values for which the cumulative distribution will be computed.

Returns:

Cumulative distribution values for points in X.

Return type:

numpy.ndarray

Raises:

NotFittedError – if the model is not fitted.

fit(X)[source]

Compute the distribution for each variable and then its correlation matrix.

Parameters:

X (pandas.DataFrame) – Values of the random variables.

classmethod from_dict(copula_dict)[source]

Create a new instance from a parameters dictionary.

Parameters:

params (dict) – Parameters of the distribution, in the same format as the one returned by the to_dict method.

Returns:

Instance of the distribution defined on the parameters.

Return type:

Multivariate

probability_density(X)[source]

Compute the probability density for each point in X.

Parameters:

X (pandas.DataFrame) – Values for which the probability density will be computed.

Returns:

Probability density values for points in X.

Return type:

numpy.ndarray

Raises:

NotFittedError – if the model is not fitted.

sample(num_rows=1, conditions=None)[source]

Sample values from this model.

Argument:
num_rows (int):

Number of rows to sample.

conditions (dict or pd.Series):

Mapping of the column names and column values to condition on.

Returns:

Array of shape (n_samples, *) with values randomly sampled from this model distribution. If conditions have been given, the output array also contains the corresponding columns populated with the given values.

Return type:

numpy.ndarray

Raises:

NotFittedError – if the model is not fitted.

to_dict()[source]

Return a dict with the parameters to replicate this object.

Returns:

Parameters of this distribution.

Return type:

dict

univariates = None