statsmodels.distributions.copula.api.CopulaDistribution.rvs¶
-
CopulaDistribution.rvs(nobs=
1
, cop_args=None
, marg_args=None
, random_state=None
)[source]¶ Draw n in the half-open interval
[0, 1)
.Sample the joint distribution.
- Parameters:¶
- nobs
int
,optional
Number of samples to generate in the parameter space. Default is 1.
- cop_args
tuple
Copula parameters. If None, then the copula parameters will be taken from the
cop_args
attribute created when initiializing the instance.- marg_args
list
of
tuples
Parameters for the marginal distributions. It can be None if none of the marginal distributions have parameters, otherwise it needs to be a list of tuples with the same length has the number of marginal distributions. The list can contain empty tuples for marginal distributions that do not take parameter arguments.
- random_state{
None
,int
,numpy.random.Generator
},optional
If seed is None then the legacy singleton NumPy generator. This will change after 0.13 to use a fresh NumPy
Generator
, so you should explicitly pass a seededGenerator
if you need reproducible results. If seed is an int, a newGenerator
instance is used, seeded with seed. If seed is already aGenerator
instance then that instance is used.
- nobs
- Returns:¶
- samplearray_like (
n
,d
) Sample from the joint distribution.
- samplearray_like (
Notes
The random samples are generated by creating a sample with uniform margins from the copula, and using
ppf
to convert uniform margins to the one specified by the marginal distribution.